Thursday, September 18, 2014

Some basic commands of GIT

I started learning git and using git in my current project so sharing few git command that are very basic everyone,

You can enjoy learning git commands:

a) For add a file:
            git add -A
b) For Commit:
 git commit –a –m “Comment”
c) For Push:
                Git push origin csn-4973
d) Merge Tool:
                Git mergetool –y
e) For Update:
       Go to Parent Branch :
git checkout ParentBranchName
git fetch
git reset – hard origin/ParentBranchName
f) Goto Child branch
                Git checkout ChildBranchName
                Git fetch
                Git reset – hard origin/ChildBranchName
g) Merge Command
                Git merge ParentBranchName (Parent Branch: This will down merge parent branch changes to child)

h) Pull command:
Git pull origin ParentBranchName

i) Revert Of Revert :
Git checkout prod-child-branch
Git pull origin ccid-42
Git revert SHA-CODE
Git Reset HEAD
Git push origin prod-10892
j) Save Local Changes to STASH:
             Git stash “Comment”
k) To Get All Stash changes:

             Git Stash apply


Happy Coding!!!!

Thanks ..

No comments:

Post a Comment