Reputation: 5779
I done a clone of a projet via ssh
git clone ssh ssh://[email protected]:IMER/ropolo.git
master
branch is protected so I can't push my changed.
there is another branch dev_ropolo
.
Do I need to bring this branch locally. What is needed to do to be able to push my change to this branch?
Edit:
$ git fetch
* [new branch] ropolo -> origin/ropolo
$ git branch
* master
Upvotes: 10
Views: 77552
Reputation: 2160
git push <remote> <branch with new changes>:<branch you are pushing to>
Eg : git push origin branch1:branch2
Upvotes: 14
Reputation: 1
to change the branch run:
$ git checkout -b branch_name
to push code to branch run:
$ git push origin remote_branch_name
Upvotes: -1
Reputation: 8179
You said you cloned locally the repository, you can then access the branch dev_ropolo
via:
git checkout dev_ropolo
you now have selected dev_ropolo
as the current branch: do your local changes, add and commit, and then push them using:
git push origin dev_ropolo
(assuming that the remote is set to origin
)
Upvotes: 5
Reputation: 9931
Use fetch command in the local repo
$ git fetch
check that your branch has come to your local using
$ git branch
now change your branch using checkout
$ git checkout -b branch_name
do some changes then
$ git add .
$ git commit -m "message"
$ git push origin remote_branch_name
Upvotes: 14