From 195bb6e477231b96c18b2062f1ef59d64a6f81cd Mon Sep 17 00:00:00 2001 From: tekkub Date: Sun, 6 Mar 2011 03:32:18 -0700 Subject: Use a common include for the email settings --- _includes/email_setup.markdown | 43 +++++++++++++++++++++++++++ _posts/2009-06-13-linux-set-up-git.markdown | 26 +--------------- _posts/2009-06-13-mac-set-up-git.markdown | 43 +-------------------------- _posts/2009-06-13-win-set-up-git.markdown | 26 +--------------- _posts/2009-06-20-git-email-settings.markdown | 12 ++++++++ _posts/2009-06-20-git-email-settings.textile | 38 ----------------------- 6 files changed, 58 insertions(+), 130 deletions(-) create mode 100644 _includes/email_setup.markdown create mode 100644 _posts/2009-06-20-git-email-settings.markdown delete mode 100644 _posts/2009-06-20-git-email-settings.textile diff --git a/_includes/email_setup.markdown b/_includes/email_setup.markdown new file mode 100644 index 0000000..01e1824 --- /dev/null +++ b/_includes/email_setup.markdown @@ -0,0 +1,43 @@ + +1. Set your username and email. + + Git tracks who makes each commit by checking the user’s name and email. In addition, we use this info to associate your commits with your GitHub account. To set these, enter the code below, replacing the name and email with your own. The name should be your _actual name_, not your GitHub username. + +
+		$ git config --global user.name "Firstname Lastname"Sets the name of the user for all git instances on the system
+		$ git config --global user.email "your_email@youremail.com"Sets the email of the user for all git instances on the system
+	
+ +
+

More about user info

+
+

+ The steps listed above show you how to set your user info globally. This means that no matter which repo you work in on your computer, you’ll be making commits as that user. If you find yourself needing to make commits with different user info for a specific repo (perhaps for work vs. personal projects), you will have to change the info in that repo itself. +

+
+				$ cd my_other_repoChanges the working directory to the repo you need to switch info for
+				$ git config user.name "Different Name"Sets the user's name for this specific repo
+				$ git config user.email "differentemail@email.com"Sets the user's email for this specific repo
+			
+

+ Now your commits will be “blamed” on (associated with) new user name and email whenever working in the specified repo. +

+
+
+ +2. Set your GitHub token. + + Some tools connect to GitHub without SSH. To use these tools properly you need to find and configure your API Token. + + On the GitHub site _Click “Account Settings”_ > _Click “Account Admin.”_ + + Copy your API token + + At the command line run the following code, using your GitHub username and token in place of the ones shown. + +
+		$ git config --global github.user usernameSets the GitHub username for all git instances on the system
+		$ git config --global github.token 0123456789yourf0123456789tokenSets the GitHub token for all git instances on the system
+	
+ + __*Note*__ If you ever change your GitHub password, a new token will be created and will need to be updated. diff --git a/_posts/2009-06-13-linux-set-up-git.markdown b/_posts/2009-06-13-linux-set-up-git.markdown index 8ed6731..496cc20 100644 --- a/_posts/2009-06-13-linux-set-up-git.markdown +++ b/_posts/2009-06-13-linux-set-up-git.markdown @@ -196,31 +196,7 @@ To make sure you generate a brand new key, you need to check if one already exis Now that you have Git set up and your SSH keys entered into GitHub, it’s time to configure your personal info. -1. Set your username and email. - - Git tracks who makes each commit by checking the user’s name and email. In addition, we use this info to associate your commits with your GitHub account. To set these, enter the code below, replacing the name and email with your own. The name should be your _actual name_, not your GitHub username. - -
-	$ git config --global user.name "Firstname Lastname"Sets the name of the user for all git instances on the system
-	$ git config --global user.email "user_name@username.com"Sets the email of the user for all git instances on the system
-	
- -2. Set your GitHub token. - - Some tools connect to GitHub without SSH. To use these tools properly you need to find and configure your API Token. - - On the GitHub site _Click “Account Settings”_ > _Click “Account Admin.”_ - - Copy your API token - - In Terminal, run the following code, using your GitHub username and token in place of the ones shown. - -
-	$ git config --global github.user usernameSets the GitHub username for all git instances on the system
-	$ git config --global github.token 0123456789your0123456789tokenSets the GitHub token for all git instances on the system
-	
- - __*Note*__ If you ever change your GitHub password, a new token will be created and will need to be updated. +{% include email_setup.markdown %} ##Lastly: Celebrate diff --git a/_posts/2009-06-13-mac-set-up-git.markdown b/_posts/2009-06-13-mac-set-up-git.markdown index 95e4924..7bc27d7 100644 --- a/_posts/2009-06-13-mac-set-up-git.markdown +++ b/_posts/2009-06-13-mac-set-up-git.markdown @@ -181,48 +181,7 @@ To make sure you generate a brand new key, you need to check if one already exis Now that you have Git set up and your SSH keys entered into GitHub, it’s time to configure your personal info. -1. Set your username and email. - - Git tracks who makes each commit by checking the user’s name and email. In addition, we use this info to associate your commits with your GitHub account. To set these, enter the code below, replacing the name and email with your own. The name should be your _actual name_, not your GitHub username. - -
-		$ git config --global user.name "Firstname Lastname"Sets the name of the user for all git instances on the system
-		$ git config --global user.email "your_email@youremail.com"Sets the email of the user for all git instances on the system
-	
- -
-

More about user info

-
-

- The steps listed above show you how to set your user info globally. This means that no matter which repo you work in on your computer, you’ll be making commits as that user. If you find yourself needing to make commits with different user info for a specific repo (perhaps for work vs. personal projects), you will have to change the info in that repo itself. -

