Beehaw
  • Communities
  • Create Post
  • search
    Search
  • Login
  • Sign Up
seahorse [Ohio] ( seahorse@midwest.social )  to Programmer Humor@lemmy.mlEnglish · 3 years ago

I'm going to sit down and actually learn git this week

midwest.social

message-square
41
link
fedilink
692

I'm going to sit down and actually learn git this week

midwest.social

seahorse [Ohio] ( seahorse@midwest.social )  to Programmer Humor@lemmy.mlEnglish · 3 years ago
message-square
41
link
fedilink
alert-triangle
You must log in or # to comment.
  • DarkwinDuck ( DarkwinDuck@feddit.de ) 
    link
    fedilink
    arrow-up
    55
    ·
    3 years ago

    So you’re going to git gud?

    • brothershamus ( brothershamus@kbin.social ) 
      link
      fedilink
      arrow-up
      21
      ·
      3 years ago

      git out

    • dditty ( dditty@lemm.ee ) 
      link
      fedilink
      arrow-up
      1
      ·
      3 years ago

      deleted by creator

  • lseif ( lseif@sopuli.xyz ) 
    link
    fedilink
    arrow-up
    46
    ·
    3 years ago

    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 ) 
      link
      fedilink
      English
      arrow-up
      9
      ·
      3 years ago

      Also, a way to never have to work again!

  • katy ✨ ( cupcakezealot@lemmy.blahaj.zone ) 
    link
    fedilink
    arrow-up
    25
    ·
    3 years ago

    lemme rebase the main branch onto my branch.

    two minutes later

    1 merge conflict of 57 [abort] [continue]

  • Andrew ( Andrew15_5@mander.xyz ) 
    link
    fedilink
    arrow-up
    15
    ·
    3 years ago

    Literally.

    • PeWu ( PeWu@lemmy.ml ) 
      link
      fedilink
      arrow-up
      2
      ·
      3 years ago

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

      • Andrew ( Andrew15_5@mander.xyz ) 
        link
        fedilink
        arrow-up
        1
        ·
        3 years ago

        Show me.

  • lily33 ( lily33@lemm.ee ) 
    link
    fedilink
    arrow-up
    15
    ·
    3 years ago

    Learning git is very easy. For example, to do it on Debain, one simply needs to run, sudo apt install lazygit

    • Kata1yst ( Kata1yst@kbin.social ) 
      link
      fedilink
      arrow-up
      9
      ·
      3 years ago

      LazyGit 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 ) 
      link
      fedilink
      arrow-up
      2
      ·
      3 years ago

      Wow this looks great. Amend an old commit dealing with a rebase? Sign me up!

    • jcg ( jcg@halubilo.social ) 
      link
      fedilink
      arrow-up
      1
      ·
      3 years ago

      I’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 ) 
        link
        fedilink
        arrow-up
        1
        ·
        3 years ago

        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.

        • Alex ( stsquad@lemmy.ml ) 
          link
          fedilink
          arrow-up
          1
          ·
          3 years ago

          Is this what people who haven’t been introduced to #magit use?

          • lily33 ( lily33@lemm.ee ) 
            link
            fedilink
            arrow-up
            1
            ·
            3 years ago

            Never 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 ) 
    link
    fedilink
    English
    arrow-up
    14
    ·
    3 years ago

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

  • roastpotatothief ( roastpotatothief@lemmy.ml ) 
    link
    fedilink
    arrow-up
    14
    ·
    3 years ago

    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.

    • oce 🐆 ( oce@jlai.lu ) 
      link
      fedilink
      arrow-up
      12
      ·
      3 years ago

      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.

      • roastpotatothief ( roastpotatothief@lemmy.ml ) 
        link
        fedilink
        arrow-up
        3
        ·
        3 years ago

        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.

      • Pxtl ( Pxtl@lemmy.ca ) 
        link
        fedilink
        English
        arrow-up
        3
        ·
        3 years ago

        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.

        • oce 🐆 ( oce@jlai.lu ) 
          link
          fedilink
          arrow-up
          2
          ·
          3 years ago

          Submodule commands are such mess, which is sad because it is a great feature.

    • Shhalahr ( Shhalahr@beehaw.org ) 
      link
      fedilink
      arrow-up
      1
      ·
      3 years ago

      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.

  • yoz ( yoz@aussie.zone ) 
    link
    fedilink
    English
    arrow-up
    9
    ·
    3 years ago

    Lol what’s git?

    • twei ( twei@feddit.de ) 
      link
      fedilink
      arrow-up
      22
      ·
      3 years ago

      git gud. HA, GOTTEM

    • NaoPb ( NaoPb@eviltoast.org ) 
      link
      fedilink
      English
      arrow-up
      9
      ·
      3 years ago

      It’s what americans from a rural area say when they want you to go away.

    • twei ( twei@feddit.de ) 
      link
      fedilink
      arrow-up
      1
      ·
      3 years ago

      deleted by creator

  • fer0n ( fer0n@lemm.ee ) 
    link
    fedilink
    arrow-up
    9
    ·
    3 years ago

    This has been the best git tutorial I’ve come across so far. Nicely interactive and gamified. https://learngitbranching.js.org/

  • noddy ( noddy@beehaw.org ) 
    link
    fedilink
    arrow-up
    9
    ·
    3 years ago

    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 ( Shhalahr@beehaw.org ) 
      link
      fedilink
      arrow-up
      3
      ·
      3 years ago

      Go, Team Rebase!

  • erogenouswarzone ( erogenouswarzone@lemmy.ml ) 
    link
    fedilink
    English
    arrow-up
    8
    ·
    edit-2
    3 years ago

    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_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.

    • Aniki 🌱🌿 ( aniki@lemm.ee ) Banned
      link
      fedilink
      arrow-up
      1
      ·
      edit-2
      3 years ago

      Removed by mod

      • jjjalljs ( jjjalljs@ttrpg.network ) 
        link
        fedilink
        arrow-up
        3
        ·
        3 years ago

        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.

      • erogenouswarzone ( erogenouswarzone@lemmy.ml ) 
        link
        fedilink
        English
        arrow-up
        1
        ·
        3 years ago

        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.

  • Netrunner ( Netrunner@programming.dev ) 
    link
    fedilink
    arrow-up
    8
    ·
    3 years ago

    If 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 ) 
      link
      fedilink
      arrow-up
      22
      ·
      3 years ago

      Solving merge conflicts or rebasing is not simple

    • oce 🐆 ( oce@jlai.lu ) 
      link
      fedilink
      arrow-up
      9
      ·
      edit-2
      3 years ago

      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.

      • jcg ( jcg@halubilo.social ) 
        link
        fedilink
        arrow-up
        1
        ·
        3 years ago

        deleted by creator

    • sajran ( sajran@lemmy.ml ) 
      link
      fedilink
      English
      arrow-up
      4
      ·
      3 years ago

      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.

  • shiveyarbles ( shiveyarbles@beehaw.org ) 
    link
    fedilink
    arrow-up
    8
    ·
    3 years ago

    When we switched from svn, we had to figure out git with submodules… that was fun

  • dan ( dan@upvote.au ) 
    link
    fedilink
    arrow-up
    7
    ·
    3 years ago

    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.

    • lseif ( lseif@sopuli.xyz ) 
      link
      fedilink
      arrow-up
      1
      ·
      3 years ago

      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.

  • Ensign Rick ( ensignrick@startrek.website ) 
    link
    fedilink
    English
    arrow-up
    3
    ·
    3 years ago

    So many orphaned branches… Poor things.

Programmer Humor@lemmy.ml

programmerhumor@lemmy.ml

Subscribe from Remote Instance

Create a post
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: !programmerhumor@lemmy.ml

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

  • Posts must be relevant to programming, programmers, or computer science.
  • No NSFW content.
  • Jokes must be in good taste. No hate speech, bigotry, etc.
Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 1 user / day
  • 41 users / week
  • 337 users / month
  • 1.81K users / 6 months
  • 871 local subscribers
  • 43.7K subscribers
  • 1.25K Posts
  • 10.3K Comments
  • Modlog
  • mods:
  • AgreeableLandscape ( AgreeableLandscape@lemmy.ml ) 
  • cat_programmer ( cat_programmer@lemmy.ml ) 
  • BE: 0.19.15
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code