-
Notifications
You must be signed in to change notification settings - Fork 3
Git Workflow
Sen Zhang edited this page May 28, 2017
·
1 revision
- set up personal remote repo
- login to your own github account
- navigate to the shared public remote repo, distributed_message_queue
- click "fork" button on the right corner to get the exact copy of shared public repo
- set up personal local repo
- get a copy from personal remote repo which you just set
$ git clone path/to/repo.git
- set a pointer, upstream, to shared public remote repo
$ git remote add upstream https://github.com/jsongcat/distributed_message_queue.git
- verify your remote, when you clone a copy from your personal remote repo, git automatically create a pointer, origin, to your personal remote repo
$ git remote -v origin https://github.com/<your own username>/distributed_message_queue.git (fetch) origin https://github.com/<your own username>/distributed_message_queue.git (push) upstream https://github.com/jsongcat/distributed_message_queue.git (fetch) upstream https://github.com/jsongcat/distributed_message_queue.git (push)
- get a copy from personal remote repo which you just set
- create a feature branch at your personal local repo
$ git branch myNewFeatureName $ git checkout myNewFeatureName
- write your code at your new feature branch at your personal local repo
- stage
$ git add .
- commit
$ git commit -m 'my commit summary'
- stage
- merge to shared remote repo (for code writer)
- update your personal local repo, aka, upstream
$ git pull upstream master
- see the merge conflict
$ git status
- save the merge result if there are conflicts
$ git add . $ git commit -m 'my merge summary'
- merge your feature branch to your master branch at your local repo
$ git checkout master $ git merge yourNewFeatureName
- solve the conflict if there are conflicts
- push updated local repo to your remote repo, aka, origin
$ git push origin master
- file a pull request
- click the 'pull request' button on your remote repo page
- set shared public repo and branch, your public repo and branch
- assign the reviewer to review your code
- notify the reviewer automatically
- update your personal local repo, aka, upstream
- merge to shared remote repo (for code reviewer)
- review the code
- solve the conflicts
- approve the pull request by click 'rebase and merge' button