Create Working Branch

Let me record the workflow about how to create your own working branch from master.

I git clone the original repo to local, then git checkout -b to a develop branch on top of master branch, for example:

1
(cd /GitRepos; git clone git@github.xxx.com:xxx.git)

Then go to local git repository

1
git checkout -b develop

After checkout to new branch, if you do nothing and get files changed, this is sometimes a format issue, go to edit .gitattributes, comment out the regex, for example:

1
# * text=auto

Save and run git status, you will see the change now is on .gitattributes, then undo the change and save.

Now you are in develop branch, let’s check the config information:

1
git config --list

Focus on the user.name and user.email, if they are empty, set them by

1
2
3
git config --global user.name xxx
git config --global user.email xxx
git commit --amend --reset-author

Then working on develop branch, when you run git push origin develop, this will create a pull request (you can decide merge to which branch) and a remote develop branch, then you can review and merge to master branch on git web.

Because there is no git repos fork, so run git pull origin master in develop branch to get sync up with latest updates from master branch.

0%