Reputation: 2988
I am involved in a project working with a team of developers located in another country.
They have their own .git server. They only granted me read access (I can pull, but no push).
I have a Bitbucket account where I pushed the code as well. I added this as a [remote “myBBaccount”]
in .git/config
file.
If I want to make a change, I push my changes to Bitbucket and send them a pull request. They will then pull from my Bitbucket account. They want to use this setup as it is safer for them apparently.
I usually do a git pull
, do my work (usually on master branch, I know, not the best idea) and then do a git push myBBaccount
.
But recently, they asked me to pull develop
branch instead of master. They have multiple branches on their repo. I am not sure how to deal with this new workflow.
Should I just do a git branch –a
to see all the branches on my machine, and then git checkout develop
, work on that and just push using git push myBBaccount
? I am not sure this is the way to go. Should I do any merges?
I am using git 2.0.4.
Upvotes: 0
Views: 78
Reputation: 1129
If you use recent enough version of git (>1.9 should do), git checkout develop
should indeed create a new local branch named develop
tracking the remote branch (i.e. origin/develop
), and then you would push as you said (again, check your version of git - old versions did some surprising things when pushing).
As for merging, it depends on what the team wants from you. If they just want you to make some changes on develop
and submit them, you don't do any merging.
Upvotes: 1