DarkwinDuck ( @DarkwinDuck@feddit.de ) 55•8 months agoSo you’re going to git gud?
brothershamus ( @brothershamus@kbin.social ) 21•8 months agogit out
lseif ( @lseif@sopuli.xyz ) 46•8 months agoif u ever get a tricky merge conflict, just
git push --force
. this automatically works out the right code to keep (your own) erogenouswarzone ( @erogenouswarzone@lemmy.ml ) English9•8 months agoAlso, a way to never have to work again!
katy ✨ ( @cupcakezealot@lemmy.blahaj.zone ) 25•8 months agolemme rebase the main branch onto my branch.
two minutes later
1 merge conflict of 57 [abort] [continue]
Andrew ( @Andrew15_5@mander.xyz ) 15•8 months agoLiterally.
PeWu ( @PeWu@lemmy.ml ) 2•8 months agoOh, you haven’t seen my
lack ofskill then. Andrew ( @Andrew15_5@mander.xyz ) 1•8 months agoShow me.
lily33 ( @lily33@lemm.ee ) 15•8 months agoLearning git is very easy. For example, to do it on Debain, one simply needs to run,
sudo apt install lazygit
Kata1yst ( @Kata1yst@kbin.social ) 9•8 months agoLazyGit 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?’
Bipta ( @Bipta@kbin.social ) 2•8 months agoWow this looks great. Amend an old commit dealing with a rebase? Sign me up!
jcg ( @jcg@halubilo.social ) 1•8 months agoI’d still probably prefer the usual CLI for setup, commits, pushes etc. but this looks like a godsend for any branching/rebasing operations!
lily33 ( @lily33@lemm.ee ) 1•8 months agoThe 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
. Alex ( @stsquad@lemmy.ml ) 1•8 months agoIs this what people who haven’t been introduced to #magit use?
lily33 ( @lily33@lemm.ee ) 1•8 months agoNever tried magit, but it doesn’t matter. It couldn’t possibly be good enough to be worth using an inferior editor.
stilgar [he/him] ( @stilgar@infosec.pub ) English14•8 months agoPro tip: If your code gets flogged by git, you can always get revenge with
git reflog
😉 roastpotatothief ( @roastpotatothief@lemmy.ml ) 14•8 months agoGit 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.
oce 🐆 ( @oce@jlai.lu ) 12•8 months agoIt 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.
Pxtl ( @Pxtl@lemmy.ca ) English3•8 months agoEven 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.
oce 🐆 ( @oce@jlai.lu ) 2•8 months agoSubmodule commands are such mess, which is sad because it is a great feature.
roastpotatothief ( @roastpotatothief@lemmy.ml ) 3•8 months agoYes 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.
Shhalahr ( @Shhalahr@beehaw.org ) 1•8 months agoYeah. 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.
fer0n ( @fer0n@lemm.ee ) 9•8 months agoThis has been the best git tutorial I’ve come across so far. Nicely interactive and gamified. https://learngitbranching.js.org/
noddy ( @noddy@beehaw.org ) 9•8 months agoI 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.
Shhalahr ( @Shhalahr@beehaw.org ) 3•8 months agoGo, Team Rebase!
YⓄ乙 ( @yoz@aussie.zone ) English9•8 months agoLol what’s git?
twei ( @twei@feddit.de ) 22•8 months agogit gud. HA, GOTTEM
NaoPb ( @NaoPb@eviltoast.org ) English9•8 months agoIt’s what americans from a rural area say when they want you to go away.
- shiveyarbles ( @shiveyarbles@beehaw.org ) 8•8 months ago
When we switched from svn, we had to figure out git with submodules… that was fun
Netrunner ( @Netrunner@programming.dev ) 8•8 months agoIf you can’t use git I don’t see how you’re gonna do with other things. It’s dead simple.
jack ( @jack@monero.town ) 22•8 months agoSolving merge conflicts or rebasing is not simple
oce 🐆 ( @oce@jlai.lu ) 9•8 months agoIf 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.
sajran ( @sajran@lemmy.ml ) English4•8 months agoI would actually say it’s VERY complicated but in daily work you probably need like 5 commands and those aren’t hard at all.
erogenouswarzone ( @erogenouswarzone@lemmy.ml ) English8•8 months agoGreat 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_name
to 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.
dan ( @dan@upvote.au ) 7•8 months agoHonestly, 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.
lseif ( @lseif@sopuli.xyz ) 1•8 months agolazygit 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.
Ensign Rick ( @ensignrick@startrek.website ) English3•8 months agoSo many orphaned branches… Poor things.