Reputation: 18328
If other developers in the team have two branches: master and develop, then, I join the team, and initially after I cloned the project, I have only a master branch, meanwhile, the other team members are continuing developing & pushing code to the develop branch, and they have not yet merge the code from develop to master.
I would like to join the development on develop branch, is it so that I should create develop branch on my machine first, then switch from master to develop branch by git branch develop
, then pull origin develop
, after that I will get the up-to-date code on develop branch as other developers'? or Is there anything wrong in my process?
another question is, is Git branch name case sensitive or not?
-------------------More info in my case---------
I do not have develop branch yet. I have only master branch currently. I cloned the project long time ago, at that time there is only master branch, then I join the team now. I would like now to get the up-to-date develop and master branches as other developers'
Upvotes: 0
Views: 167
Reputation: 1397
Or rather,
git checkout -b develop origin/develop
(Assume your git remote is called origin
). So the local branch develop
will now track the remote branch origin/develop
.
And to list all remote branches,
git branch -r
Upvotes: 0
Reputation: 28981
You could do just git checkout develop
. If the develop
branch has been fetched from remote repository, the git will create a local branch from the remote one and will set tracking of it.
Branch names are files on a file system. So, on windows it's case insensitive, on linux it's sensitive.
Upvotes: 2
Reputation: 363807
The easiest way to get the develop
branch from your Git remote, which I assume is called origin
, is:
$ git fetch origin
$ git checkout develop
If your version of Git is recent enough, it will tell you that you now have a "remote tracking branch" develop
.
And yes, branch names are case-sensitive.
Upvotes: 0