Installation
#安装git核心
sudo apt-get install Git-core
#安装git GUI
sudo apt-get install Git-gui
#安装git doc
sudo apt-get install Git-doc
#安装git-SVN
sudo apt-get install GIT-SVN
#安装git-cvs
sudo apt-get install Git-cvs
#安装gitweb
sudo apt-get install Gitweb
#安装git-daemon-run
sudo apt-get install Git-daemon-run
#安装git-email
sudo apt-get install Git-email
#安装git-arch
sudo apt-get install Git-arch
#安装gitk
sudo apt-get install GITK
#在终端上输入 the git test to install
Public key
First check the native public key:
$ CD ~/.ssh
If prompted: No such file or directory indicates that you are using Git for the first time. If you are not using it for the first time, do the following to clean up the original SSH key.
$ mkdir Key_backup
$ CP id_rsa* Key_backup
$ RM id_rsa*
To generate a new key:
$ ssh-keygen-t Rsa-c "your email address"
In the carriage return you will be prompted to enter a password, which will be used when you submit the project, if it is empty, you do not have to enter the project.
You can find an. ssh file in your user folder under your native system disk, where the SSH key that you just generated is stored in the Id_rsa.pub file.
Settings
Based on a pure warehouse test,
Git settings:
# Set the default user name when Git commits,
git config--global user.name "Your name Here"
# Set the default mailbox when Git commits,
git config--global user.email "[Email protected]"
Initial
Initialize to an empty project that contains only empty readme.md files:
Touch readme.md
# A directory must be initialized to create a. Git folder
Git init
#使用 git add * recursively adds all files
git add readme.md
Git commit-m "First commit"
#使用 git remote RM origin can be reset from Origin
git remote add origin [email protected]:only_phantasy/test.git
Git push-u Origin Master
"Push and pull"
git push
Git pull Origin Master
Basic usage of csdn git