Instructions for Using Git on your Local Computer
One Time Steps:
- Download Git, nothing else: Link
- Open the Terminal: Link
- Learn to navigate in the Terminal: Link
- Go into the folder of the project, you want to use with Git (by using the commands you learned in Step 3)
- Terminal: Initialize this folder as a git project (called
repo):git init
Repeated Steps:
- Editor: Create or edit your file, e.g.
index.htmlwith the Editor you already used (Atom, VSC, Sublime, Notepad, does NOT matter) - Terminal: Now you can make a Snapshot of this file, like a Save Game in a Video Game: you add the changed files you want to add (e.g.
index.html) to the Save Game, :git add index.html. Add as many files you want. If you didn’t change a file, you can’t add it, because git only tracks differences. - Terminal: You have put your desired files into the Save Game. Now you have to give your Okay to actually save it:
git commit -m "your message". - Terminal: You can see a list of your Snapshots/Save Games:
git log
Workflow Recap:
- Initialize Project:
git init - Add files into Save Game:
git add [filename]. Add all files:git add .(a dot instead of the filename) - Confirm the Save Game:
git commit -m "your message" - See a list of all your Save Games:
git log - If you don’t know, which files you actually changed, you can check the status of your folder:
git status
So, there are 3 commands to actually use git on your computer: init , add, commit
Now, there are two major issues:
- How can I transfer my code to another computer?
- How can I prevent my data from being lost, when my computer gets damaged?
That’s when an Online Git Hoster, e.g. Github, Bitbucket, Gitlab, comes into play.
…
…
…
Instructions for Sending your Local Git Files to an Online Git Hoster
One Time Steps:
- Create an account, e.g. Github
- Click
+andNew Repository, give it a name, do not include a readme (write one on your computer) and save it. - Terminal: in your local Git folder: Now your local Git Project has to know, where it has to upload the data:
git remote add origin https://github.com/yourName/yourRepo.git. You can find the actual link in your online repo.
Repeated Steps:
- Terminal: Now you can upload your data:
git push origin master. You need your account data.
Workflow Recap:
- Upload all your local Save Games to the Online Git Hoster:
git push origin master
…
…
…
Summary
- You need to install one tool:
git - You need a Terminal. You can use the built-in Terminal or download another one.
- If you want to upload your data, you need an account, e.g. Github, Bitbucket, Gitlab.
Complete Workflow (Recap of Section 1 and 2):
- Initialize Project:
git init - Add files into Save Game:
git add [filename]. Add all files:git add .(a dot instead of the filename) - Confirm the Save Game:
git commit -m "your message" - Upload all your local Save Games to the Online Git Hoster:
git push origin master. You do not need to alwayspushaftercommit. If youpushonce per day, all your Save Games will be pushed.





