Monday, 9 January 2012

Basic functionality a git User needs to Know

Assumptions : Client has provided a git link ex:

git://github.com/rshetty/examplegit.git

To get your copy of app do

git clone  git://github.com/rshetty/examplegit.git

Note: By default, Git will create a directory that is the same name as the      project in the URL you give it - basically whatever is after the last slash     of the URL.  If you want something different, you can just put it at the     end of the command, after the URL.

To check multiple branch  :
git branch -r

To jump to a perticular branch :
git checkout branch_name

Once done: to keep updating your copy :
git pull

To check the complete difference in the app :
 git diff

for a perticular file give :
git diff file_name

to check latest commits :

git log

to just check modified files :

git status

and to commit the changes to your local repo :

git commit -m "message" filename  

Finally to push the code to server :

git push

To revert a file which is modified by you in the local mode
 
git checkout filename










No comments:

Post a Comment