r/github • • Dec 11 '20

Ez

Post image
230 Upvotes

11 comments sorted by

2

u/vroad_x Dec 12 '20

You can protect important branches from repository settings to avoid accidentally deleting commits.

4

u/CaliforniaDabblin Dec 11 '20

When you amend a commit, yup

3

u/speedcuber111 Dec 12 '20

When you squash.

2

u/speedcuber111 Dec 12 '20

When you remove a sensitive file from history (oops).

2

u/speedcuber111 Dec 12 '20

When you change the author of a bunch of commits (committed from the wrong pc).

19

u/[deleted] Dec 11 '20

[removed] — view removed comment

7

u/[deleted] Dec 11 '20

I always get nervous when doing a force push. I’ll check what branch I’m on like three or four times to ensure I’m on my dev branch.

4

u/nekokattt Dec 11 '20

--force-with-lease is what you generally should use with rebasing, as it prevents you overwriting someone elses work if they happen to push between you fetching and force pushing :-)

0

u/[deleted] Dec 11 '20

[deleted]

0

u/[deleted] Dec 11 '20

[deleted]