Git
Introduction
Version control systems like Git are tools used to track changes to source code (or other collections of files and folders). As the name implies, these tools help maintain a history of changes; furthermore, they facilitate collaboration. Source : Missing-Semester/GitDocumentation
- - Initialize repository
- - Add / Delete from Staging
$ git checkout -- .
- - Commits
$ git commit --amend -m "An updated commit message"
- -
- -
$ git log --all --graph --decorate
- -
$ git checkout -b <branch>
- -
- -
- - Go back in time
$ git reset HEAD@{<id>}
- Change history in remote
$ git push origin HEAD -f
Terminology
- Init: Initialises git repo. Creates ".git" directory
- Add: Adds the changes in current directory to staging area
- Commit: Commits the staged changes to snapshot graph.
- Status: Shows the details of current changes and latest snapshot
- Log: Shows flattened version of the commit history. Could be
- Checkout: Moves head pointer and mutates contents of working directory corresponding to that commit. Could create a new branch.
- Merge: Merges current branch with branch specified. Could "auto-merge" or may cause "merge conflict"
- Remote: Remote repositories are versions of your project that are hosted on the internet/network somewhere. Remotes enable collaboration.
Links
- Git tutorials by Youtube/Tower
- Atlassian git tutorial