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:54] – [Adding a remote for the public project] 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 65: | Line 65: | ||
| </ | </ | ||
| - | You can now verify that your local clone has two registered remotes -- one for pulling new content added to the public project ('' | + | You can now verify that your local clone has two registered remotes -- one for pulling new content added to the public project ('' |
| < | < | ||
| Line 122: | Line 122: | ||
| Do all of this on a regular basis to keep everything in sync. | Do all of this on a regular basis to keep everything in sync. | ||
| - | ==== Contributing changes ==== | + | ===== Contributing changes |
| - | Contributing changes to the main project involves three steps: | + | ==== The general steps in contributing changes ==== |
| + | |||
| + | Contributing changes to the public GitHub | ||
| * Make and commit some //local changes// (preferably on a feature branch). | * Make and commit some //local changes// (preferably on a feature branch). | ||
| - | * Push those changes (that branch) to your GitHub fork. | + | * Push those changes (that branch) to your personal |
| - | * Make a "pull request" | + | * Over at GitHub, make a "pull request" |
| + | |||
| + | ==== Making some local changes ==== | ||
| - | First, create | + | For each set of related changes, start a new feature |
| < | < | ||
| - | $ 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 | + | Given the possibility that your pull request might provoke some comments about possible improvements, you can make those local improvements, |
| - | + | ||
| - | If all goes well and your change is accepted and committed, you will have to perform the two earlier steps to fetch and merge your changes into your local clone into the '' | + | |
| < | < | ||
| - | $ git fetch progit | + | $ git push -f rpjday rpjday/README_changes |
| - | $ git merge progit/master | + | |
| </ | </ | ||
| - | |||
| - | In addition, you can now delete the '' | ||