One command to rule them all

224 points · 23 comments · view on lemmy.world

23 Comments

Ocelot@lemmies.world · 65 pts · 3y (1 reply)

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 · 17 pts · 3y

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 · 47 pts · 3y (1 reply)

mv .git .git_old7

git init

git add .

git commit -m "almost working"

minorsecond@lemm.ee · 5 pts · 3y

Lmao this is perfect

joyjoy@lemmy.world · 14 pts · 3y (8 replies)

Neither remove untracked files sadly.

sickday@kbin.social · 7 pts · 3y (6 replies)

git stash my friend

BlueBockser@programming.dev · 14 pts · 3y (5 replies)

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

HairHeel@programming.dev · 33 pts · 3y (1 reply)

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

BlueBockser@programming.dev · 1 pts · 3y

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 · 9 pts · 3y (2 replies)

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

Ocelot@lemmies.world · 7 pts · 3y (1 reply)

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

PoastRotato@lemmy.world · 8 pts · 3y

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

slampisko@czech-lemmy.eu · 1 pts · 3y

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

Sonotsugipaa@lemmy.dbzer0.com · 11 pts · 3y (2 replies)

git restore . ?
Or am I misinterpreting the problem?

static_motion@programming.dev · 16 pts · 3y (1 reply)

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 pts · 3y

Yep, I just learned of this command..

girltwink@lemmy.world · 8 pts · 3y (1 reply)

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

zexu@lemmy.world · 2 pts · 3y

😂😂😂

Synthead@lemmy.world · 5 pts · 3y

And lose my untracked changes?

https://m.youtube.com/watch?v=guv5LUT1AFw&t=7s

niyrme@lemmy.world · 2 pts · 3y

git stash

mundane@feddit.nu · 2 pts · 3y

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

vegai@suppo.fi · 1 pts · 3y
[ removed ]