-
-				$ cd my_other_repoChanges the working directory to the repo you need to switch info for
-				$ git config user.name "Different Name"Sets the user's name for this specific repo
-				$ git config user.email "differentemail@email.com"Sets the user's email for this specific repo
-			
-

- Now your commits will be “blamed” on (associated with) new user name and email whenever working in the specified repo. -

-
-
- -2. Set your GitHub token. - - Some tools connect to GitHub without SSH. To use these tools properly you need to find and configure your API Token. - - On the GitHub site _Click “Account Settings”_ > _Click “Account Admin.”_ - - Copy your API token - - In Terminal, run the following code, using your GitHub username and token in place of the ones shown. - -
-		$ git config --global github.user usernameSets the GitHub username for all git instances on the system
-		$ git config --global github.token 0123456789yourf0123456789tokenSets the GitHub token for all git instances on the system
-	
- - __*Note*__ If you ever change your GitHub password, a new token will be created and will need to be updated. +{% include email_setup.markdown %} ##Lastly: Celebrate diff --git a/_posts/2009-06-13-win-set-up-git.markdown b/_posts/2009-06-13-win-set-up-git.markdown index 426b898..ac694c5 100644 --- a/_posts/2009-06-13-win-set-up-git.markdown +++ b/_posts/2009-06-13-win-set-up-git.markdown @@ -172,31 +172,7 @@ To make sure you generate a brand new key, you need to check if one already exis Now that you have Git set up and your SSH keys entered into GitHub, it’s time to configure your personal info. -1. Set your username and email. - - Git tracks who makes each commit by checking the user’s name and email. In addition, we use this info to associate your commits with your GitHub account. To set these, enter the code below, replacing the name and email with your own. The name should be your _actual name_, not your GitHub username. - -
-	$ git config --global user.name "Firstname Lastname"Sets the name of the user for all git instances on the system
-	$ git config --global user.email "user_name@username.com"Sets the email of the user for all git instances on the system
-	
- -2. Set your GitHub token. - - Some tools connect to GitHub without SSH. To use these tools properly you need to find and configure your API Token. - - On the GitHub site _Click “Account Settings”_ > _Click “Account Admin.”_ - - Copy your API token - - In Git Bash, run the following code, using your GitHub username and token in place of the ones shown. - -
-	$ git config --global github.user usernameSets the GitHub username for all git instances on the system
-	$ git config --global github.token 0123456789your0123456789tokenSets the GitHub token for all git instances on the system
-	
- - __*Note*__ If you ever change your GitHub password, a new token will be created and will need to be updated. +{% include email_setup.markdown %} ##Lastly: Celebrate diff --git a/_posts/2009-06-20-git-email-settings.markdown b/_posts/2009-06-20-git-email-settings.markdown new file mode 100644 index 0000000..462fd5f --- /dev/null +++ b/_posts/2009-06-20-git-email-settings.markdown @@ -0,0 +1,12 @@ +--- +layout: default +title: Setting user name, email and GitHub token +description: Configure your local git installation so that commits are linked to your GitHub account +categories: troubleshooting popular +--- + +This guide covers basic git settings you should set before making any commits. + +Please note that config changes will only affect future commits. Existing commits will retain the info they were committed with. Also, the environment variables `GIT_COMMITTER_NAME`, `GIT_COMMITTER_EMAIL`, `GIT_AUTHOR_NAME` and `GIT_AUTHOR_EMAIL` will override git-config settings if they are defined. + +{% include email_setup.markdown %} diff --git a/_posts/2009-06-20-git-email-settings.textile b/_posts/2009-06-20-git-email-settings.textile deleted file mode 100644 index 105f7c4..0000000 --- a/_posts/2009-06-20-git-email-settings.textile +++ /dev/null @@ -1,38 +0,0 @@ ---- -layout: default -title: Setting user name, email and GitHub token -description: Configure your local git installation so that commits are linked to your GitHub account -categories: troubleshooting popular ---- - -This guide covers basic git settings you should set before making any commits. - -Please note that config changes will only affect future commits. Existing commits will retain the info they were committed with. Also, the environment variables @GIT_COMMITTER_NAME@, @GIT_COMMITTER_EMAIL@, @GIT_AUTHOR_NAME@ and @GIT_AUTHOR_EMAIL@ will override git-config settings if they are defined. - -h2. Setting user name and email globally in git - -Git needs to know your username and email address to properly credit your commits. Setting this setting will also let GitHub link the commits you make to your GitHub account. Only commits made after you change this setting will use the new info, old commits will preserve the info they were committed with. - -p(. _The "email" setting does not have to be a valid email address, it only need match the "user@server" naming scheme._ - -
$ git config --global user.name "Tekkub"
-$ git config --global user.email "tekkub@gmail.com"
- -h2. Overriding settings for individual repos - -If you do not want commits to be "blamed" on your global email setting, you can override these settings on a per-repo basis. - -
$ cd my_other_repo
-$ git config user.name "Not Tekkub"
-$ git config user.email "not@tekkub.net"
- -h2. GitHub token config - -Some tools connect to GitHub without SSH, for these tools you need to set your "local GitHub config":http://github.com/blog/180-local-github-config. You can find your token on the "account page":https://github.com/account - -!http://img.skitch.com/20091209-k5x2xa1rrc889deqmp53464m8n.png! - -
$ git config --global github.user tekkub
-$ git config --global github.token 0123456789abcdef0123456789abcdef
- -If you change your GitHub password a new token will be created, therefore you'll need to change this setting. -- cgit v1.3.1