As suggested by @Armageddon1 , a thread for Git tips and tricks. I figured if it isn't separated out from the Assembling the Team thread, any tips/tricks will be lost in that thread.
------
Tip #1: If you are new to Git, use a GUI client.
I'm not sure how much it matters which GUI client (though it probably does matter some), but these will let you ease in to the complexity of Git.
I've been using TortoiseGit for years. Windows only, integrates with Explorer to give you right-click context menus for frequently-used actions. It's probably not as great as TortoiseHg or TortoiseSVN, and learning Git was still difficult (in 2013, when documentation was not as good as it is today), but it has some nice visual features like log, diff, blame, commit, etc.
SourceTree is another free option. Windows or Mac. I've only really used it with Mercurial, and not extensively at that. It appears to have better support of partially-committed files than TortoiseGit, although that's an advanced feature IMO.
GitKraken has a free license for open-source projects. Windows/Mac/Linux. They claim to try to make things easier for newcomers, which would be good, and they have an "Undo" button, which really does sound like a good thing if you're new to Git.
Fork was recommended by Armageddon, though it does not appear to be free. Windows/Mac. It is a one-time cost though, unlike some premium options that are subscription-based.
Armageddon can chime in with more detail on the latter two.
-----
Tip #2: Checking out a fork.
Let's say someone has forked the repo and opened an MR, and you want to examine it locally. Their GitHub name is bob, and their branch is someNewBranch. To check it out, run:
Note that you'll have to use https instead of ssh unless you have ssh access to bob's repo. The fetch step is also important here.
(side note: should we be encouraging just using branches in the main repo? I've never really worked with the fork model before as all my projects have been within one organization)
------
Tip #1: If you are new to Git, use a GUI client.
I'm not sure how much it matters which GUI client (though it probably does matter some), but these will let you ease in to the complexity of Git.
I've been using TortoiseGit for years. Windows only, integrates with Explorer to give you right-click context menus for frequently-used actions. It's probably not as great as TortoiseHg or TortoiseSVN, and learning Git was still difficult (in 2013, when documentation was not as good as it is today), but it has some nice visual features like log, diff, blame, commit, etc.
SourceTree is another free option. Windows or Mac. I've only really used it with Mercurial, and not extensively at that. It appears to have better support of partially-committed files than TortoiseGit, although that's an advanced feature IMO.
GitKraken has a free license for open-source projects. Windows/Mac/Linux. They claim to try to make things easier for newcomers, which would be good, and they have an "Undo" button, which really does sound like a good thing if you're new to Git.
Fork was recommended by Armageddon, though it does not appear to be free. Windows/Mac. It is a one-time cost though, unlike some premium options that are subscription-based.
Armageddon can chime in with more detail on the latter two.
-----
Tip #2: Checking out a fork.
Let's say someone has forked the repo and opened an MR, and you want to examine it locally. Their GitHub name is bob, and their branch is someNewBranch. To check it out, run:
Code:
git remote add bob https://github.com/bob/Prototype.git
git fetch bob
git checkout bob/someNewBranch
Note that you'll have to use https instead of ssh unless you have ssh access to bob's repo. The fetch step is also important here.
(side note: should we be encouraging just using branches in the main repo? I've never really worked with the fork model before as all my projects have been within one organization)