Configure git in CentOS
1 git Introduction
What is Git? Git is currently the most advanced distributed version control system in the world (none ). What are the characteristics of Git? To put it simply, the high-end atmosphere is superior !.
2Git component Installation
# Yum-y install git
3. Configure the git Repository
This document is based on the company's environmental requirements.
1. Configure the access key
# Ssh-keygen
2. Copy the client key to the git Server
# Ssh-copy-id
3. Create a git repository directory
# Mkdir/data/www/repos
4. Create a git Repository
# Cd/data/www/repos
# Git init -- bare sample. git (must be executed in the pre-defined repository directory)
5. Add users allowed to access
# Git config -- global user. name "root"
4 common git client commands
1. Add
# Git add File
2. Delete
# Git rm file
3. Submit changes
# Git commit-m "Remarks"
4. Submit
# Git push
5. Update
# Git pull
6. clone a repository
# Git clonegit access address and Directory
7. view the File status
# Git status
8. rename a file
# New git mv File
9. View logs
# Git log
10. Comparison of file differences
# Git diff
11. clone a database
The following command can be used to clone the code library because it is sometimes required in the production environment:
# Git clone -- bare repos