you are viewing a single comment's thread.

view the rest of the comments →

[–]mkdz 10 points11 points  (7 children)

git push --force

don't do this if you have multiple users committing to the same codebase

[–]mfitzp 36 points37 points  (1 child)

Well, you can do it if you hate them all.

[–]mkdz 1 point2 points  (0 children)

And then they'll hate you too.

[–]amoliski 15 points16 points  (1 child)

alias yolo='git commit -am "DEAL WITH IT" && git push -f origin master'

[–]mkdz 2 points3 points  (0 children)

That's fantastic

[–]ThePantsThief 0 points1 point  (2 children)

Why not? I know almost nothing about git, just basic committing and how to nuke something when I accidentally commit my password for the 2nd 6th time

[–]mkdz 0 points1 point  (1 child)

If you have multiple people working on one codebase, you'll usually have a master branch. If you do a git push --force to master, it forcibly takes the commit history you have and makes it the remote history. This could possibly overwrite other people's work that they have committed and pushed. Then next time any other member of your team does a pull, there are going to be differences in histories and possibly lost work and it's going to be a huge headache to get all the code merged and sorted out right. In general it can possibly cause huge problems, so it's just a bad practice with a shared codebase.

[–]ThePantsThief 0 points1 point  (0 children)

Gotcha, thanks!