This shows you the differences between two versions of the page.
|
use_git_with_ease [2012/04/08 23:16] |
use_git_with_ease [2012/06/02 21:40] (current) |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | This tutorial introduces some of the minimal commands needed to use git. \\ | ||
| + | |||
| + | ==== Frequently Asked questions (FAQ) ==== | ||
| + | |||
| + | :?: How to get a project ?\\ | ||
| + | ** Answer:** If you are fetching project from [[http://www.github.com | github]] use the below command.\\ | ||
| + | // ''git clone git@github.com:jeffreyantony/GNUduino.git''// | ||
| + | \\ ''git clone git://git.osmocom.org/osmocom-bb.git'' \\ | ||
| + | |||
| + | :?: How to start a new project ?\\ | ||
| + | ** Answer:** Move into the project folder and give the below command which will initialise the project.\\ | ||
| + | // ''git init''// | ||
| + | \\ Once initialisation is done, all the files under that folder will be tracked by git tool.\\ | ||
| + | |||
| + | In github this can be done by | ||
| + | |||
| + | Global setup: | ||
| + | |||
| + | git config --global user.name "Jeffrey Antony" | ||
| + | git config --global user.email jeffreyantony@gmail.com | ||
| + | | ||
| + | |||
| + | Next steps: | ||
| + | |||
| + | mkdir WidePage | ||
| + | cd WidePage | ||
| + | git init | ||
| + | touch README | ||
| + | git add README | ||
| + | git commit -m 'first commit' | ||
| + | git remote add origin git@github.com:jeffreyantony/WidePage.git | ||
| + | git push -u origin master | ||
| + | | ||
| + | |||
| + | Existing Git Repo? | ||
| + | |||
| + | cd existing_git_repo | ||
| + | git remote add origin git@github.com:jeffreyantony/WidePage.git | ||
| + | git push -u origin master | ||
| + | | ||
| + | |||
| + | :?: How to start editing a file ?\\ | ||
| + | ** Answer:** There is nothing special to do while starting to edit a file. Just go ahead with editing. Git will take care. Don't forget to commit your changes so that your can switch between your changes. | ||
| + | |||
| + | :?: How to commit files ?\\ | ||
| + | ** Answer:** Use the below commands and don't forget to change the underlined words with your respective changes.\\ | ||
| + | // ''git add __filename__''// \\ | ||
| + | // ''git commit -m "__your commit message__"''// \\ | ||
| + | |||
| + | :?: How to push the changes in to the repository ?\\ | ||
| + | :?: How to bring a file to its previous version ?\\ | ||
| + | :?: How to know which all files are edited in our local machine with comparison to remote repository ?\\ | ||
| + | :?: How to merge changes from one file to another file ?\\ | ||
| + | |||
| + | ==== Links ==== | ||
| + | |||
| + | - http://gitref.org/ | ||
| + | - http://www.shakthimaan.com/downloads/glv/presentations/di-git-ally-managing-love-letters.pdf | ||
| + | - http://help.github.com/linux-set-up-git/ | ||
| + | - http://net.tutsplus.com/tutorials/tools-and-tips/how-to-work-with-github-and-multiple-accounts/ | ||
| + | - http://doblock.com/articles/using-public-keys-with-multiple-github-accounts | ||
| + | - http://sandarenu.blogspot.in/2011/09/how-to-use-multiple-git-accounts.html | ||
| + | - http://sirupsen.com/starting-with-git/ | ||
| + | - http://christoph.ruegg.name/blog/2010/5/5/git-howto-revert-a-commit-already-pushed-to-a-remote-reposit.html | ||
| + | |||
| + | |||
| + | |||
| + | ====== Level 1 Headline ====== | ||
| + | [[https://help.github.com/articles/set-up-git]] | ||
| + | |||