What are git configs and why set them up?
Below are the basic configurations needed for Git Bash on Windows for the VA organization, commonly referred to as git configs. These steps are an initial setup that only needs to be completed once per machine or VM.
Configure username
- With Git Bash open, enter the following command:
git config --global user.name “FirstName LastName”
- Replace “FirstName” and “LastName” with your human-readable first and last name.
Configure e-mail
- With Git Bash open, enter the following command:
git config --global user.email email@address.com
- Replace “email@address.com” with your work e-mail address.
Configure the VA firewall
The VA firewall requires additional configurations with Git bash. Enter the following three commands in Git Bash:
git config --global http.sslBackend 'schannel'
git config --global credential.helper 'manager-core'
git config --global http.schannelCheckRevoke false
Configure an editor on Windows
With a defined username and email associated with signing your commits, you might want to utilize your favorite editor when writing those commit messages. The following instructions are for individuals using Git Bash when interacting with git repositories.
Using Atom as your editor
- Install Atom.
- Open Git Bash.
- Enter the following command:
git config --global core.editor “atom —wait”
Using Visual Studio Code as your editor
- Install Visual Studio Code.
- Open Git Bash.
- Enter the following command:
git config --global core.editor “code --wait”
Eclipse users
- Install Eclipse with EGit: https://www.eclipse.org/egit/download/
- Update the settings for the VA firewall: Troubleshooting Java TLS Errors
Other helpful configs
When you install newer versions of Git Bash on Windows, it will automatically set both of these up for you:
- Set your credential manager for Windows:
git config --global credential.helper manager-core
- Windows and Unix operating systems handle line endings differently. You can tell git to automatically fix this issue for you.
For Windows, you set:
git config --global core.autocrlf true