diff --git a/README.md b/README.md index 45aa9dde19cce35a6a2e426d9ec6d212bb484181..4526ff4452a5f8025bbd5cb006e6f8eb32039ed6 100644 --- a/README.md +++ b/README.md @@ -15,27 +15,28 @@ Training material for the Git for Beginners ABiMS training session ### Git Basics 1. Creating a repository - 1. Default branches - 1. Adding / Editing / Removing Files & Folders - 1. Committing Changes + 1. Adding / editing / removing files & folders + 1. Committing changes 1. Pushing changes to the repository ### Branching Basics + 1. Default branches 1. Creating new branches 1. Switching between branches 1. Merging branches -### Team Collaboration +### Team collaboration 1. Project roles in GitLab 1. Branch Protection 1. Submitting Merge Requests 1. Handling Merge Requests 1. Resolving Conflicts -### Using Git outside of GitLab +### Using Git through the command line 1. Configuring remote access to GitLab 1. Git Survival Memo (`fetch`, `update`) - 1. Using Git from the Linux Command Line + +### Using Git through third party tools 1. Using Git inside R-Studio 1. Using Git inside PyCharm diff --git a/git-basics/README.md b/git-basics/README.md new file mode 100644 index 0000000000000000000000000000000000000000..6b13aa1d2bd1d18ca54fb24cb8fb231eb41c240f --- /dev/null +++ b/git-basics/README.md @@ -0,0 +1,73 @@ +# Git Basics + +## What's a repository ? + +A repository is a hierarchy of folders (directories) to store your project files and folders *as well as additional files used by Git to keep track of all operations performed on your project files and folders*. + + ### Is each project stored in a single repository ? + +Git is a distributed version management system. A specific project can be stored in multiple repositories. Usually, there is one reference repository used by all project contributors. All contributors have a local or work repository, which they initially cloned from the reference repository (more on this later). + +## What's a Branch ? + +In short: a branch is a name used to track the history of changes to files and folders over time, as a series of commits. +A repository can manage as many branches as needed (more on this later). When working on a Git project, there is always a *current* branch. Git provides operations to create/remove/switch between branches. + +## What's a Commit ? + +In short: a commit is a set of changes to files or folders that we want Git to keep track of, such as: + - Addition a file or folder + - Modification of the contents of a file + - Removal of a file or folder + - Renaming of a file or folder + +Git provides operations to specify which files should be part of a commit. + + +## Create Your First Repository + + ### [Log In to GitLab](/git-basics/media/gitlab-login.mp4) + + Log in to GitLab using your favourite account settings (GitLab, Google, GitHub, Twitter...) + +  + + ### [Create a new Project](/git-basics/media/gitlab-create-project.mp4) + + 1. Select **Create a Project** + 1. Select **Create Blank Project** + 1. Give it a sensible name for a collection of animal descriptions + 1. Keep the visibility **private** + 1. Check the **Initialize repository with a README** + 1. Select **Create Project** + + +  + + ### GitLab User Interface Main Panels + + #### Project Summary Information + + Recap with your project's name the number of _commits_, _branches_ (more on these soon) and _tags_ as well as storage space occupied by project files. + +  + + #### Current View and Most Recent Activity + + Which _branch_ are we looking at ? + What was the most recent activity in this branch ? + +  + + #### Files / Folders in the Current View + + Which files folders are part of the current _branch_ ? + If there's a `README.md` file, what's its contents ? + +  + + +# Git Basics - Exercises + + + diff --git a/git-basics/exercises.md b/git-basics/exercises.md new file mode 100644 index 0000000000000000000000000000000000000000..c817f9c8358531c85fbffb878e5254c92911dd5c --- /dev/null +++ b/git-basics/exercises.md @@ -0,0 +1,56 @@ +# Git Basics - Exercises + +## Create your repository on GitLab + +Log in to GitLab and create your repository (you can use the same name : _Animal Description Collection_) + +## Use the Web IDE to add content + +1. Pick one of birds, fish, insects, mammals, reptiles, imaginary and create a [Markdown](https://www.markdownguide.org/cheat-sheet/) file with the matching name (ex.: `imaginary.md`) + +1. Add some contents to the file using the following format: + + ``` + # Imaginary Animals Descriptions + + ## Gremlin + + Name + : Gremlin + + Color + : All kinds of + + Biotope + : Mostly urban but can live anywhere + + Comments + : Don't feed after midnight + + ## Totoro + + Name + : Totoro + + Color + : Grayish + + Biotope + : My neighbors garden + + Comments + : Can be quite vocal at times + ``` + +1. Create an `images` folder +1. Add one or more images of the animals you described (grabbed from WikiPedia) to the `images` folder. + +## Create your first commit + +1. Use the `Create commit...` button of the Web IDE +1. Check the `Commit to main branch` button **This is a really bad practice we will never repeat once we know how to use branches.** +1. Enter a commit message explaining what changes you made +1. Click the `Commit` button. + + + diff --git a/git-basics/media/current_files.png b/git-basics/media/current_files.png new file mode 100644 index 0000000000000000000000000000000000000000..39d61c293f1f46e447ce62bc848ba0d3e7584fa5 Binary files /dev/null and b/git-basics/media/current_files.png differ diff --git a/git-basics/media/gitlab-create-project.mp4 b/git-basics/media/gitlab-create-project.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..9d0b23d9fff13ae78cf2f551de8c7dd9f3f032e7 Binary files /dev/null and b/git-basics/media/gitlab-create-project.mp4 differ diff --git a/git-basics/media/gitlab-login.mp4 b/git-basics/media/gitlab-login.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..4d67c682ad8c6ec6452d0df71d5b28c4e142c328 Binary files /dev/null and b/git-basics/media/gitlab-login.mp4 differ diff --git a/git-basics/media/gitlab_create_project.png b/git-basics/media/gitlab_create_project.png new file mode 100644 index 0000000000000000000000000000000000000000..535fab7ef87790a653664d505fce71b92f63c464 Binary files /dev/null and b/git-basics/media/gitlab_create_project.png differ diff --git a/git-basics/media/gitlab_current.png b/git-basics/media/gitlab_current.png new file mode 100644 index 0000000000000000000000000000000000000000..8132846fa774864fbed8c9656a67936c3ff18413 Binary files /dev/null and b/git-basics/media/gitlab_current.png differ diff --git a/git-basics/media/gitlab_login.png b/git-basics/media/gitlab_login.png new file mode 100644 index 0000000000000000000000000000000000000000..314479e7c5b2b5d6e2e6c2a5343ece3b9d17a335 Binary files /dev/null and b/git-basics/media/gitlab_login.png differ diff --git a/git-basics/media/gitlab_project_info.png b/git-basics/media/gitlab_project_info.png new file mode 100644 index 0000000000000000000000000000000000000000..73e421a2fa3c2f1abf106248732e1c698a21f234 Binary files /dev/null and b/git-basics/media/gitlab_project_info.png differ