git克隆远程仓库
2019-08-25Linux90root831°c
A+ A-克隆一个远程仓库到本地
例如:克隆这一个地址 https://github.com/aminglinux/lanmp
[[email protected] gitroot]# cd .. [[email protected] home]# ls gitroot mysql php-fpm yunweigit- [[email protected] home]# git clone [email protected]:aminglinux/lanmp.git Initialized empty Git repository in /home/lanmp/.git/ remote: Counting objects: 26, done. remote: Total 26 (delta 0), reused 0 (delta 0), pack-reused 26 Receiving objects: 100% (26/26), 5.46 KiB, done. Resolving deltas: 100% (4/4), done. [[email protected] home]# ls gitroot lanmp mysql php-fpm yunweigit-
它提示,会在当前目录下初始化一个仓库,并创建一个.git的目录 Initialized empty Git repository in /home/lanmp/.git/ 查看克隆下来的内容 [[email protected] home]# cd lanmp/ [[email protected] lanmp]# ls lanmp.sh README.md [[email protected] lanmp]# cat README.md # lanmp lamp/lnmp 一键安装脚本 author: aming version: 0.2
更改文件,并提交到远程
[[email protected] lanmp]# vim lanmp.sh
[[email protected] lanmp]# git add lanmp.sh
[[email protected] lanmp]# git commit -m "change a lanmp.sh"
[master e6b7d7d] change a lanmp.sh
1 files changed, 1 insertions(+), 1 deletions(-)
[[email protected] lanmp]# git push
ERROR: Permission to aminglinux/lanmp.git denied to guozhenshijia.
fatal: The remote end hung up unexpectedly
提示我们没有权限,怎么办?(先拷贝文件到自己创建的目录后,再上传即可)
[[email protected] lanmp]# ls lanmp.sh README.md [[email protected] lanmp]# cp lanmp.sh /home/yunweigit-/ [[email protected] lanmp]# cd .. [[email protected] home]# ls gitroot lanmp mysql php-fpm yunweigit- [[email protected] home]# cd yunweigit-/ [[email protected] yunweigit-]# ls lanmp.sh yunweibanyungong.txt [[email protected] yunweigit-]# vim lanmp.sh [[email protected] yunweigit-]# git add lanmp.sh [[email protected] yunweigit-]# git commit -m "add lanmp.sh" [master bedacb5] add lanmp.sh 1 files changed, 3 insertions(+), 0 deletions(-) create mode 100644 lanmp.sh [[email protected] yunweigit-]# git push Counting objects: 4, done. Compressing objects: 100% (3/3), done. Writing objects: 100% (3/3), 327 bytes, done. Total 3 (delta 0), reused 0 (delta 0) To [email protected]:guozhenshijia/yunweigit-.git 6f67d31..bedacb5 master -> master
标签:Git