Research on Git - bounswe/2021SpringGroup9 GitHub Wiki
Git is a version control system for tracking changes in files. It was created by Linus Torvalds back in 2005. Git tracks what is changed, who changed it, when it was changed. And also you can revert back to any version of the file that has been committed. This gives developers a huge benefit such as in case of any bugs or missdevelopments.
Git allows you to work with multiple developers without having to be on the same network. This is due to the distributed (decentralized) concept of Git. Also another cool feature of git is that any contributor can start up his/her own branch and not effect the other people's work. This is really helpful when working in a group project.
There are basically two labels: HEAD and BRANCH
git init
: initialize an empty git repository in the directory
git clone <url>
: clone an existing repository into the directory
git add <filename>
: writes the file into the repository
git commit
: creates a commit object with an ID and labels it (head & branch)
git branch <branchname>
: create a new branch (local until push)
git push -u origin <branchname>
: push branch to the remote repository
git checkout <branchname>
: switch to the new branch (move HEAD label to the new branch where commits to the repository will go)
git checkout -b <branchname>
: create and switch to the new branch
git merge <branchname>
: merge with the current parent branch
git branch --list
: list all branches
git branch -d <branchname>
: delete the branch
git reset --hard <commitID>
: move the HEAD label back to the commit ID
git reset --hard HEAD^
: move the HEAD label back by one commit
git status
: information about the current branch (files that are created, commits, push, pull etc.)
git push origin <branchname>
: commits are uploaded to origin
git pull origin
: updates and applies the changes to your local environment
Tech Talk: Linus Torvalds on git (1h 10m)
An old but informative tech talk.
- Fundamental ideas behind Git.
- Comparison of Git with other similar systems.
- Advantages of the distributed approach in version control systems.
- Some best practices for using Git.
- https://www.youtube.com/watch?v=SWYqp7iY_Tc
- https://www.freecodecamp.org/news/10-important-git-commands-that-every-developer-should-know/
- https://git-scm.com/book/en/v2/Getting-Started-What-is-Git%3F
- https://medium.com/@isaacdecoded/git-implementing-gitflow-workflow-b9d0fed494e5-https://dev.to/mollynem/git-github--workflow-fundamentals-5496
- Git For Ages 4 And Up
- https://git-scm.com/downloads/logos