So you’re going to git gud?
git out
deleted by creator
if u ever get a tricky merge conflict, just
git push --force. this automatically works out the right code to keep (your own)Also, a way to never have to work again!
lemme rebase the main branch onto my branch.
two minutes later
1 merge conflict of 57 [abort] [continue]

Literally.
Oh, you haven’t seen my
lack ofskill then.Show me.
Learning git is very easy. For example, to do it on Debain, one simply needs to run,
sudo apt install lazygitLazyGit may actually be black magic from Satan to tempt programmers into sin. And to that I say: ‘where is a goat I can sacrifice to my dark lord?’
Wow this looks great. Amend an old commit dealing with a rebase? Sign me up!
I’d still probably prefer the usual CLI for setup, commits, pushes etc. but this looks like a godsend for any branching/rebasing operations!
The ease with which I can only commit separate hunks with lazygit has ensured I use it for commits, too. And once I’ve opened it to do the commit, I may as well also press
P.Is this what people who haven’t been introduced to #magit use?
Never tried magit, but it doesn’t matter. It couldn’t possibly be good enough to be worth using an inferior editor.
Pro tip: If your code gets flogged by git, you can always get revenge with
git reflog😉Git is a great invention but it has a few design flaws. There are too many ways to confuse it or break it, using commands that look correct, or just forgetting something. I ended up writing simple wrapper script codebase to fix it. Since then no problems.
It was conceived for experts so the new user experience is shit and the UI is not intuitive. But it has become such a widespread standard that it is very hard to completely overhaul the UI.
Yes you couldn’t change something so widely used. Look what happened with python 3.
Fortunately there’s already a tradition among Git users of building a UI on top of the git UI. My project is just a slightly better version of those. It lays a simple sensible interface on top of the chaotic Git interface.
Even for experts the user experience is shit. Too much has to be done manually when the default should be automatic, like fetching before pull, recursing when working with repos that use submodules, allowing mismatched casing on case insensitive filesystems, etc.
Submodule commands are such mess, which is sad because it is a great feature.
Yeah. It’s got no abstraction between the UI and the implementation. You just want to manage code versions, but to use Git, you need to learn how to manage history graphs.
Lol what’s git?
git gud. HA, GOTTEM
It’s what americans from a rural area say when they want you to go away.
deleted by creator
This has been the best git tutorial I’ve come across so far. Nicely interactive and gamified. https://learngitbranching.js.org/
I prefer rebasing on destination branch before merging. When merging you get all the conflicts at the same time. When rebasing you can address conflicts from one commit at a time. Untangling multiple small knots is easier than one huge spaghetti. Also commit history will be much cleaner.
Go, Team Rebase!
Great meme, and I’m sure op knows this, but for anyone else who is curious…
007 in theory means:
- 00: you have already committed your code to your local code base
- 7: When you try to merge your code with everyone else’s there are 7 files that others have worked on since you last refreshed your local code base.
To resolve this, you need to go file by file and compare your changes with the changes on the remote code. You need to keep the changes others have made and incorporate your own.
You can use
git diff file_nameto see the differences.If you have made small changes, it’s easier to pull and force an overwrite of your local code and make changes again.
However multiple people working on the same files is usually a sign of organizational issues with management. Ie, typically you don’t want multiple people working on the same files at the same time, to avoid stuff like this.
If you’re not sure, ask someone that knows what they’re doing before you follow any advice on Lemmy.
Removed by mod
If I get a big conflict and I know my change is trivial, I feel perfectly okay doing git fetch git reset --hard whatever and then reapplying my simple change as a new commit. Sort of a bootleg rebate.
I hear what you’re saying.
First, I hard disagree with you. Overwriting my local version of code is a parachute - not an ideal landing, but better than merging by hand.
Also, my comment was not an attempt to teach everything about git, just to explain what is happening in simple terms, since git requires a lot of experience to understand what those messages mean.
If you can’t use git I don’t see how you’re gonna do with other things. It’s dead simple.
Solving merge conflicts or rebasing is not simple
If it was dead simple you wouldn’t need to learn 10 new concepts and google commands regularly even after using it for a couple of years. You probably forgot how you struggled at first. I have taught it multiple times and I see how beginners struggle.
deleted by creator
I would actually say it’s VERY complicated but in daily work you probably need like 5 commands and those aren’t hard at all.
When we switched from svn, we had to figure out git with submodules… that was fun
Honestly, just use a GUI. Graphical user interfaces were designed for a reason. I usually use SourceTree or the Git functionality built in to Visual Studio or VS Code.
It’s good to know how things work under-the-hood (e.g understand Git’s object model, some basic commands, etc) but don’t feel like you need to use the command-line for everything.
lazygit or tig are terminal interfaces for git. very nice, best of both worlds imo. every action shows the git command ran at the bottom, and its a lot easier to see at a glance the status, diff, log, etc.
So many orphaned branches… Poor things.
















