Ranter
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
Comments
-
taigrr8786y1. Don't *ever* reset hard, that's a bad idea. There are several better ways.
2. You really should commit more often, but I get it, habits are hard. Maybe this'll teach you :'(
3. If you don't want to learn a habit, I recommend modifying your PS1 variable to include the status of the current folders git repo. There are some really neat bash/zsh/ksh/whatever scripts for you to have some symbols at the end of your prompt. I added some a few years back, can't do without it now.
Mine uses ! For uncommitted changes, + for new files, * for unpushed refs, - for deletion, and has the branch name at the end, and I love it! -
@taigrr What would be a better method if you fucked up and dont know why or how?
Also would you mind sharing your PS1 String (or however youd call that)? -
We all learn this, then we push it deep deep down and deny deny deny.
Better git gud :/ -
taigrr8786y@gathurian sure.
So the first answer is "commit more, rebase later". That way if you screw up it's easy to fix.
Of course, that doesn't always work. If you want to just go back for a bit, look into git stash and git stash pop. They are probably pretty close to what you're already doing but are much safer.
As to my PS1, I haven't gotten around to publishing a public one yet, but here's some of the git bits in my shell: https://ipfs.io/ipfs/...
Adding shell coloring is easy, a matter of escape sequences etc. to the if/fi blocks.
To use it, stick it in your home directory, in a file called .bash_PS1 and then put "source ~/.bash_PS1" in your .bashrc
Hope that helps. -
damn, I did a reset -hard recently in a moment of shear panic and lost 3 commits, never using that again unless absolutely necessary
Related Rants
TFW when you do a git reset HEAD --hard because nothing works anymore for unknown reasons, and the moment you press Enter, you realize that you havent committed or pushed any of your work for the last three days or so...
rant
commitment issues
git
fuck me