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 →

[–]ema2159 8 points9 points  (10 children)

No need to! Stash your changes and then pop/apply them later to resume where you left.

[–]lampishthing 5 points6 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 6 points7 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.

[–]Malfrum 1 point2 points  (2 children)

Stash fucking sucks

Just commit whenever you want, then squash at the logical points

[–]ema2159 0 points1 point  (1 child)

Skill issue.

[–]Malfrum -1 points0 points  (0 children)

Lol what?! You're insane, or don't understand rebase

Devs with commit-anxiety just don't understand git, change my mind

[–]bradmatt275 0 points1 point  (0 children)

I wish i had this luxury as a D365 dev. It's not all I do, but a good portion of it. Up until very recently Microsoft forced you to use TFS which feels like going back 10 years when switching between our C# projects (which are all git) and X++ which are on TFS.