How to replace local branch with remote branch [message #1763714] |
Thu, 18 May 2017 21:57 |
David M. Karr Messages: 801 Registered: July 2009 |
Senior Member |
|
|
This is more of a pure git question, but perhaps there's a shortcut for this in egit.
We use BitBucket Server as our remote.
I created a branch from master in my remote, did some work, committed changes, commited more changes, then pushed my branch to remote. I then made more local changes, committed them and pushed them.
At some point, I think I had started to commit/push some changes in the git staging view and realized I had to make another change, but I decided to try "Amend Previous Commit" instead. I did that, but it reported an error that it didn't elaborate on, and at that point I got stuck in some sort of conflict situation.
Now, when I run "git status" from the shell, I get this:
On branch blah
Your branch and 'origin/blah' have diverged,
and have 1 and 1 different commit each, respectively.
(use "git pull" to merge the remote branch into yours)
Changes not staged for commit:
I tried doing a pull, and that produced conflicts. I tried doing a hard reset, but that just puts me back in the state reported by "git status".
At this point, I'd be perfectly happy to blow away my local branch and replace it with the remote branch (or vice versa), and then continue making additional changes. I don't understand how to do that.
|
|
|
|
Powered by
FUDForum. Page generated in 0.02479 seconds