231
submitted 11 months ago by [email protected] to c/[email protected]
top 22 comments
sorted by: hot top controversial new old
[-] [email protected] 73 points 11 months ago* (last edited 11 months ago)

fuck it. rm -rf repository; git clone repository

Been using git since almost as long as its been around, still can't be bothered to learn to how to fix conflicts.

[-] [email protected] 18 points 11 months ago

Rename it, so you can run diff on those surprising things that in no way could have changed, but are not equal to the repository. And then delete.

Or keep the X-old; X-backup; X-bkp; X-old-old; X-old3 dirs.

[-] [email protected] 51 points 11 months ago* (last edited 11 months ago)

mv .git .git_old7

git init

git add .

git commit -m "almost working"

[-] [email protected] 5 points 11 months ago

Lmao this is perfect

[-] [email protected] 14 points 11 months ago

Neither remove untracked files sadly.

[-] [email protected] 9 points 11 months ago
[-] [email protected] 15 points 11 months ago

I think git clean is more appropriate. With git stash you create a stash which you then have to drop.

[-] [email protected] 35 points 11 months ago

Who says you have to drop it? I've got stuff from 2007 in there somewhere.

[-] [email protected] 1 points 11 months ago

Of course you don't have to, but if you don't plan on ever using it then it's just trash living in your git folder. If you do plan on using it again in the future, then it's usually better to make it a branch so you can push it to a remote.

[-] [email protected] 8 points 11 months ago

Yea but you can always git pop if you need any of your stashed changes

[-] [email protected] 8 points 11 months ago

i chuckled at the thought of 'git poop' being a command. I'm going to alias that to something.

[-] [email protected] 9 points 11 months ago* (last edited 11 months ago)

You could make it run git pop until it clears the whole stash

[-] [email protected] 1 points 11 months ago

That's why I follow it with git clean -fd

[-] [email protected] 11 points 11 months ago

git restore . ?
Or am I misinterpreting the problem?

[-] [email protected] 18 points 11 months ago

git restore is a pretty new command AFAIK. Those of us who learned git before its existence have probably stuck to the old ways of git reset --hard.

[-] [email protected] 3 points 11 months ago

Yep, I just learned of this command..

[-] [email protected] 8 points 11 months ago

alias mybad='git add -u && git commit --amend --no-edit && git push --force-with-lease'

[-] [email protected] 2 points 11 months ago

๐Ÿ˜‚๐Ÿ˜‚๐Ÿ˜‚

[-] [email protected] 5 points 11 months ago
[-] [email protected] 3 points 11 months ago

That is stupid. Those commands are for different use cases.

[-] [email protected] 2 points 11 months ago
load more comments
view more: next โ€บ
this post was submitted on 28 Jul 2023
231 points (95.3% liked)

Programmer Humor

18240 readers
10 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 1 year ago
MODERATORS