Re: Some updates to refspec documentation
- From
- Anders Melchiorsen <mail@cup.kalibalik.dk>
- Date
- Oct 29, 2008, 20:41 UTC
- Message-ID
- <878ws7b0d2.fsf@cup.kalibalik.dk>
- In-Reply-To
- <1225311945-17100-1-git-send-email-mail@cup.kalibalik.dk>
During my struggle, I also found a git push usability problem. The refspec ":dst" will delete the remote branch without warning.
While this is indeed documented, you cannot blame somebody for thinking that a left out <src> will default to HEAD, as it does for so many other commands.
In a CVS-like setup, with everybody pushing to master, this could cause havoc.
As the "git push <repository> :<dst>" operation is destructive, I think it should be protected by the -f option.
For the record, I did realize this before trying to push ":master" :-).
Anders.