Git it done
We understand using Git for the first time might be a bit overwhelming. Unlike what we are used to git is not a software with an interface instead you have to use it in the great terminal. How ever there are ways to help you get started. We recommend using it in combination with VS code and the git graph extension is a great way to visualize the commit history being made.
Below are some helpful resources we have collected.
Useful commands
git status
- command to see the status of your current state
git pull
- pulls in the resent changes made in the remote repo. Usually the first command we run when we reopen a repo.
git add
- Adds the changes in the working tree to the staging aria to prepare it for commit
Git commit -m "my commit note"
- captures a snap shot of the current repo stage. This is very useful for the ability to be able to go back in time.
Git push
- used to push the local changes to a remote repo
Git checkout [commit id or branch name]
- enables you to go back to earlier commits stages.
Git log
- Shows you the commit history with messages and commit ID.
git log --graph --decorate --pretty --oneline --all
- Git log that displays the history in online and makes it look a bit nicer
- this site is great to type in commands to get a good explanation of the watch component is doing
Note that before committing and pushing it's good practice to do a pull command if any changes have been made. This can prevent conflicts.
Gitlab and Github
Gitlab and Github are two similar platforms to host remote repo's. In the Fab academy we use the Fab could that is connected to Gitlab.
The common misconception about GitHub
Videos
The modern codder
Short well explained git videos looking at common git commands is a time well spent.
Git Fundamentals: Staging area, repository, working directory, file states, and commits tutorial.
Lecture 6: Version Control (git) (2020)
Lecture 6: Version Control (git) (2020)
Longer lecture that goes through some basics of the thought process behind Git and how it works.
Hvað er Git?
On our youtube channel Þórarinn BB has made a Git explanation video in Icelandic to get you going
We hope you find these notes useful and happy Git-ing things done!