Just got known with branches. I got a problem: I'm at master on local machine. I do
git checkout "commit_hash"
After this a make a branch
git branch "new_branch_name"
Now i want to push it to Bitbucket, and then i want to pull same stuff to my server repository, and to not damage the master branch during this process. Please help me!
git push --set-upstream origin new_branch_name
# or, shorter:
git push -u origin new_branch_name
This will push the branch and set it so it will always be pushed to the same branch on origin.
on the server:
git fetch origin new_branch_name
git checkout new_branch_name
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.