This is a repository for Git newbies to fork and play with.
- Create a GitHub account if you have not already: https://github.com/join
- install Git: https://git-scm.com/download/win
- If you have Git installed already, please make sure that you have at least version 2.29 (required for storing credentials securely):
git version
If you do not have at least version 2.29
, please update Git:
git update-git-for-windows
- install Git, see here
- Git should already be installed on your machine. To check, please run:
git version
If not, please google "install git {your distro}" and you should find out how to install it.
Open a terminal (Mac / Linux) or Git Bash (Windows).
Copy each of the following commands, adapt the name and email address (the email address should be the address you used for your GitHub account), and hit enter.
git config --global user.name 'Jane Doe'
git config --global user.email '[email protected]'
To start working with this repository and changing things, you need your own copy of it. You achieve this by "forking" the original repo. Just select "Fork" in the menu above.
Now as you own a perfect copy of this repo, you can download it to your own machine. In git we call this "cloning".
To clone the repo we use the terminal (Mac / Linux) or Git Bash (Windows).
First we want to navigate to the folder on your machine where we want to store the repo. The command we use is cd
, which stands for "change directory" and mkdir
which means "make directory. You can use cd
sequentually to find the right folder. This can look like the following on my machine.
cd Documents
cd Hack_and_Harvest
mkdir Git_Workshop
cd Git_Workshop
With these commands we navigated from my home folder to Documents and then into the folder "Hack_and_Harvest". Inside this folder we created the new folder "Git_Workshop" and afterwards navigated into this (so far) empty folder. Depending on how you your file system looks like, this will look different for you and you might have to adapt the folder names. To check where you are right now with the terminal you can use ls
to get a list of folders and files inside your current (terminal) folder.
When we finally arrive in our target folder where we want to store this repo, we can clone it!
Therefore just use:
git clone https://github.com/{your_github_username}/git-newbie-hack_and_harvest
If you are doing this the first time you will need to prove to Github who you are. Just fill in your Github username and passwort in the prompt:
Git should clone your repository. You can confirm it is there by running ls
in your Git bash window
ls
git-newbie-hack_and_harvest
should be in the list.
Awesome! Now you can start playing around with the repo! 🚀
- Git Book - Git Basics Chapter: very good overview!
- Git our sh*t together - VSCode: a similar workshop to this one but with the excellent Git VSCode extension
- Git bascis - Most important commands: extremely helpful resource and 90% of commands you ever need!
- Git Katas: command line Git through focused exercises
- Learn Git Branching: interactive exercises to learn git branching