简体   繁体   中英

Push locally committed changes to new branch

I am currently in master branch, I have committed the changes (locally) and tried to push it but it got rejected because I don't have access to push to master branch. Now I have created another branch dev where I have the permission to push.

Since I have already committed locally to master branch, how do I push these committed changes of master to dev branch?

Assuming your remote is named origin ,

git push origin master:dev

would achieve it by explicitly giving source and destination. See it explained in this paragraph .

This can be run from any branch as it's not using current branch for anything.

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM