I'm not sure how I got into this state, but my master
branch on my local git-svn repo seems to be pointing to the remote UAT branch.
git status
# On branch master nothing to commit (working directory clean)
git svn dcommit Committing to https://svn...com/MyRepo/branches/UAT ...
how do I fix this?
I think what you're trying to fix is that your local "master" branch is based on the remote UAC branch, as opposed to the remote trunk. If you're happy to lose your commits, you can simply run the below, which will checkout the trunk and then move the master branch to your current point.
git checkout remotes/trunk
git checkout -B master
If you don't want to lose your commits, git rebase
is your friend. Use the below:
git rebase $(git merge-base remotes/UAC master) master --onto remotes/trunk
This works out the common parent of the UAC branch and the local master branch, makes all the commits from there to the tip of the master branch onto the trunk, then moves the master branch to point there.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With