Pprogrammer_humor·Programmer HumorbyPhoenix3875 One command to rule them allView original on lemmy.world224Comments23
OOcelot lemmies.world1Hide 1 replyfuck 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.65
mmarcos replylemmy.worldRename 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.17
mmvirts lemmy.world1Hide 1 replymv .git .git_old7 git init git add . git commit -m "almost working"47
BBlueBockser replyprogramming.dev5Hide 5 repliesI think git clean is more appropriate. With git stash you create a stash which you then have to drop.14
HairHeel replyprogramming.dev1Hide 1 replyWho says you have to drop it? I've got stuff from 2007 in there somewhere.33
BBlueBockser replyprogramming.devOf 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.1
sickday replykbin.social2Hide 2 repliesYea but you can always git pop if you need any of your stashed changes9
OOcelot replylemmies.world1Hide 1 replyi chuckled at the thought of 'git poop' being a command. I'm going to alias that to something.7
sstatic_motion replyprogramming.dev1Hide 1 replygit 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.16
ggirltwink lemmy.world1Hide 1 replyalias mybad='git add -u && git commit --amend --no-edit && git push --force-with-lease'8
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.
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.
mv .git .git_old7
git init
git add .
git commit -m "almost working"
Lmao this is perfect
Neither remove untracked files sadly.
git stash my friend
I think
git cleanis more appropriate. Withgit stashyou create a stash which you then have to drop.Who says you have to drop it? I've got stuff from 2007 in there somewhere.
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.
Yea but you can always
git popif you need any of your stashed changesi chuckled at the thought of 'git poop' being a command. I'm going to alias that to something.
You could make it run
git popuntil it clears the whole stashThat's why I follow it with
git clean -fdgit restore .?Or am I misinterpreting the problem?
git restoreis a pretty new command AFAIK. Those of us who learned git before its existence have probably stuck to the old ways ofgit reset --hard.Yep, I just learned of this command..
alias mybad='git add -u && git commit --amend --no-edit && git push --force-with-lease'
😂😂😂
And lose my untracked changes?
https://m.youtube.com/watch?v=guv5LUT1AFw&t=7s
git stashThat is stupid. Those commands are for different use cases.