克隆仓库
[root@localhost test]# cd /home/[root@localhost home]# git clone git@github.com:aminglinux/lanmp.gitCloning into 'lanmp'...Warning: Permanently added the RSA host key for IP address '13.229.188.59' to the list of known hosts.remote: Counting objects: 32, done.remote: Total 32 (delta 0), reused 0 (delta 0), pack-reused 32Receiving objects: 100% (32/32), 5.99 KiB | 0 bytes/s, done.Resolving deltas: 100% (6/6), done.[root@localhost home]# cd lanmp/[root@localhost lanmp]# ls -ltotal 20-rw-r--r--. 1 root root 14871 Aug 3 15:40 lanmp.sh-rw-r--r--. 1 root root 88 Aug 3 15:40 README.md
[root@localhost lanmp]# vi README.md 删除某一行[root@localhost lanmp]# git add README.md [root@localhost lanmp]# git commit -m "change readme.md"[master 614a4cf] change readme.md Committer: rootYour name and email address were configured automatically basedon 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.comAfter doing this, you may fix the identity used for this commit with: git commit --amend --reset-author 1 file changed, 1 deletion(-)[root@localhost lanmp]# git pushwarning: push.default is unset; its implicit value is changing inGit 2.0 from 'matching' to 'simple'. To squelch this messageand maintain the current behavior after the default changes, use: git config --global push.default matchingTo squelch this message and adopt the new behavior now, use: git config --global push.default simpleSee 'git help config' and search for 'push.default' for further information.(the 'simple' mode was introduced in Git 1.7.11. Use the similar mode'current' instead of 'simple' if you sometimes use older versions of Git)Warning: Permanently added the RSA host key for IP address '52.74.223.119' to the list of known hosts.ERROR: Permission to aminglinux/lanmp.git denied to hellopasswd.fatal: Could not read from remote repository.Please make sure you have the correct access rightsand the repository exists.> 这里为需要密钥才可以与服务端同步
使用git pull为更新库
[root@localhost lanmp]# git pullAlready up-to-date. #已经最新的