Skip to content

Question about backporting #13833

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
vsemozhetbyt opened this issue Jun 21, 2017 · 9 comments
Closed

Question about backporting #13833

vsemozhetbyt opened this issue Jun 21, 2017 · 9 comments
Labels
meta Issues and PRs related to the general management of the project.

Comments

@vsemozhetbyt
Copy link
Contributor

vsemozhetbyt commented Jun 21, 2017

According to the guide, I launch:

git branch v6.x-staging upstream/v6.x-staging
git checkout v6.x-staging
git reset --hard upstream/v6.x-staging

and get this:

HEAD is now at b483675300 test,doc: document `crashOnUnhandledRejection()`

while the last commit here is test: dynamic port in cluster disconnect. Also, my local file tree is older than one I see here.

What do I miss?

@vsemozhetbyt vsemozhetbyt added the meta Issues and PRs related to the general management of the project. label Jun 21, 2017
@mscdex
Copy link
Contributor

mscdex commented Jun 21, 2017

Did you try to git pull in changes from remote/upstream?

@vsemozhetbyt
Copy link
Contributor Author

vsemozhetbyt commented Jun 21, 2017

@mscdex No. Should I? The guide says nothing about git pull. And I've previously deleted all the staging local branches and have run git branch v6.x-staging upstream/v6.x-staging after the test: dynamic port in cluster disconnect landed on upstream/v6.x-staging.

@refack
Copy link
Contributor

refack commented Jun 21, 2017

I've open a PR to update the guide (after similar experience) #13749

@vsemozhetbyt
Copy link
Contributor Author

@refack So, assuming I have no local staging branch, how should I proceed to create a new updated one from upstream/v6.x-staging? Is it git fetch upstream v6.x-staging:v6.x-staging -f as in your PR?

@refack
Copy link
Contributor

refack commented Jun 21, 2017

Yes git fetch upstream v6.x-staging:v6.x-staging -f
if git remote upstream is nodejs/node, that command will create local v6.x-staging based on upstream/v6.x-staging and -f will overwrite any old v6.x-staging you might have had.

Then you git checkout -b backport-XXXX-to-v6.x v6.x-staging that will make a new (-b) branch backport-XXXX-to-v6.x based on your newly fetched v6.x-staging

@gibfahn
Copy link
Member

gibfahn commented Jun 21, 2017

What @refack says is true, but the more common workflow when you're doing anything with git is:

git fetch --all # Update all your remote branches
git checkout v6.x-staging
git status # If "up to date" then you're done
git merge --ff-only # If you're "x commits behind"
git reset --hard up/v6.x-staging #  If "your branch has diverged from the upstream"

Git aliases are quite helpful for this, I do:

g fa
g co v6.x-staging
g s
g mf
g rhh

I recommend avoiding git pull unless you've set pull.rebase = true.

@refack
Copy link
Contributor

refack commented Jun 21, 2017

I'm special kind of tweaker, so git fetch --all doesn't work for me (since I removed the fetch +=* from .git/config because there are too many branches).
git fetch OR pull upstream v6.x-staging:v6.x-staging -f does the merge and reset steps in one (but discards any local changes to v6.x-staging which if you are not @gibfahn you should not have).

@gibfahn
Copy link
Member

gibfahn commented Jun 21, 2017

I'm special kind of tweaker,

I thought that was just because git fetch --all takes ages on Windows (it's about 3s on my machine, and I have 3 remotes).

@refack
Copy link
Contributor

refack commented Jun 21, 2017

I thought that was just because git fetch --all takes ages on Windows (it's about 3s on my machine).

Not so bad for my fork, nodejs/node takes ~10-15 seconds (which I assume is a GitHub bug, since they are clones 😕 )

P.S. the problem is how the tree looks in the GUI (and that's with "compressed graph")
image

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
meta Issues and PRs related to the general management of the project.
Projects
None yet
Development

No branches or pull requests

4 participants