You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: book/06-github/sections/2-contributing.asc
+14-13Lines changed: 14 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -43,7 +43,7 @@ Here's how it generally works:
43
43
5. Open a Pull Request on GitHub.
44
44
6. Discuss, and optionally continue committing.
45
45
7. The project owner merges or closes the Pull Request.
46
-
8. Put the changes back in your GitHub public repository.
46
+
8. Sync the updated master back to your fork.
47
47
48
48
This is basically the Integration Manager workflow covered in <<ch05-distributed-git#_integration_manager>>, but instead of using email to communicate and review changes, teams use GitHub's web based tools.
49
49
@@ -422,13 +422,9 @@ If you look at <<_md_drag>>, you can see a small ``Parsed as Markdown'' hint abo
422
422
[[_fetch_and_push_on_different_repositories]]
423
423
==== Keep your GitHub public repository up-to-date
424
424
425
-
Once you forked from a GitHub repository, your forked repository lives alone and is autonomous regarding the original one.
425
+
Once you've forked a GitHub repository, your repository (your "fork") exists independently from the original.
426
426
In particular, when the original repository has new commits, GitHub informs you by a message like:
427
-
[source,text]
428
-
----
429
-
This branch is X commits behind <organization>:master.
Then your future fetches will fetch from `progit`.
462
+
<2> Set your `master` branch to fetch from the `progit` remote.
467
463
<3> Define the default push repository to `origin`.
468
464
469
-
Now you can fetch from `progit` and push to `origin` as simply as:
465
+
Once this is done, the workflow becomes much simpler:
470
466
471
467
[source,console]
472
468
----
473
469
$ git checkout master <1>
474
470
$ git pull <2>
475
471
$ git push <3>
476
472
----
473
+
477
474
<1> If you were on another branch, return to `master`.
478
475
<2> Fetch changes from `progit` and merge changes into `master`.
479
476
<3> Push your `master` branch to `origin`.
477
+
478
+
This approach can be useful, but it's not without downsides.
479
+
Git will happily do this work for you silently, but it won't warn you if you make a commit to `master`, pull from `progit`, then push to `origin` -- all of those operations are valid with this setup.
480
+
So you'll have to take care never to commit directly to `master`, since that branch effectively belongs to the upstream repository.
0 commit comments