this post was submitted on 28 Jul 2023
197 points (96.2% liked)

Programmer Humor

19821 readers
866 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 2 years ago
MODERATORS
 
top 22 comments
sorted by: hot top controversial new old
[–] Ocelot@lemmies.world 58 points 1 year ago* (last edited 1 year ago) (1 children)

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.

[–] marcos@lemmy.world 14 points 1 year 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.

[–] mvirts@lemmy.world 39 points 1 year ago* (last edited 1 year ago) (1 children)

mv .git .git_old7

git init

git add .

git commit -m "almost working"

[–] minorsecond@lemm.ee 4 points 1 year ago

Lmao this is perfect

[–] joyjoy@lemmy.world 13 points 1 year ago (2 children)

Neither remove untracked files sadly.

[–] sickday@kbin.social 7 points 1 year ago (1 children)
[–] BlueBockser@programming.dev 13 points 1 year ago (2 children)

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

[–] HairHeel@programming.dev 31 points 1 year ago (1 children)

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

[–] BlueBockser@programming.dev 1 points 1 year 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.

[–] sickday@kbin.social 8 points 1 year ago (1 children)

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

[–] Ocelot@lemmies.world 5 points 1 year ago (1 children)

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

[–] PoastRotato@lemmy.world 5 points 1 year ago* (last edited 1 year ago)

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

[–] slampisko@czech-lemmy.eu 1 points 1 year ago

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

[–] Sonotsugipaa@lemmy.dbzer0.com 9 points 1 year ago (1 children)

git restore . ?
Or am I misinterpreting the problem?

[–] static_motion@programming.dev 14 points 1 year ago (1 children)

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.

[–] TheSealStartedIt@feddit.de 3 points 1 year ago

Yep, I just learned of this command..

[–] girltwink@lemmy.world 5 points 1 year ago (1 children)

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

[–] zexu@lemmy.world 2 points 1 year ago

😂😂😂

[–] mundane@feddit.nu 2 points 1 year ago

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

[–] Synthead@lemmy.world 2 points 1 year ago
[–] niyrme@lemmy.world 2 points 1 year ago
load more comments
view more: next ›