NekuSoul-Lemmy
  • Communities
  • Create Post
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
seahorse [Ohio]@midwest.social to Programmer Humor@lemmy.mlEnglish · 2 years ago

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

midwest.social

message-square
31
fedilink
68

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

midwest.social

seahorse [Ohio]@midwest.social to Programmer Humor@lemmy.mlEnglish · 2 years ago
message-square
31
fedilink
alert-triangle
You must log in or register to comment.
  • lseif@sopuli.xyz
    link
    fedilink
    arrow-up
    10
    arrow-down
    1
    ·
    2 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@lemmy.ml
      link
      fedilink
      English
      arrow-up
      7
      ·
      2 years ago

      Also, a way to never have to work again!

  • DarkwinDuck@feddit.de
    link
    fedilink
    arrow-up
    9
    ·
    2 years ago

    So you’re going to git gud?

    • brothershamus@kbin.social
      cake
      link
      fedilink
      arrow-up
      2
      ·
      2 years ago

      git out

      • UNWILLING_PARTICIPANT@sh.itjust.works
        link
        fedilink
        arrow-up
        2
        ·
        2 years ago

        git your pants

  • stilgar [he/him] @infosec.pub
    link
    fedilink
    English
    arrow-up
    4
    ·
    2 years ago

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

  • ArbitraryValue@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    4
    ·
    2 years ago
    1. git pull
    2. git reset --hard HEAD
    3. try not to cry
    4. cry a lot
    • CalcProgrammer1@lemmy.ml
      link
      fedilink
      arrow-up
      6
      ·
      2 years ago

      git reflog, you can get your old commits back

      • ArbitraryValue@sh.itjust.works
        link
        fedilink
        English
        arrow-up
        4
        ·
        2 years ago

        But I want to pretend none of this ever happened.

        • winterayars@sh.itjust.works
          link
          fedilink
          arrow-up
          4
          ·
          2 years ago
          git can we just pretend the last 30 minutes never happened
          

          I feel like that would get more use than people want to admit.

  • katy ✨@lemmy.blahaj.zone
    link
    fedilink
    arrow-up
    2
    ·
    2 years ago

    lemme rebase the main branch onto my branch.

    two minutes later

    1 merge conflict of 57 [abort] [continue]

  • lily33@lemm.ee
    link
    fedilink
    arrow-up
    2
    ·
    2 years ago

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

    • Kata1yst@kbin.social
      link
      fedilink
      arrow-up
      1
      ·
      2 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@kbin.social
      link
      fedilink
      arrow-up
      0
      ·
      2 years ago

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

      • zalgotext@sh.itjust.works
        link
        fedilink
        arrow-up
        0
        ·
        edit-2
        2 years ago

        git rebase -i origin/main (or whatever branch you’re rebasing on), then read the instructions that come up in the editor window

        • corytheboyd@kbin.social
          link
          fedilink
          arrow-up
          1
          ·
          2 years ago

          Read… instructions? I love teaching people that git very often prints out what you should do next.

          git: “to continue, resolve conflicts, add files, and run rebase —continue”
          dev: …time to search stack overflow

          All that said… just use lazygit. It does help to know CLI git first to put things in context, but if you do, no need to punish yourself every day by not using a UI.

  • noddy@beehaw.org
    link
    fedilink
    arrow-up
    1
    ·
    2 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.

  • dan@upvote.au
    link
    fedilink
    arrow-up
    1
    ·
    edit-2
    2 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.

  • roastpotatothief@lemmy.ml
    link
    fedilink
    arrow-up
    1
    ·
    edit-2
    2 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 🐆@jlai.lu
      cake
      link
      fedilink
      arrow-up
      1
      ·
      2 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.

  • Andrew@mander.xyz
    link
    fedilink
    arrow-up
    1
    ·
    2 years ago

    Literally.

  • fer0n@lemm.ee
    link
    fedilink
    arrow-up
    1
    ·
    edit-2
    2 years ago

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

    • UNWILLING_PARTICIPANT@sh.itjust.works
      link
      fedilink
      arrow-up
      1
      ·
      2 years ago

      This is great, but I just want to say that the best way to use git is to simply stop doing so much in one branch. Branches should not last longer than a week, ideally

  • Ensign Rick@startrek.website
    link
    fedilink
    English
    arrow-up
    1
    ·
    2 years ago

    So many orphaned branches… Poor things.

  • brainw0rms [they/them]@hexbear.net
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    8 months ago

    .

  • YⓄ乙 @aussie.zone
    link
    fedilink
    English
    arrow-up
    0
    ·
    2 years ago

    Lol what’s git?

    • UNWILLING_PARTICIPANT@sh.itjust.works
      link
      fedilink
      arrow-up
      4
      ·
      2 years ago

      A very complicated way to do

      My project
      My project (1)
      My project WORKING
      My project (2)
      My project (2) (1)
      
      • YⓄ乙 @aussie.zone
        link
        fedilink
        English
        arrow-up
        3
        ·
        2 years ago

        Lol

    • NaoPb@eviltoast.org
      link
      fedilink
      English
      arrow-up
      1
      ·
      2 years ago

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

    • twei@feddit.de
      link
      fedilink
      arrow-up
      0
      ·
      2 years ago

      git gud. HA, GOTTEM

      • UNWILLING_PARTICIPANT@sh.itjust.works
        link
        fedilink
        arrow-up
        1
        ·
        2 years ago

        Yes you did

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.

  • 109 users / day
  • 800 users / week
  • 3.39K users / month
  • 8.92K users / 6 months
  • 1 local subscriber
  • 37K subscribers
  • 1.2K Posts
  • 21.9K Comments
  • Modlog
  • mods:
  • AgreeableLandscape@lemmy.ml
  • cat_programmer@lemmy.ml
  • BE: 0.19.8
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org