Last active
March 8, 2016 16:44
-
-
Save bcoca/89166eb726ab6f174e8f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Github workflow | |
=============== | |
Fork a repo using github GUI, now there are 2 repos you are going to deal with, 1 the repo under your user bcoca/ansible and the main project ansible/ansible | |
* Clone the ansible repo (this is now 'origin'), the following assumes youre ssh keys are setup. | |
There are several ways of doing this and organizing your workflow, this is just 'my way' and it can be used with several variations. | |
Those with direct commit access might want to reverse this, you cannot count on direct pushes being rejected. | |
#>git clone [email protected]:ansible/ansible | |
* Add your personal repo:: | |
#>git remote add bcoca [email protected]:bcoca/ansible | |
Commiters should use the main repo here:: | |
#>git remote add ansible [email protected]:ansible/ansible | |
* update submodules (you probably need to do this often, specially when switching branches):: | |
#>git submodule update | |
* keep updated from upstream:: | |
#>git pull --rebase | |
Commiters with direct acccess should have the default upstream as their own repo, so they need to do this:: | |
#>git pull --rebase ansible devel | |
* checkout the master (ansible uses devel as 'master'):: | |
#> git checkout origin/devel -b devel | |
* Optionally, keep your repo udated (this is useful if you want to do 'cleanup' on the github side):: | |
#> git push bcoca HEAD:devel | |
* work on a feature by creating a 'feature branch':: | |
#> git checkout origin/devel -b feature_a | |
* push a feature to YOUR repo to ready a PR:: | |
#> git push bcoca HEAD:feature_a | |
This does not need to match the local name for the branch nor even be on a different branch than devel/master, but it is easier if you keep it consistent. | |
Once pushed to your repo you can use the github GUI to create the pull request (new branches automatically show with PR button). | |
If merged, you will see a 'delete branch' button on the PR, you can do this to keep your github repo clean. After a rebase, use `git branch --merged` to find them locally. | |
* if you did work on devel but now want to save the branch, rename(I do this often):: | |
#> git branch -m feature_a | |
You might want to checkout devel again as you just 'moved it':: | |
#> git co origin/devel -b devel |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment