1, the installation
1、1 使用yum安装的
命令:$ yum install git git-gui
2 generates a key pair using ssh-keygen Method
ssh-keygen -t [rsa | dsa], will generate the key and the key file id_rsa, id_rsa.pub or id_dsa, id_dsa.pub
3, the generated public key is copied to github.com in SSHKEY
$mkdir .ssh
$cd .ssh/
$ssh -keygen -t rsa -C 'qq.com'
如果出现产生的ssh-key无效的错误,请改为一行行的复制公钥内容,注意不要将空格,换行符等复制进来。
特别注意第一个字符不要漏了。
4, log on github. Open setting-> SSH keys, top right corner New SSH key, to generate a good id_rsa.pub public key into the input box, then a title from the current key to distinguish each key.
5, test
将key添加之后,我们测试下能否链接到github。
命令:$ ssh [email protected]
看是否有这些内容出现:
6, set up
为了联系,可以填写你的一些信息
命令:$ git config --global user.name "your name"
$ git config --global user.email "your email"
7, submitted
git clone 'git @ address'
cd warehouse name
mkdir AA # create a folder, the file will be submitted in this folder under
the cd AA's parent directory
git the Add *
git the commit -m 'comments'
git the Push - u origin master
Common Errors
1, ssh connection to the server error
ssh to connect to remote server error connection to ip address port 22: Broken pipe
解决:ssh -o ServerAliveInterval = 60 user@sshserver
user refers to git user name refers to an error ip address sshserver
2, git add file error
git add * command error
ubuntu@ip123~/ft$ git add *
The following paths are ignored by one of your .gitignore files:
__pycache__
Use -f if you really want to add them.
解决:ubuntu@ip-123:~/ft$ git add -f xx.txt #强制添加文件