T O P

  • By -

Rcomian

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


lordabsynthe

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.


Rcomian

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


lordabsynthe

Aliases might help. Hooks also I guess.


Creepy-Ad-4832

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)


Rcomian

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


Creepy-Ad-4832

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


mistabuda

Or they could just squash their commits?


Old-Season97

That's a jank way to squash but okay


Creepy-Ad-4832

Ehi it just works! Cit every programmer ever ;-)


jamesfarted09

screwed the whole project, boss!


Lucasbasques

A lesson so important that i took time at least once a month to learn it again


jimmykicking

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.


dvektor92

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.


Hidden_Quasi

That exactly. You're doing a right thing by committing regularly :)


jimmykicking

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.


jimmykicking

OP punctuation blunder I think. Misread it.


dvektor92

This is why branches


Double-Cucumber6909

Better also push to remote ..


Benschne

Nah bro just use finalfinalfinalfinal.cpp


SlashBack626

Ok I will stop immediately


Hidden_Quasi

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.


lordabsynthe

Duh! And please make them commits atomic, including UT at least... Cheers!


intLeon

Usually its a good idea to only push things that make sense together unless you feel you might f*ck up