Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| git_github_workflow [2020/01/27 14:58] – [Contributing changes] rpjday | git_github_workflow [2020/01/27 17:03] (current) – [Clone your personal fork to your local machine] rpjday | ||
|---|---|---|---|
| Line 21: | Line 21: | ||
| ==== Clone your personal fork to your local machine ==== | ==== Clone your personal fork to your local machine ==== | ||
| - | Once you've made that personal GitHub fork (agin, in my case, '' | + | Once you've made that personal GitHub fork (agin, in my case, '' |
| Since you'll (shortly) be working with two remotes for this workflow, when you clone your personal fork, select a remote name other than the default of '' | Since you'll (shortly) be working with two remotes for this workflow, when you clone your personal fork, select a remote name other than the default of '' | ||
| Line 28: | Line 28: | ||
| $ mkdir podman/ | $ mkdir podman/ | ||
| $ cd podman/ | $ cd podman/ | ||
| - | $ git clone https:// | + | $ git clone -o rpjday |
| </ | </ | ||
| Line 133: | Line 133: | ||
| ==== Making some local changes ==== | ==== Making some local changes ==== | ||
| + | |||
| + | For each set of related changes, start a new feature branch with a distinct name that reflects what that branch is doing: | ||
| < | < | ||
| - | $ git checkout -b topic/rpjday/issue42 | + | $ git checkout -b rpjday/README_changes |
| - | Switched to a new branch 'topic/rpjday/issue42' | + | Switched to a new branch ' |
| $ | $ | ||
| </ | </ | ||
| - | Make a simple change | + | For our example, make some trivial changes |
| < | < | ||
| - | $ git checkout | + | $ git commit |
| - | Switched to a new branch ' | + | [rpjday/README_changes b1a09348] README.md: silly changes |
| + | 1 file changed, 4 insertions(+) | ||
| $ | $ | ||
| </ | </ | ||
| + | ==== Pushing your work ==== | ||
| + | |||
| + | You can continue adding and committing (related) work to this feature branch and, once you're satisfied, you can push that branch to your personal GitHub fork with: | ||
| < | < | ||
| - | $ git commit -a -m "fix issue42" | + | $ git push rpjday rpjday/README_changes |
| - | [topic/rpjday/issue42 77fad5f] topic/rpjday/issue42 | + | |
| - | 1 file changed, 1 insertion(+), | + | |
| - | $ | + | |
| </ | </ | ||
| - | < | + | ==== And over At GitHub ==== |
| - | $ git show | + | |
| - | commit 77fad5f0aadd229628baa7811b0b49c7580d96f0 (HEAD -> topic/ | + | |
| - | Author: Robert P. J. Day < | + | |
| - | Date: Wed Feb 14 07:06:42 2018 -0500 | + | |
| - | fix issue42 | + | Provided you're logged into your account at GitHub, you'll suddenly see the appearance of a new branch '' |
| - | diff --git a/ | + | If all goes well and your change is accepted and committed (in this case, into the '' |
| - | index d7810fd..126bfd4 100644 | + | |
| - | --- a/ | + | < |
| - | +++ b/ | + | $ git fetch libpod |
| - | @@ -1,4 +1,4 @@ | + | $ git merge libpod/ |
| - | -= Pro Git, Second Edition | + | |
| - | += Pro Git, Second Edition (rday change) | + | |
| - | + | ||
| - | | + | |
| - | + | ||
| - | $ | + | |
| </ | </ | ||
| - | At this point, you can push this new branch to your GitHub fork: | + | In addition, if you have no further need of that local feature, you can delete it: |
| < | < | ||
| - | $ git push origin topic/rpjday/issue42 | + | $ git branch -d rpjday/README_changes |
| </ | </ | ||
| - | ==== And over At GitHub | + | ==== Adjusting your local branch |
| - | + | ||
| - | Provided you're logged into your account at GitHub, you'll suddenly see the appearance of a new branch '' | + | |
| - | If all goes well and your change is accepted and committed, you will have to perform | + | Given the possibility that your pull request might provoke some comments about possible improvements, you can make those local improvements, |
| < | < | ||
| - | $ git fetch progit | + | $ git push -f rpjday rpjday/README_changes |
| - | $ git merge progit/master | + | |
| </ | </ | ||
| - | |||
| - | In addition, you can now delete the '' | ||