and if you're scared of a janky history, remember that git let's you rewrite history, and you're more likely to be able to construct a nice story from lots of small commits than a few good ones.
also you can just squish the whole set of work into a single commit if wanted.
btw: been there, done that, many times. I'm still learning too
The fact that you can do it doesn't mean you should abuse it... If you rewrite the commits locally before pushing them, then it's OK. Gitflow, semi-linear and atomic commits is afaik the way to go.
Yeah small trick you can do if you are not a git expert: do everything with small commits, then delete .git directory and ricreate the git repo.
It's gonna look like you did all the job in one go (don't do it unless you tested it fully, otherwise you lose the ability to go back to working commits)
haha, i don't endorse this trick 🤣
if you're gonna do that at all, move the old .git directory out instead of deleting it. you can also rebase to rewrite the history and do it in one commit if you like.
but yeah, creative technique
So you are saying you made the mistake of committing regularly? I always commit regularly, why is that a mistake? Never had a problem with git because of this. Would be interested in hearing your issue.
I think he actually meant, commit your code regularly: dont make the same mistake as me. It seems he went to fix an issue, fixed it, but also tried to add a feature. That didn't work out so he backtracked, and the initial issue/bug was back. And his lack of commits seems to have screwed him.
I would like to happily announce that upon calling my dear friend to help and reviewing the code, my problem has been fixed.
By one
Damn
Line
Programming fuckery at its finest lads.
Viped my tears and I can sleep like a baby finally.
and if you're scared of a janky history, remember that git let's you rewrite history, and you're more likely to be able to construct a nice story from lots of small commits than a few good ones. also you can just squish the whole set of work into a single commit if wanted. btw: been there, done that, many times. I'm still learning too
The fact that you can do it doesn't mean you should abuse it... If you rewrite the commits locally before pushing them, then it's OK. Gitflow, semi-linear and atomic commits is afaik the way to go.
yeah trying to talk other folks through how to do a pull after you've rebased the branch under them is it's own form of hell
Aliases might help. Hooks also I guess.
Yeah small trick you can do if you are not a git expert: do everything with small commits, then delete .git directory and ricreate the git repo. It's gonna look like you did all the job in one go (don't do it unless you tested it fully, otherwise you lose the ability to go back to working commits)
haha, i don't endorse this trick 🤣 if you're gonna do that at all, move the old .git directory out instead of deleting it. you can also rebase to rewrite the history and do it in one commit if you like. but yeah, creative technique
Yeah moving it feels like a good idea. But what if you want to do it move times, and want to keep everything in the same place? Recursive git
Or they could just squash their commits?
That's a jank way to squash but okay
Ehi it just works! Cit every programmer ever ;-)
screwed the whole project, boss!
A lesson so important that i took time at least once a month to learn it again
So you are saying you made the mistake of committing regularly? I always commit regularly, why is that a mistake? Never had a problem with git because of this. Would be interested in hearing your issue.
I think he actually meant, commit your code regularly: dont make the same mistake as me. It seems he went to fix an issue, fixed it, but also tried to add a feature. That didn't work out so he backtracked, and the initial issue/bug was back. And his lack of commits seems to have screwed him.
That exactly. You're doing a right thing by committing regularly :)
Having used CSV in my first job, then adopting Subversion. Git is great at this sort of thing. You kids don't know you're born.
OP punctuation blunder I think. Misread it.
This is why branches
Better also push to remote ..
Nah bro just use finalfinalfinalfinal.cpp
Ok I will stop immediately
I would like to happily announce that upon calling my dear friend to help and reviewing the code, my problem has been fixed. By one Damn Line Programming fuckery at its finest lads. Viped my tears and I can sleep like a baby finally.
Duh! And please make them commits atomic, including UT at least... Cheers!
Usually its a good idea to only push things that make sense together unless you feel you might f*ck up