简体   繁体   中英

How to push to a remote git branch on Gitlab?

I have this repo on GiLab:

https://gitlab.com/testrepo/api.git

There's a branch on this repo called testing . How can I push to the testing branch of this repo ?

If I do:

git push origin master

It'd push my master to probably the master of the repo.

You can use the command:

git push origin <your_local_branch>:<remote_branch>

to push on any branch in git. In your example, this would be equivalent to running:

git push origin master:testing

You can also try this if you push on any branch in git

If nothing works out go from the basic, create a new branch and go to that branch by git checkout branch_name and make the required changes in the code, than add ., commit and for pushing the local changes to git branch use below command. It should work.

$ git push --set-upstream origin Name_of_the_branch

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