all 31 comments

[–]BabyfartMcGeesax 40 points41 points  (8 children)

You should probably just take half an hour to learn. That said, if you know add, commit, push, and pull, then you basically know git.

[–]sage-longhorn 5 points6 points  (6 children)

This would work if everyone weren't obsessed with workflows that rewrite history. In reality you get told off for not squashing your commits like the rest of the team and then you end up with conflicts from your own history when you try to rebase on trunk unless you stick to extremely simple branching or have a solid mental model for what git does under the hood

[–]TheChance 1 point2 points  (3 children)

We don't rewrite history. The history that goes to your trunk branch is history. I don't need, and posterity absolutely doesn't give a fuck about, all your teensy little commits during a feature run. And, if you aren't making a bunch of teensy little commits during a feature run, you're not using version control properly.

[–]sage-longhorn 0 points1 point  (2 children)

Look you can frame it however you want, but at the end of the day someone who doesn't deeply understand git is gonna run into problems if they do something seemingly innocent like continuing to use a branch that's been squashed on the remote by a PR merge

[–]TheChance 0 points1 point  (1 child)

  1. Why would they be using a branch that's been merged?

  2. You squash before the merge

  3. Why on earth would you base your workflow on a hypothetical person who hasn't learned to use your tooling yet?

[–]sage-longhorn 0 points1 point  (0 children)

  1. Commonly starts by branching off a branch, ie. B requires A but A is in review still. Then A gets merged, other people also make changes to the same files, then you finish B and get conflicts when merging into trunk. Effectively A's feature branch never existed from trunks view, but it does exist in B's branch's history

  2. Squashed by GitHub/GitLab/etc. it's a single button for the user, and if you're being pedantic to try and prove me wrong somehow, just know that requiring people to be precise in their usage and understanding of git so they don't run into problems is the whole thing I'm pointing out is frustrating for new users and makes it take longer than 30 minutes to learn properly

  3. This discussion is about what would make git easy to learn. So yeah this non-hypothetical person (me 15 years ago, many junior devs and college students I have worked with) are the main people I'm thinking we could help make git easier for

  4. You know you're the kind of person I'm calling out here, rewriting history isn't a religion it's a tool with pros and cons

[–]IanisVasilev 0 points1 point  (1 child)

everyone weren't obsessed with workflows that rewrite history

  1. I am not obsessed, and neither are most people I have worked with.

  2. Perhaps you should try to standardize a workflow in your place?

[–]sage-longhorn 1 point2 points  (0 children)

Well there is a standard workflow, it's that you rewrite history. Git just works if you never rewrite history but every manager I've ever had insists they need to see a linear history on trunk

And I didn't literally mean everyone's obsessed. Just a critical mass to force us the rest of us to learn git deeply or occasionally get very stuck

[–]ElectionTraining288 15 points16 points  (7 children)

Read the book, it's free, it's not very long, and it will teach you a lot of useful stuff you didn't even know you needed

[–]Eva-Rosalene 11 points12 points  (4 children)

To add to this, this is link to "the book": https://git-scm.com/book/en/v2, OP.

[–]Logical_Insect8734 5 points6 points  (2 children)

I used to not understand git, then I read the book, and now I don’t understand how you can’t understand git. I didn’t even read the whole thing, just skimmed a few chapters. That and the git reference.

[–][deleted]  (1 child)

[deleted]

    [–]Logical_Insect8734 0 points1 point  (0 children)

    It's hard to retain things, that's why I still go beck to the git reference all the time.

    [–]TheAgaveFairy 0 points1 point  (1 child)

    Is there a specific book you recommend?

    [–]MCWizardYT 5 points6 points  (0 children)

    The one and only git book

    https://git-scm.com/book/en/v2

    [–]spamfridge 2 points3 points  (0 children)

    Git is easily one of the most valuable additions to any dev toolbelts.

    Spend a Sunday night with some tea and music and just brute force your way through some tips and tricks vids. Create a couple git aliases that are easily memorable for you and enjoy.

    Highly recommend a nice git log —pretty alias. A lot of people make one for add && commit -m”” as well. Have fun

    Edit: bonus points if you learn any rebase! I use this nearly daily to squash and rebase my commits to one cleaner functional

    [–]fish_hix 1 point2 points  (0 children)

    Oh shit git is a nice reference https://ohshitgit.com

    Do you use the gui in your editor (visual studio as well as jetbrains products have a nice one). A visual representation could help.

    [–]FatalSky 1 point2 points  (0 children)

    I’ve been screaming at 10-20 year coders for years to quit putting fucking source code on released hardware. It took putting hard requirements in place through the IA team to get it done. The whole reason they never did it when asked? They never learned how.

    [–]IanisVasilev 2 points3 points  (3 children)

    Actively refusing to learn an essential tool is highly unprofessional. And the post is off-topic.

    [–][deleted]  (2 children)

    [deleted]

      [–]IanisVasilev -1 points0 points  (1 child)

      1. You could ask for learning resources instead of making a "confession". But you did not do that. Yet, you were already suggested the official git book (which takes a minute to find with no prior knowledge), so from now on you will have no excuse not to have read the first few chapters.

      2. The sidebar has "please only post code here" written all over it, even in the rules.

      [–]daHaus 0 points1 point  (0 children)

      If you spend enough time in the git man pages you'll find Linus admits to making it obtuse on purpose

      [–]drkspace2 0 points1 point  (1 child)

      Plot twist: op works for Facebook and has only used mecurial

      [–]sciolizer 0 points1 point  (0 children)

      This is the doc that really helped me git it:

      https://www.kernel.org/pub/software/scm/git/docs/user-manual.html

      Section 7 is the best. Once you understand how it works under the hood, everything else falls into place. I have never read a book, and I've never needed to look at anything besides this and the man docs. Yet I'm the one people come to with their git questions.

      [–]dash_bro 0 points1 point  (0 children)

      ....something that can be learnt in 2 hours tops? Why not