Skip to content
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

Merged
merged 1 commit into from
Jan 24, 2018
Merged

Keeping branches updated #2760

merged 1 commit into from
Jan 24, 2018

Conversation

lgh2
Copy link
Contributor

@lgh2 lgh2 commented Jan 9, 2018

Adds instructions to docs on keeping remote branches updated.


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.
Copy link
Contributor

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.

Copy link
Contributor

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.
Copy link
Contributor

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:
Copy link
Contributor

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.
Copy link
Contributor

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.

git checkout master
git rebase upstream/master

Next, push the changes you have fetched to your ``origin`` branch on GitHub:
Copy link
Contributor

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.
Copy link
Contributor

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.
Copy link
Contributor

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.
Copy link
Contributor

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.

@lgh2 lgh2 force-pushed the keeping-branches-updated branch 2 times, most recently from 5b04062 to 0daba08 Compare January 12, 2018 21:52

git checkout awesome-feature
git fetch upstream
git rebase upstream/master
Copy link
Member

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.

Copy link
Contributor Author

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?

Copy link
Member

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.

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.
Copy link
Contributor

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.

@lgh2
Copy link
Contributor Author

lgh2 commented Jan 24, 2018

@di Did you have any other changes you'd like me to make?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants