Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Search - "git reflog"
-
!rant.
Here's some useful git tricks. Use with care and remember to be careful to only rewrite history when noones looking.
- git rebase: powerful history rewriting. Combine commits, delete commits, reorder commits, etc.
- git reflog: unfuck yourself. Move back to where you were even if where you were was destroyed by rebasing or deleting. Git never deletes commits that you've seen within at least the last 50 HEAD changes, and not at all until a GC happens, so you can save yourself quite often.
- git cherry-pick: steal a commit into another branch. Useful for pulling things out of larger changesets.
- git worktree: checkout a different branch into a different folder using the same git repository.
- git fetch: get latest commits and origin HEADs without impacting local braches.
- git push --force-with-lease: force push without overwriting other's changes5 -
Okay, Google. I can see why you want me to check those boxes with cars. And I'm also fine with you telling me to do it on a different picture if the first one didnt had any, just to check. But WHAT I AM FUCKING NOT OKAY WITH, IS ME SOLVING CAPTCHAS FOR 10 FUCKING MINUTES REPETEDLY SAYING PLEASE TRY AGAIN AND THEN TELLING ME THAT I AM NOT EVEN ABLE TO TRY AGAIN BECAUSE OF AN DETECTED ATTEMPT OF BOTTING? WHO ARE YOU? AN AI QUESTONING MY HUMAN IDENTITY? JUST BECAUSE IM USING LINUX YOU DECIDE TO GIVE ME ANOTHER NOTHERFUCKING BATCH OF STREET SIGNS? YOU CAN STICK THOSE STREET SIGNS UP YOUR ASS! FUCK OFF!
tl;dr: i got banned from solving recaptchas the second time this week. lets hope its just *another* timeout.8 -
he: checkout my crazy FUD hack (a token stealer which turned out to be far more malicious than i anticipated)
me: executes it (yes in a VM)
windows defender: lemme delet this
he: ooh i forgot the word stub in there. microsoft detects that lemme fix that sends new file
me: here we go aga..
ms defender: nononono virus 117% delet this
he: i forgot it still!!
later i deactivated ms defender and analysed the traffic of the vm. in addition to stealing my fake tokens he also tried to read my Firefox/chrome history, IP.
when i asked him (2 days later) what this was all about in his "educational only" "token stealer" he threatened to
a) publish my IP
b) publish my browser history and with that my real name and address
b.0) when i asked him for proof he said he knows that my real name is "Roman Gräf" and i live in Frankfurt. (btw i do live in Frankfurt and that is in the profile of the discord server where he found me and i have the same username on discord as i have here)
c) to kill my machine and all my projects
got bored, blocked him, shut VM down. -
git reflog, git reflog...git FUCKING reflog!!!! Ah fuck this, I'm taking the kids out. 3hrs later.... Oh shit, i was in the wrong directory. A good fresh air clears the mind.2
-
> be me
> work on a nice project with friends: A, B and C
> joined in a bit later, but before any real progress was made + we scrap the existing code, because it was Python2 or something
> decide on a framework
> A wants to create one himself, instead of using an existing one
> we fight for a little, but let A do his thing
> 2 months later
> been waiting the whole time
> +1000 lines on github, but still not finished
> "Wouldn't it be better if we would use the normal framework?"
> "No, mine is hand-crafted for that task"
> "But it is full of bugs"
> "If you find one major bug, we'll ditch my framework"
> finds major bug
> "That's fixed, just give me a min-"
> finds another bug
> "Thats just because you don't know how to use the framework"
- Documentation inside ONE gigantic README
- Library is missing the core features we needed/those which are implemented don't work
- Both B and C were on my side from the beginning (in that we should use "Already Existing Fully Documented Popular And tested Framework Which Does Everything We Need")
> "But i dont understand this framework so explain it to me"
> send him a few code examples + a tutorial??? (dont remember if i actually sent im the tutorial before i left)
> "explain it to me, i can't understand it"
> I CANT UNDERSTAND YOUR FUCKING FRAMEWORK DUMBASS
> ragequitted the server+project
To this day i still don't know, which framework they are using..
Also that Python 2 code in the beginning was because A didnt know the difference and copied (yes by hand) the code from atom to github without testing anything.4 -
My father is a programmer by himself so he is cool with it. My mother on the other hand is totally against "any form of technology newer than the telephone." (her words)2
-
Thank you, GIT. Thank you. Your reflog saved work of months after someone deleted the wrong branch.1
-
Today in PE i sprained my finger and now my coding/typing speed is slow af. It took <s>my ages</s> 5 minutes to write this rant.3
-
Who else finds it very satisfying to tap an notif and see all other notifs turn gray the last second you see them because they all belong to the same rant?3
-
a) when i wanted to write a twitter client for the console
b) when i automated my job that i had at a school event
just the ability to do such stuff is very exciting to me. -
I've got a confession to make. I.. I just love hand-obfuscating JS-Code. Not because, i would prefer working with obfuscated code.. I just find it extremely satisfying watching the code shrink and being the only one being able to understand it..
It's out. I feel better now.4 -
Go home windows your drunk. Yes i want to but i have to use you
Translation:
Microsoft Windows
This application doesn't react. The program could possibly react i
again if you wait.
Do you want to kill this procrss?7 -
CAN NODEJS KINDLY GO FUCK ITSELF?
well maybe not node itself, but those node js so-called "professional node developers"
WHO THE FUCK thought it was a good idea to pass about EVERY SINGLE ARGUMENT as a global variable so absolutely no code insights are available, eslint with THEIR eslintrc shows ABOUT ONE MILLION DIFFERENT LINTER WARNING and on top they commited the node_modules folder
-_-
I'm out.4 -
I just searched like half an hour for a book.. Then I started tabbing to Google but it wasn't working.. I was a bit shocked when I noticed this was real live.2
-
Just had some problems with a cronjob I've been playing around which kept my pc running for like 10 mins after i used `shutdown -H`.. My mother asked me why i wa so mad at my pc
Me: A cronjob is stopping ubuntu from shutting down.
She: What's ubuntu?
Me: the os I've told you about the whole last weekend
She : what's OS?
I and my father literally explained her Ubuntu and Linux basics for at least 2 hours after she asked why my pc is looking "so purple" (i was using the console).
btw got the bug fixed :) -
> be me
> create a greentext userscript
> actually-that-is-it-all.lnk
Here's a github link, in case anyone is interested: https://github.com/romangraef/...2 -
Am I the only one who pronounces git reflog as re-flog rather than ref-log? As in being whipped again6
-
0. working PCs
0.0 technically they are working, but they are too slow to even open up eclipse
0.1 maybe this gets better at university
1 coding on paper
2 not using google + usbs + network drives for code sharing
3 if it might be applicable PLEASE ENABLE THE FUCKING CMD! OR LET ME USE ARCH ON MY STICK! C'MON2 -
Me: Ok I've updated the docs, I'll open a PR with the changes
Maintainer: Looks great! Can you remove the changes to the package-lock.json? (I assume it got updated when you ran npm install to start the webserver)
Me: Ok sure, I'll update it soon
And this is where the troubles begin. The file was commited 2 commits ago, so I have to roll back to then. However, the remote repository has been updated since then, so I git fetch to keep up to date.
This makes the rollback a hell of a lot harder, so I run git log to see the history. I try a reset, but I went back to the wrong commit, and now a shit ton of files are out of sync.
I frantically google 'reset a git reset', and come across the reflog command. Running that fucks things up even worse, and now so much shit is out of sync that even git seems confused.
I try to fix the mess I've created, and so I git pull from my forked repo to get myself back to where I was. Git starts screaming at me about out of sync files, so I try to find a way to overwrite local changes from the origin.
And by this point, the only way to describe what the local repo looks like is a dumpster fire clusterfuck that was involved in a train wreck
I resolved the mess by just deleting the local copy and git cloning again from my fork.
I gotta learn how to use Git better5 -
I'm so bad about keeping track of my time, that I just use `git reflog --date=iso` to figure out when I was working and not working 😂
-
I found a bug in the web app. (Yes, i will go to https://github.com/devRant/devRant/...). If you don't have an avatar you get the avatar url https://avatars.devrant.com/undefin... in the notifs (which doesnt exist)3
-
My whole class. They aren't that good with computers and they ask obvious questions but they get better every day and we really grew together in the past year.2
-
So, I was doing some basic engineering project at uni with a teammate but we didn't realize that we were working in a detacted head state in git (due to poor set up of the working environment on his part).
After a 3,5 hours of work, we need to push to the repo and we get an error.
I take control to try to understand what was going on, and in doing so, I (mistakenly?) check out to another branch.
Git garbage collector kicks in and we can't checkout to the previous branch anymore (where all the work was made).
My friend panics and calls the professor, who explains to us how we lost everything and there is "a 100% no hope of recovering our work".
Felt like poop. But wasn't satisfied. I had read somewhere that you don't lose stuff so easily on git. Went home.
After five minutes I was able to recover everything through git reflog feature.
Moral #1: professors should know about the existence of reflog
Moral #2: please use git plug-in in your bash /zsh. Please.1 -
Soo I got my first email from a recruiter.. Subject: "Your Github profile " + accountname (of an account that i renamed 5 months ago which now gives a 404 btw). I'm 15 and my github profile doesnt have the "avaible for hive" Option checked. why exactly do you want to hire me again?2
-
My It teacher told me to fix their *SmallBasic* chat-client which they use for our class. And it is holidays!!
-
Git - Because it has saved my ass more often than I would like to admit and thanks to reflog almost any fuck up is salvageable.
I also like it because it makes a handy multi-game mod manager on a pinch.