?

Log in

Tech Tip: Nullifying/Resetting/Overriding a Remote Git Repository's Branch History - Shlomif's Technical Posts Community [entries|archive|friends|userinfo]
Shlomif's Technical Posts Community

[ userinfo | livejournal userinfo ]
[ archive | journal archive ]

Links
[Links:| Shlomi Fish's Homepage Main Journal Homesite Blog Planet Linux-IL Amir Aharoni in Unicode open dot dot dot ]

Tech Tip: Nullifying/Resetting/Overriding a Remote Git Repository's Branch History [Jul. 16th, 2016|07:46 pm]
Shlomif's Technical Posts Community

shlomif_tech

[shlomif]
[Tags|, , , , , ]
[Current Location |Home]
[Current Music |Nethis - Gimin]

If you have a branch in a remote repository of the Git version control system which you need to reset/nullify/override its history, you can do it by setting up a brand new branch with the same name (say starting in an empty repository) and then pushing it from there to the remote while specifying the --force flag. Thanks to the people from #git on Freenode for enlightening me.

Licence

Copyright by Shlomi Fish, 2016.

You can reuse this entry under the Creative Commons Attribution 3.0 Unported licence, or at your option any later version of it. See the instructions on how to comply with it.

LinkReply