Git Cheat Sheet
20 August 2019 Link
- HEAD is not the latest revision, it's the current revision. Usually, it's the latest revision of the current branch, but it doesn't have to be.
- master is a name commonly given to the main branch, but it could be called anything else (or there could be no main branch).
- origin is a name commonly given to the main remote. remote is another repository that you can pull from and push to. Usually it's on some server, like github.
Good GUI Software
- Git Extensions - Very good for bash and windows explorer integration
- SourceTree - Excellent GUI to manage the whole repository and look at it visually. Better visual representation by default then git extensions since gives the exact date and time.
Updating a submodule
- Open a git bash at the sub-module directory then type:
- Push code to a remote at a particular branch
-u option points your current local branch to the remote branch named
- Stages new and modified, without deleted
- stages modified and deleted, without new
- Stash Local changes and drop them
- Fetch all information about new branches etc. from remote
- Pull the branch data from remote
- Switch to existing branch
- Switch to new branch on the current workspace i.e. branch off
- Push current branch to remote and track it
Tutorial and Help