Can I do following in a simpler way?
git checkout origin/master
git branch -D master
git branch master
git checkout master
|
Can I do following in a simpler way?
|
|||
|
|
|
Something like:
with step 2 being optional. |
|||
|
|
I think even VonC's answer has complexity compared to this option:
git automatically logs every value of a ref (through the reflog). So after you run that command, then VonC's answer is correct, but it wastes time checkout out the old value of master into the filesystem. If you care about orphaned objects in the repo, then you can run |
|||
|
|
|
You already are the master. What you want is to remove the remote origin so
You can then add the current repository as the origin to the remote repository if you feel like it. NB if local is ahead of remote your solution will wipe local changes! |
|||
|
|