How can I choose to overwrite remote repository with local commits?

You can remove the branch and recreate it, let’s say the branch that you want to overwrite is dev:

Remove the branch in your remote host(github)

git push origin :dev  

Then just push your dev again:

git push origin dev

I use Github for hosting, not familiar with unfuddle, but I think it’ll works for the unfuddle, too. 🙂


Just as @melee mentioned, you can also use

git push origin dev -f

(not sure whether the -f is valid, but --force is OK)

git push origin dev --force

to force overwrite the branch. I remember I did it before. Thanks @melee. 🙂

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)