Skip to main content
added 1 character in body
Source Link
Tomáš Hübelbauer
  • 11k
  • 17
  • 76
  • 146

I am finding a lot of answers to how to make a local branch look like a remote branch, but in my case, I need to take in changes that were force pushed to the remote to refs/notes/commits.

The changes were made using git notes add. The remote was updated using git push origin refs/notes/* -f.

I have different history for refs/notes/commits locally. Until now I was using git fetch origin "refs/notes/*:refs/notes/**" to integrate remote notes changes to my local. With the forced push, the two histories are now disjoint. I want to throw away mine and take in theirs.

Since refs/notes/commits is not a branch (right?) I cannot use git push or git checkout to enter it and then git reset (again, right?). So, what can I use to make my local refs/notes* equivalent to the remote refs/notes/*?

I am finding a lot of answers to how to make a local branch look like a remote branch, but in my case, I need to take in changes that were force pushed to the remote to refs/notes/commits.

The changes were made using git notes add. The remote was updated using git push origin refs/notes/* -f.

I have different history for refs/notes/commits locally. Until now I was using git fetch origin "refs/notes/*:refs/notes/* to integrate remote notes changes to my local. With the forced push, the two histories are now disjoint. I want to throw away mine and take in theirs.

Since refs/notes/commits is not a branch (right?) I cannot use git push or git checkout to enter it and then git reset (again, right?). So, what can I use to make my local refs/notes* equivalent to the remote refs/notes/*?

I am finding a lot of answers to how to make a local branch look like a remote branch, but in my case, I need to take in changes that were force pushed to the remote to refs/notes/commits.

The changes were made using git notes add. The remote was updated using git push origin refs/notes/* -f.

I have different history for refs/notes/commits locally. Until now I was using git fetch origin "refs/notes/*:refs/notes/*" to integrate remote notes changes to my local. With the forced push, the two histories are now disjoint. I want to throw away mine and take in theirs.

Since refs/notes/commits is not a branch (right?) I cannot use git push or git checkout to enter it and then git reset (again, right?). So, what can I use to make my local refs/notes* equivalent to the remote refs/notes/*?

Source Link
Tomáš Hübelbauer
  • 11k
  • 17
  • 76
  • 146

Git fetch notes after forced push on the remote

I am finding a lot of answers to how to make a local branch look like a remote branch, but in my case, I need to take in changes that were force pushed to the remote to refs/notes/commits.

The changes were made using git notes add. The remote was updated using git push origin refs/notes/* -f.

I have different history for refs/notes/commits locally. Until now I was using git fetch origin "refs/notes/*:refs/notes/* to integrate remote notes changes to my local. With the forced push, the two histories are now disjoint. I want to throw away mine and take in theirs.

Since refs/notes/commits is not a branch (right?) I cannot use git push or git checkout to enter it and then git reset (again, right?). So, what can I use to make my local refs/notes* equivalent to the remote refs/notes/*?