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

doc, meta: document what to do if git push upstream master is rejected #12628

Closed
vsemozhetbyt opened this issue Apr 24, 2017 · 4 comments
Closed
Labels
doc Issues and PRs related to the documentations. meta Issues and PRs related to the general management of the project.

Comments

@vsemozhetbyt
Copy link
Contributor

vsemozhetbyt commented Apr 24, 2017

  • Subsystem: doc, meta

Trying to land a big PR after syncing the masters, while other collaborators actively pushed the same time, I've got this:

To https://github.com/nodejs/node
 ! [rejected]              master -> master (fetch first)
error: failed to push some refs to 'https://github.com/nodejs/node'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

Maybe it is worth to be documented in the COLLABORATOR_GUIDE.md#technical-howto what to do in this case.

@vsemozhetbyt vsemozhetbyt added doc Issues and PRs related to the documentations. meta Issues and PRs related to the general management of the project. labels Apr 24, 2017
@Fishrock123
Copy link
Contributor

Briefly, my usual workflow would be:

git checkout -b tmp
git checkout master
git remote update -p
git merge --ff-only upstream/master
git checkout tmp
git rebase master

<after rebase>

git checkout master
git merge --ff-only tmp

@Fishrock123
Copy link
Contributor

Although if I was merging someone else's pr without conflicts, I'd just git am the patch again after rebasing master. Typically much easier.

@gibfahn
Copy link
Member

gibfahn commented Apr 24, 2017

I'd just do:

git fetch --all
git rebase
git push

Trott added a commit to Trott/io.js that referenced this issue Aug 16, 2017
In COLLABORATOR_GUIDE.md, explain what to do if `git push upstream
master` is rejected.

Fixes: nodejs#12628
@Trott
Copy link
Member

Trott commented Aug 16, 2017

PR: #14848

@Trott Trott closed this as completed in d15a5c0 Aug 18, 2017
MylesBorins pushed a commit that referenced this issue Sep 10, 2017
In COLLABORATOR_GUIDE.md, explain what to do if `git push upstream
master` is rejected.

PR-URL: #14848
Fixes: #12628
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Yuta Hiroto <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
MylesBorins pushed a commit that referenced this issue Sep 12, 2017
In COLLABORATOR_GUIDE.md, explain what to do if `git push upstream
master` is rejected.

PR-URL: #14848
Fixes: #12628
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Yuta Hiroto <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
MylesBorins pushed a commit that referenced this issue Sep 20, 2017
In COLLABORATOR_GUIDE.md, explain what to do if `git push upstream
master` is rejected.

PR-URL: #14848
Fixes: #12628
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Yuta Hiroto <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc Issues and PRs related to the documentations. meta Issues and PRs related to the general management of the project.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants