Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- How To Install Git Using Yum
- As is the case with most Linux distributions, git is available from CentOS's default repositories. We can install the package maintainer's most recent version with:
- sudo yum install git
- How To Set Up Git
- When you commit changes with git, it embeds your name and email address into the commit message in order to easily track changes.
- If we do not configure this information ourselves, git may try to guess these values (probably incorrectly) by using your Linux username and hostname.
- Give git the values you wish to use for these parameters with these commands:
- git config --global user.name "Your Name Here"
- git config --global user.email "your_email@example.com"
- The configuration changes will be stored in a file in your home directory. You can see them with a normal text editor:
- nano ~/.gitconfig
- [user]
- name = Your Name Here
- email = your_email@example.com
- You can also view this information by querying git itself for the current configuration settings:
- git config --list
- user.name=Your Name Here
- user.email=your_email@example.com
- As mentioned earlier, if you forget to set up these steps, git may try to fill in these values automatically:
- [master 0d9d21d] initial project version
- Committer: root
- Your name and email address were configured automatically based
- on your username and hostname. Please check that they are accurate.
- You can suppress this message by setting them explicitly:
- git config --global user.name "Your Name"
- git config --global user.email you@example.com
- After doing this, you may fix the identity used for this commit with:
- git commit --amend --reset-author
- Depending on your version of git, it may fail entirely:
- git commit
- *** Please tell me who you are.
- Run
- git config --global user.email "you@example.com"
- git config --global user.name "Your Name"
- to set your account's default identity.
- Omit --global to set the identity only in this repository.
- fatal: empty ident name (for ) not allowed
- As you can see, git is very good about telling you exactly what you should be doing.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement