Git Fundamentals

Sign in to queue

The Discussion

  • User profile image
    davewill

    Thank you Robert. For a CVS shop this helps a lot to clear up the muddy water that is decentralized version control.

  • User profile image
    jvs_ca

    Thanks, great presentation as always!

  • User profile image
    DonaldA

    Thank you. I was wondering how to update a branch when changes were made on the master.

    There is a problem with the Visual Studio Changes list.  If I have a huge list of changes, sometimes I only get a 2 inch viewable list. I tried resizing on a vertical monitor, but no change.

  • User profile image
    wernerkelle​ns

    Great video! Thanks!

  • User profile image
    wkempf

    To answer your question about the '/'... let's analyze both commands.

    > git fetch origin master

    This says to fetch the 'master' branch from the remote named 'origin'. What's not spelled out in the command is where it actually fetches to. It fetches the remote branch into a local branch that it names 'origin/master'. Maybe you're seeing the answer already. :)

    > git merge origin/master

    This says to merge the branch named 'origin/master' into the branch your currently in. This 'origin/master' branch is a local branch, not a branch on a remote.

    So, 'origin/master' is just a branch naming convention used to distinguish branches that have been fetched from remote repositories.

    BTW, I didn't care for your explanation on when to use fetch/merge vs. pull. If there are conflicts, a pull still allows you to resolve those conflicts, so that's not really a reason to use fetch/merge instead. Frankly, the difference is mostly just a religious debate. There's a good number of folks that recommend fetch/merge, such as this one: https://longair.net/blog/2009/04/16/git-fetch-and-merge/. The reasoning is highly opinionated, however, and I find it funny that most of the folks that hold this opinion do a fetch and then immediately do a merge without doing anything else in between. If that's what your'e doing then you're just typing more as that's exactly what a pull does. The only time fetching without pulling is beneficial is when you want to be able to compare your local version with the remote version before or even without merging. That's really it. I actually prefer to use pull most of the time for this very reason.

  • User profile image
    rogreen

    @wkempf: Thanks for the explanation on / and the clarification on fetch/merge. I don't get into religious debates when it comes to developer tools. They are called tools for a reason. :) But I will be more crisp in talking about this in the future.

    Robert

     

  • User profile image
    wkempf

    I try to stay out of them as well. I usually use pull, but unlike the site I posted that's on the other side, I'm not going to try and convince you I'm right. :) Understand the difference (there's not much) and decide for yourself which you prefer, because it is just a preference (unless you're in one of the edge case scenarios where you really do want to just compare or need to compare before deciding to merge).

  • User profile image
    bwells

    Thanks, Robert!

    (Full disclosure: Until 3 days ago, Git was British term I knew and a mysterious Linux thing I didn't know.)

    One thing that I am wanting to confirm: I noted that you ended the demo with two Feature branches still sitting on your local machine. Once Feature2, etc. have been pulled to the server and merged into master, I presume it's simply a discretionary decision by the local user as to when they get around to deleting that branch in their local environment? I supposed if the name of the branch were RobertsCoolNewCode, maybe they keep the branch and just run with it endlessly? But if it were named FixedAug05BugInHelloWorld then you'd delete it after the dust settles?

    Thanks again!

  • User profile image
    rogreen

    @bwells: Deleting a branch after a PR is optional. I would imagine you would want to delete them locally once you are done with them. There is a good discussion of this here

    Robert

  • User profile image
    eduquint

    Great video. I am a fan of your shows.

    I would like to suggest a show subject, if I may. 

    It would be very instructive if you prepared a show with the same level of details, clarity,  and simplicity as you did for this one, but only for the Visual Studio Team Services.

    One of my pet peeves is how to safely branch and prune in the VSTS.

    I understood clearly how to do it using Git, and I understand the Microsoft push towards Git, but I would like to know how to use only VSTS.

    I have a large project (C++ and C#) and I would like to version control it using only VSTS.

    Thanks for your superb shows!

    Eduardo Quintana 

  • User profile image
    kullberg

    Great show!

    Any plans on doing a full tutorial on how to move from TFS to GIT in VSTS. I have project in TFS/VSTS and I want to go to GIT instead. Although there are some guides out there I don't really find them as explanatory as I want to. For example I've read that binaries and so on should not be in GIT but if I do automatic conversion in VSTS all these files are included.

     Thanks!

  • User profile image
    Davele

    Thanks Nice to have the rather long & convoluted workflow that is GIT covered & explained. 

    Clearly usability wasn't a key objective when Linus wrote GIT.

  • User profile image
    Ramin

    Thanks,great job

  • User profile image
    Niner409313

    Thanks. It really helps

  • User profile image
    RaphaelHaMa

    Thank you! It is a great video and it was a pleasure for me to learn from you.

Add Your 2 Cents