-
Notifications
You must be signed in to change notification settings - Fork 963
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Keeping branches updated #2760
Keeping branches updated #2760
Conversation
e3c8c52
to
726b7a0
Compare
|
||
As you work, it is helpful to keep your local branch up-to-date with the PRs | ||
that are merged into the main Warehouse repository. Most people working on | ||
the project use this workflow. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The wording here implies that you're keeping a single branch up-to-date with multiple branches (since each PR is a branch). I suggest you revise to say something about keeping your local master branch up-to-date with the master branch in the main Warehouse repository, which moves forward as maintainers merge pull requests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I figure you're still working on this - just a reminder.
upstream https://github.com/pypa/warehouse.git (push) | ||
|
||
|
||
In the example above, USERNAME is your username on GitHub. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please put backticks or similar around code-type words like USERNAME in this document.
$ git checkout master | ||
$ git rebase upstream/master | ||
|
||
Next, push the changes you have fetched to your origin branch on GitHub: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean your master branch on your origin repo?
$ git push origin master | ||
|
||
Now your local branch and your origin are up-to-date with the most recent | ||
changes on the upstream Warehouse branch. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please rewrite to distinguish branches and repositories more clearly.
726b7a0
to
acc6248
Compare
git checkout master | ||
git rebase upstream/master | ||
|
||
Next, push the changes you have fetched to your ``origin`` branch on GitHub: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd reword as:
Next, push the changes you have fetched to the master branch on your
origin
repository on GitHub:
|
||
As you work, it is helpful to keep your local branch up-to-date with the PRs | ||
that are merged into the main Warehouse repository. Most people working on | ||
the project use this workflow. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I figure you're still working on this - just a reminder.
git push origin master | ||
|
||
Now your local branch and your ``origin`` are up-to-date with the most recent | ||
changes on the ``upstream`` Warehouse branch. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you should use the word "master" more often here when referring to a master branch, to distinguish from remotes like "origin" & "upstream".
git rebase upstream/master | ||
|
||
Now your feature branch has been updated with the latest changes from the | ||
``upstream`` Warehouse repository. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd reword as:
Now your feature branch has been updated with the latest changes from the master branch on the
upstream
Warehouse repository.
5b04062
to
0daba08
Compare
|
||
git checkout awesome-feature | ||
git fetch upstream | ||
git rebase upstream/master |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be worth mentioning the next step here as well: force-pushing the branch to the remote.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean force-pushing the feature branch to origin
while you are working? Or for making a pull request, or both?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to keep your branch up-to-date on your remote, whether you've already made a PR or not.
The master
branch here moves somewhat quickly due to all the dependency upgrades that get merged, so it's pretty likely that a new contributor will have to force-push at least once while working on their pull request.
0daba08
to
db801a8
Compare
db801a8
to
8f8e5fb
Compare
git push -f origin awesome-feature | ||
|
||
The ``-f`` flag after ``push`` updates your ``origin`` feature branch with the | ||
changes you have made on your local feature branch. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should explain here that -f
means "force" -- you are implying that it means "feature"!
You should also explain here that if you DO have a pull request open, updating the branch on origin
will update the PR.
8f8e5fb
to
d14ab6a
Compare
@di Did you have any other changes you'd like me to make? |
Adds instructions to docs on keeping remote branches updated.