r/code • • Jul 29 '16

Help Please Please help! Need code to announce our pregnancy to my programmer boyfriend... <3

Hi all, my boyfriend is a Senior Software Engineer... I just found out that we are expecting, and I'd love to break the news to him with a block of code! Trouble is, I don't code... Would you all help me write a small block of code to let him know he's going to be a daddy? TIA!

1.3k Upvotes

209 comments sorted by

View all comments

Show parent comment

30

u/phatskat Sep 04 '16

git reset --hard origin/master

Ok, let's try this merge again...fuck!

0

u/[deleted] Sep 04 '16

[deleted] — view deleted comment

18

u/sacesu Sep 04 '16

I have a couple aliases - "git shit" to reset back one commit, and "git fuck #" to reset back to a specific reflog reference.

It's probably not a great practice, but I'm still a noob at merges and I've used "shit" an embarrassing amount of times already.

1

u/winnen Sep 04 '16
git stash 

is your friend. It's companion is

git stash pop

First one reverts the repo to your last commit (clean commit). Also saves the changes you made.

Second one reapplies those changes to the current branch (if possible). Super handy if you need to move changes to a different branch because you forgot to checkout the right branch.

1

u/sacesu Sep 04 '16

Yeah stash is definitely a go to for those scenarios. I use "git shit" more for things like, "just tried to rebase this branch but I lost the child branches and everything is fucked."

10

u/phatskat Sep 04 '16

Love it. When I was a git noob it was more like

rm -rf .; git clone...

3

u/[deleted] Sep 06 '16

It's like you guys are describing my coding sessions...

3

u/phatskat Sep 06 '16

Yours and everyone else's.

Edit: especially mine right now - someone merged a branch carrying develop into master and I've been fighting conflicts and making guilty cherry picks for weeks.

2

u/adamonline45 Sep 04 '16

"Where'd that fix I put in yesterday go?!"

Thirty minutes later:
git checkout origin/develop

stupid copy/paste! >.>

2

u/maq0r Sep 04 '16

This command sounds like it's trying to make a new baby.