Git
Git is the most commonly used version control system today and is quickly becoming the standard for version control. Git is a distributed version control system, meaning that your local copy of code is a complete version control repository. These fully functional local repositories make it is easy to work offline or remotely. You commit your work locally, and then sync your copy of the repository with the copy on the server.
Documentation
Installation
Chocolatey is the prefered way to install tools on Windows
C:\> choco install git
Git Credential Manager
Enable the Git Credential Manager when installing Git.
See Use Git Credential Managers to Authenticate to Azure Repos.
Global Configuration
You should have to do these things only once on any given computer; they’ll stick around between upgrades. You can also change them at any time by running through the commands again.
Your identity
git config --global user.name "John Doe"
git config --global user.email johndoe@osb.group
Your Editor
Configure the default text editor that will be used when Git needs you to type in messages. We recommend using Visual Studio Code as your default text editor.
git config --global core.editor "code --wait --new-window"
If you are using another text editor in Windows:
# Notepad++
git config --global core.editor "notepad++.exe -multiInst -notabbar -nosession -noPlugin"
# Atom
git config --global core.editor "atom --wait"
# Sublime Text
git config --global core.editor "'C:/Program Files (x86)/sublime text 3/subl.exe' -w"
Automatically remove reference to deleted remote branches
git config --global fetch.prune true
Git For TFS Users
This is a list of comparison of TFVC and Git actions terminology that should help TFS Users to familiarize with git.
TFS VERSION CONTROL (TFVC) | GIT ACTIONS |
---|---|
Workspace | Repository (aka. “Repo”) |
Switch workspace / branch | Checkout |
Get Latest (First time) | Clone |
Get Latest (After first time) | Pull |
Check in | Commit + Push |
CheckIn and Get Latest Version | Sync (Push and Pull. Only exists in VS GUI) |
Check out | (just start typing) |
Branch | Branch |
Merge | Merge |
Code Review | Pull Request (PR) |
Shelveset | Stash |
Label | Tag |
Exclude | !Stage |