Tag Archives: git

Important Git commands and Tutorials

How to get help for a Git commands

git help [-a|–all|-i|–info|-m|–man|-w|–web] [COMMAND]

Example: git help git

It launches a browser and shows a help in HTML.

Setting up local repository and making initial push:

cd my_project
git init
git add *
git commit -m "My initial commit message"
git remote add origin [email protected].com:my_project.git
git push -u origin master

Checkout repository

git clone git://github.com/schacon/grit.git

To commit changes to the local repository just do add, than commit. If you want to push the local branch/changes to the remote repository just do push command below.

git add --all

git commit --all

git push

Push to repository command

git push <remote> <local branch name>:<remote branch to push into>
git push [--all | --mirror | --tags] [--follow-tags] [-n | --dry-run] [--receive-pack=]
           [--repo=] [-f | --force] [--prune] [-v | --verbose] [-u | --set-upstream]
           [--force-with-lease[=[:]]]
           [--no-verify] [ […]]

Further commands to find in following links.

Everyday Git with 20 commands

https://www.kernel.org/pub/software/scm/git/docs/everyday.html

Good Git Tutorials

Tutorial 1 first to make – http://git-scm.com/docs/gittutorial

Tutorial 2 second to make – http://git-scm.com/docs/gittutorial-2.html

Further Tutorial – http://www.vogella.com/tutorials/Git/article.html#firstgit_repostatus