Below are commands those are self explanatory:
-
To clone your branch in local
$ git clone [your git repository url] Clone specific branch in local
$ git clone [your git repository url] -b [branch name]
ORAfter cloning your branch go to that branch to check branch status or perform any git operations, below command will show you current branch
$ git branch-
Checkout specific branch from git
$ git checkout [branch1] -
Merge branch2 into branch1
$ git merge [branch2] -
Stash your changes before pull
$ git stash -
Pull latest changes from current branch
$ git pull -
Get stashed changes back into local
$ git stash apply -
Add all your changes
$ git add -A -
Add specific files
$ git add [/file path] [/another file path] [..etc] -
Commit your changes with message
$ git commit -m "[your message]" -
Push your committed changes in the branch
$ git push origin [branch name] -
Pull latest changes
$ git pull --rebase -
Create new branch and checkout in this branch
$ git checkout -b [your new branch name] -
Push the branch on git hub
$ git push origin [your new branch name]
$ git clone -b [branch name] [your git repository url]
No comments:
Post a Comment