• Initializes a git repository on the current folder
git init
  • Add a remote git repository
git remote add <name> <url>
  • Fetches a remote git branch
git pull <name> serverbranch:localbranch
  • Adds a new file to git
git add <filename>
  • Saves the new changes to the git branch(local)
git commit -m "<commit message>"
  • Pushes the local branch to the server
git push <name> localbranch:serverbranch
  • Switches to a new branch
git checkout <branchname>
  • Creates and switches to a new branch
git checkout -b <branchname>
  • See all the merges
git branch
  • Merges a branch with the current branch
git merge <branchname>

More documentation




blog comments powered by Disqus



This work is licensed under the CC By-SA 3.0 , without all the cruft that would otherwise be put at the bottom of the page.

Sister Sites: GATE CSE Wiki, GATE CSE, Aptitude Overflow