Installing Git Version Control
To install a Git version control, go to the download pages for Git:
Windows OS
For Windows OS, select the appropriate bit-type of your Windows system. In my case, 64-bit is used.
Just run the *.exe (as of April 14, 2025 4:25 AM, the latest 64-bit installer is Git-2.49.0-64-bit.exe). Follow installation guide with the following recommended configuration:
- Select Components:
- Keep default selections.
- Optionally, enable:
- “Windows Explorer integration”
- “Git Bash Here”
- “Git GUI Here”
- Choosing the Default Editor:
- Select an editor you’re comfortable with.
- Common choices:
- Nano: Simple and user-friendly.
- Notepad++: Feature-rich and widely used.
- Visual Studio Code: Modern and extensible.
- Adjusting the Name of the Initial Branch:
- Set to
mainto align with modern conventions:- “Override the default branch name for new repositories” →
main
- “Override the default branch name for new repositories” →
- Set to
- Adjusting Your PATH Environment:
- Choose:
- “Git from the command line and also from 3rd-party software”
- This allows Git to be used in various terminals and tools.
- Choose:
- Choosing the SSH Executable:
- Select:
- “Use bundled OpenSSH”
- Ensures compatibility with Git operations.
- Select:
- Choosing HTTPS Transport Backend:
- Opt for:
- “Use the OpenSSL library”
- Provides broader compatibility across environments.
- Opt for:
- Configuring the Line Ending Conversions:
- Select:
- “Checkout Windows-style, commit Unix-style line endings”
- This setting helps maintain consistency across different operating systems.
- Select:
- Configuring the Terminal Emulator:
- Choose:
- “Use MinTTY (the default terminal of MSYS2)”
- Offers a better terminal experience with features like copy-paste and resizable windows.
- Choose:
- Configuring Extra Options:
- Enable:
- “Enable file system caching”
- “Enable symbolic links” (if you plan to use symlinks)
- Enable:
- Experimental Options:
- It’s advisable to leave experimental features unchecked unless you have specific needs.
Post-Installation Configuration
After completing the installation:
- Set Your Identity:
Open Git Bash within RStudio using the keyboard shortcut
Shift + Alt + Mand configure your user information:git config --global user.name "Your Name" git config --global user.email "you@example.com"
- Verify Installation:
Check the installed Git version:
git --version
These settings provide a balanced configuration suitable for most users, ensuring compatibility and ease of use across various development environments.
Mac OS
To install Git on macOS using the Terminal, you have several options:
Option 1: Install Git via Xcode Command Line Tools
macOS includes Git as part of the Xcode Command Line Tools. You can install it as follows:
- Open Terminal:
- Navigate to
Applications>Utilities>Terminal.
- Navigate to
- Check for Git Installation:
Type the following command and press
Return:git --versionIf Git is not installed, a prompt will appear asking if you want to install the Command Line Tools.
- Install Command Line Tools:
- In the prompt that appears, click Install to proceed.
- Agree to the License Agreement and wait for the installation to complete.
- Verify Installation:
After installation, verify that Git is installed by typing:
git --versionYou should see the Git version displayed, confirming the installation.
Option 2: Install Git Using Homebrew
Homebrew is a popular package manager for macOS that simplifies software installation. If you have Homebrew installed, you can install Git as follows:
- Open Terminal:
- Navigate to
Applications>Utilities>Terminal.
- Navigate to
- Install Git:
Type the following command and press
Return:brew install gitHomebrew will download and install Git.
- Verify Installation:
After installation, verify that Git is installed by typing:
git --versionYou should see the Git version displayed, confirming the installation.
What’s Next?
Go back to Starting Page
Go back to Installation Guide
Go back to Installing, Using, and Removing R Packages
Go back to Required Packages for Training