How to Set Up Git?

Hello 👋 good people. In this blog post, we will learn how to set up Git on your local computer. Because Git is responsible for everything GitHub-related that happens locally on your computer.

Those who don’t know what Git & GitHub is, kindly read …


This content originally appeared on DEV Community and was authored by Syed Sohan

Hello 👋 good people. In this blog post, we will learn how to set up Git on your local computer. Because Git is responsible for everything GitHub-related that happens locally on your computer.

Those who don't know what Git & GitHub is, kindly read this post to know about Git & GitHub Introduction to Git & GitHub for Beginners.

Table of contents

  1. Download and Install Git

  2. Set your Git username Globally

  3. Set your Git username for a Single Repository

  4. Set your email globally

  5. Set your email for a single repository

Download and Install Git

To download & install Git just go to this following page and download Git for your preferable OS (macOS, Windows, Linux/Unix).

Git-Logo-1788C.png

Set your Git username Globally

You can change the name that is associated with your Git commits using the git config command. The new name you set will be visible in any future commits you push to GitHub from the command line.

  • Open Git Bash.

  • Set your Git username

$ git config --global user.name "John Doe"

  • Recheck that you've given the right username
$ git config --global user.name
> John Doe

Set your Git username for a Single Repository

  • Open Git Bash.

  • Change the current working directory to the local repository where you want to configure the name that is associated with your Git commits.

  • Set your Git username

$ git config user.name "John Doe"

  • Recheck that you've given the right username
$ git config user.name
> John Doe

Set your email globally

  • Open Git Bash.

  • Set your email address in Git. You can use your GitHub-provided no-reply (if you change your email public to private in GitHub) email address or any email address.

$ git config --global user.email "email@example.com"
  • Recheck that you've given the right email
$ git config --global user.email
> email@example.com

Set your email for a single repository

  • Open Git Bash.

  • Change the current working directory to the local repository where you want to configure the email address that is associated with your Git commits.

  • Set your email address in Git. You can use your GitHub-provided no-reply (if you change your email public to private in GitHub) email address or any email address.

git config user.email "email@example.com"

  • Recheck that you've given the right email
$ git config user.email
> email@example.com

Thanks for reading this post. Stay tuned for more.

You can find me here also.

Buy Me A Coffee


This content originally appeared on DEV Community and was authored by Syed Sohan


Print Share Comment Cite Upload Translate Updates
APA

Syed Sohan | Sciencx (2021-12-01T12:30:39+00:00) How to Set Up Git?. Retrieved from https://www.scien.cx/2021/12/01/how-to-set-up-git/

MLA
" » How to Set Up Git?." Syed Sohan | Sciencx - Wednesday December 1, 2021, https://www.scien.cx/2021/12/01/how-to-set-up-git/
HARVARD
Syed Sohan | Sciencx Wednesday December 1, 2021 » How to Set Up Git?., viewed ,<https://www.scien.cx/2021/12/01/how-to-set-up-git/>
VANCOUVER
Syed Sohan | Sciencx - » How to Set Up Git?. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/12/01/how-to-set-up-git/
CHICAGO
" » How to Set Up Git?." Syed Sohan | Sciencx - Accessed . https://www.scien.cx/2021/12/01/how-to-set-up-git/
IEEE
" » How to Set Up Git?." Syed Sohan | Sciencx [Online]. Available: https://www.scien.cx/2021/12/01/how-to-set-up-git/. [Accessed: ]
rf:citation
» How to Set Up Git? | Syed Sohan | Sciencx | https://www.scien.cx/2021/12/01/how-to-set-up-git/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.