Git for Idiots (Broken down to Four Commands)
Posted by Consistent-Disk-7282@reddit | LocalLLaMA | View on Reddit | 18 comments
Before AI will take over, people will still have to deal with git.
Since i noticed that a lot of my collegues want to work with AI but have no idea of how Git works i have implemented a basic Git for Idiots which breaks down Git to a basic version control and online backup functionality for solo projects with four commands.
It really makes stuff incredibly simple for Vibe Coding. Give it a try, if you want:
Evening_Ad6637@reddit
After years I am still confused and don’t know when I have to rebase and when to merge… –.–
vibjelo@reddit
Depends on what you want to do. You want the two branches to be visibly merged in the history? Then use merge
You want one clean branch that looks like everything was made in a linear fashion? Or you want to make two commits into one? Use rebase.
Basically, depending on how you want the history to look like afterwards, you use one vs the other.
opi098514@reddit
Does it work? Merge. Everything else rebase or branch.
TopImaginary5996@reddit
The common argument is linear and cleaner commit history. In practice, I find that to be a pretty weak argument _for_ rebasing. I have worked in teams where hundreds of PRs merge a week and merge conflict isn't a rare occurrence. My personal take is: use whatever your team/organization mandates, if they don't, use whatever you are most comfortable with for your workflow.
I personally find the argument that merge commits introduce cognitive load for reviewing or cherry-picking and reviewing are, again, pretty weak. Unless somehow `main`/`master` is changing so frequently (it can) and the person working on their own branch is obsessively updating their branch against `main`/`master` with merge commits, it's never an actual problem. I suspect people who legitimately find merge commits a problem for cherry-picking and reviewing actually have other problems to deal with, such as their workflow.
Merge commits _could_ complicate the use of bisect. However, that's only really a problem if you're not testing regularly, and/or your organisation doesn't have a proper CI pipeline set up. If you have good observability tooling, good CI/CD pipeline, and disciplined development workflows, it's not often you need to use bisect — and by the time you need it, you are probably dealing with a regression that wasn't easily caught by the guardrails you have (which is possible because there are always tradeoffs you have to make for every part of the system). I love bisect, but I also don't think it's a good reason for preferring rebase over merge.
My last point is that software development is a very social activity, and you will see merge commits in most code bases that doesn't explicitly prevent the use of merge commits: simply because of personal preferences. So arguing about which one is better is mostly pointless.
I used to exclusively use rebase exactly because I like cleaner commit history. I now prefer merge especially when an update against `main`/`master` will create a conflict because everything is contained within the merge commit; not that you can't revert a rebase with reflog + reset, but if you are working with people reverting a merge commit is much easier (reflogs are local). I also don't obsess over "clean" commit history anymore — if not having a "clean" commit history bothers you, how people write their commit messages and descriptions (or not) probably bother them too, which is an entirely different problem.
Like everything else, there are probably edge cases that I haven't had the privilege to be exposed to, so take this with a grain of salt! :)
opi098514@reddit
Honestly this feels like a great way to vibe code yourself into a broken code with no back up.
Consistent-Disk-7282@reddit (OP)
Well at least there is any backup.
AcrobaticFlatworm727@reddit
Check this out if you actually need help with git, I found it way more useful. https://agripongit.vincenttunru.com/
abhuva79@reddit
No branching? So you simplified it to basically a nicer auto-backup =)
But honestly - people should just educate themselves 30 mins. With things like Github Desktop, Git inbuild into all sorts of IDE´s - there really is no reason to not learn to use it properly (and this doesnt mean starting with the terminal).
As longs as it helps people starting to use it... guess thats a win. But overall i always have to shake my head in disbelieve that people start doing any kind of text work (be it code or whatever) without a version-control...
AcrobaticFlatworm727@reddit
but honestly - don't use open ai's garbage to write your comments.
Robonglious@reddit
Isn't the Git VSCode automatic? I don't remember setting it up but, there it is.
AnduriII@reddit
Any good git Tutorial?
abhuva79@reddit
Not really, i mean i guess there are tons out there. But i initially just started using Github Desktop and once in a while read something when i didnt understood it enough. Over the years i got more comfortable, using other IDE´s and to some point even the terminal...
At the start using Github Desktop is more than enough. Beside this, i think i seen some good ones on youtube recently like this one here: https://youtu.be/S7XpTAnSDL4?si=I1FdOtEcQnDZ3VX8
AnduriII@reddit
Thanks. I am using vscode but still figure out how this works. This week i made my first fork and merge 🤗
Consistent-Disk-7282@reddit (OP)
Yes, basically Auto-Backup with version control. During vibe-coding it just reduces the effort for version control down to just writing "push" inside the directory.
I think you underestimate the masses...
sebastianmicu24@reddit
I prefer "hey chat GPT, save the progress to the cloud"
/s
Consistent-Disk-7282@reddit (OP)
Has that ever worked?
Consistent-Disk-7282@reddit (OP)
2 Minute Install & Demo: https://youtu.be/Elf3-Zhw_c0
RedditDiedLongAgo@reddit
Not local, not llama