Terminology
- 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:
Informational Commands
- Repository Status
- Commit History
- Get current branch name
Checkin Commands
- Push code to a remote at a particular branch
-
-u
option points your current local branch to the remote branch named
- Stage files
- Stages all
- Stages new and modified, without deleted
- stages modified and deleted, without new
- Commit
- Aborting a merge
- Discard local changes
- Stash Local changes and drop them
Checkout
- Fetch all information about new branches etc. from remote
- Pull the branch data from remote
Branching
- Switch to existing branch
- Switch to new branch on the current workspace i.e. branch off
- Push current branch to remote and track it
Remotes
- List Remotes
- Change Remote URL
- Change Remote name
- Remove a remote
- Add a remote