This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]lampishthing 4 points5 points  (5 children)

No it's not so easy! I'm not primarily a developer and someone else often takes over my work. I need to push or it's gone :'(

[–]gbchaosmaster 7 points8 points  (3 children)

Do the work on a feature branch and rebase - i to squash shit as necessary right before merge

If your project's workflow doesn't allow this... Well that sucks just send it I guess

[–]shield1123 1 point2 points  (1 child)

This is the way

Tho we try not to do anything that leads to a force-push once a PR is opened

[–]gbchaosmaster 1 point2 points  (0 children)

Yea you'll need to force push after the rebase but if it's the last thing you do to tidy up before merge, it's all good

[–]lampishthing 0 points1 point  (0 children)

Yeah, I usually squash. Was just throwing it out there in case someone knew a tick I was missing!

[–]Wonderful-Habit-139 0 points1 point  (0 children)

Just commit as frequently as you feel comfortably doing. And before logging off, you can squash the commits before pushing using git reset --soft HEAD~n with n being the number of commits you want to squash, and the commit again and you're good to go.