To set up Git on your PC, follow these steps:
1. Download Git:
- Go to the official Git website: https://git-scm.com/downloads
- Download the appropriate version of Git for your operating system (Windows, macOS, or Linux).
- Run the installer and follow the on-screen instructions.
2. Configure Git:
- Open the Git Bash application (Windows) or the terminal (macOS/Linux).
- Set your username by running the following command, replacing "Your Name" with your actual name:
```
git config --global user.name "Your Name"
```
- Set your email address by running the following command, replacing "your.email@example.com" with your actual email:
```
git config --global user.email your.email@example.com
```
3. Verify Git Installation:
- To verify that Git is installed correctly, run the following command:
```
git --version
```
- You should see the Git version number printed in the terminal if the installation was successful.
4. (Optional) Set up SSH key (for GitHub authentication):
- Generating an SSH key allows you to securely authenticate with remote repositories like GitHub without entering your username and password for each interaction.
- Follow the instructions in this GitHub guide to generate an SSH key: https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent
Once Git is set up on your PC, you can use it for version control, creating repositories, committing changes, and collaborating with others. You can start by creating a new repository using `git init` command in your project directory and continue to use Git commands to manage your project's version history.
0 Comments