midwest.social

Netrunner, to programmerhumor in I'm going to sit down and actually learn git this week
@Netrunner@programming.dev avatar

If you can’t use git I don’t see how you’re gonna do with other things. It’s dead simple.

jack,

Solving merge conflicts or rebasing is not simple

lightnegative,

Do it enough times and it stops being scary.

Using a tool like VSCode to perform the actual merges on individual files also helps because it shows what “yours” and “theirs” changes are from a user perspective, not a git perspective

boomzilla,

The 3-way merge editor in VSCode is a fantastic tool. Really helps in visualizing what comes from where and preventing merge accidents.

buzziebee,

It’s doable once you know what you’re doing. I can do it all via the cli, but I personally use gitkraken most of the time and it’s just so much easier and more ergonomic.

I also see a lot of the Devs who insist they know what they’re doing create horrible messes of their branches super easily via the commit tree. People should just use whatever works best for them to get the job done.

space_comrade,

It’s not THAT complicated but I wouldn’t call it dead simple. When you understand how git works internally yeah it’s pretty simple but people usually start with the idea that it’s a tool to put your code on a server to synchronize with other people and only later learn that you have both a local and a remote (or multiple remote) tree and how the tree really works.

I think the problem is most git 101 tutorials teach it wrong, IMO the best git tutorial is this: wildlyinaccurate.com/a-hackers-guide-to-git/

Unfortunately it’s pretty dense so it’s gonna scare off a lot of newbies.

oce, (edited )
@oce@jlai.lu avatar

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.

sajran,

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.

Shinji_Ikari,
@Shinji_Ikari@hexbear.net avatar

Its not dead simple but its also not extremely complex.

I’m currently working with some interns and there’s just concepts they were never exposed to. Without decent mentoring, git can be difficult because a lot of the workflow does come with experience.

That being said everyone needs to stop acting like its an impossible task to properly do source control. There is some truth that if you don’t care enough to do your source control, you don’t care enough to write decent code. Its not a moral failing, just take some pride in your craft.

Show the newbies how to care and they’ll care enough to want to do it right. Measure twice, cut once and all that.

fox,

It’s definitely not simple to use but I agree that the conceptual model it represents is straightforward. I think a lot of the problems people have with git come from not understanding the underlying data structure before learning how to manipulate it.

miss_brainfart, to 196 in Apiorule
@miss_brainfart@lemmy.ml avatar

Candyman, Candyman, Candyman, Candyman, Candyman

kaffiene, to programmerhumor in I'm going to sit down and actually learn git this week

This week? I’ve been using it for years and I’m still learning it

m3t00, to programmerhumor in I'm going to sit down and actually learn git this week
@m3t00@lemmy.world avatar

coffee

Imbrex, to programmerhumor in I'm going to sit down and actually learn git this week

so do ya’ll like git or git in a hub?

Andrew15_5, to programmerhumor in I'm going to sit down and actually learn git this week
PeWu,

Oh, you haven’t seen my lack of skill then.

Andrew15_5,

Show me.

ohlaph, to programmerhumor in I'm going to sit down and actually learn git this week

It do be like that sometimes.

noddy, to programmerhumor in I'm going to sit down and actually learn git this week

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.

Shhalahr,

Go, Team Rebase!

ensignrick, to programmerhumor in I'm going to sit down and actually learn git this week
@ensignrick@startrek.website avatar

So many orphaned branches… Poor things.

lseif, to programmerhumor in I'm going to sit down and actually learn git this week

if 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 avatar

Also, a way to never have to work again!

Nahdahar,

Except if you’re an employer in a very small company.

Source: my boss did this at the first company I worked at.

Haus, to programmerhumor in I'm going to sit down and actually learn git this week
@Haus@kbin.social avatar

sccs, rcs, cvs... after that it's a blur of new systems every year or two

kautau,

sccs

1973

rcs

1982

git

2005

How long are your years?

flambonkscious,

Maybe they’re born on a leap year…

And a dog?

pelya,

Subversion is as good as it can get with centralized version control system.

CVS is only one step up above FTP file server for all your code.

wewbull,

I’d agree if anyone actually used the distributed nature of DVCS

AMillionNames, to programmerhumor in I'm going to sit down and actually learn git this week
dan, to programmerhumor in I'm going to sit down and actually learn git this week
@dan@upvote.au avatar

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.

zalgotext,

In my experience, using GUIs is how people fuck themselves, and then I have to unfuck them via the command line.

Git’s interface is bad, yes. It has a step learning curve, yes. But I truly think the only real way to overcome those obstacles is to learn how git works, learn all the nitty gritty details, not hide from them.

CapeWearingAeroplane,

I use a GUI (GitKraken) to easily visualise the different branches I’m working on, the state of my local vs. the remote etc. I sometimes use the gui to resolve merge conflicts. 99 % of my gut usage is command line based.

GUI’s definitely have a space, but that space is specifically doing the thing the command line is bad at: Visualising stuff.

lseif,

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.

kamen,

My take is use a GUI for anything read-only/nondestructive (i.e. anything that won’t modify your local or remote state). It’s nice for example to compare the state of two branches.

For anything that does changes make sure you know what’s happening under the hood, otherwise you might shoot yourself in the foot. It’s convenient for example to do a commit and push in one go, but then you lose the ability to edit any changes (you’re forced to either do another commit, or change your local commit and force push).

In VSCode you can go to the Output pane and switch to Git - there you’ll see everything that gets done through Git’s CLI for whatever you do through the GUI (although it can be a bit noisy); same goes other GUI utils.

cupcakezealot, to programmerhumor in I'm going to sit down and actually learn git this week
@cupcakezealot@lemmy.blahaj.zone avatar

lemme rebase the main branch onto my branch.

two minutes later

1 merge conflict of 57 [abort] [continue]

affiliate,

this is easily fixed by copy pasting the files into a new directory and never opening git again out of fear

caseyweederman,

Project managers hate this one weird trick!

kamen,

One key thing that can help you wrap your head around rebasing is that branches get switched while you’re doing it; so, say you’re on branch feature and do git rebase master, for any merge conflict, whatever’s marked “current” will be on master and what’s “incoming” is from feature.

There’s also git rerere that should in theory remember a resolution you do between two branches and reuse it every time after the first; I’ve rarely used it in practice; it would happen for long lived branches that don’t get merged.

stilgar, to programmerhumor in I'm going to sit down and actually learn git this week
@stilgar@infosec.pub avatar

Pro tip: If your code gets flogged by git, you can always get revenge with git reflog 😉

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • uselessserver093
  • Food
  • aaaaaaacccccccce
  • test
  • CafeMeta
  • testmag
  • MUD
  • RhythmGameZone
  • RSS
  • dabs
  • KamenRider
  • Ask_kbincafe
  • TheResearchGuardian
  • KbinCafe
  • Socialism
  • oklahoma
  • SuperSentai
  • feritale
  • All magazines