一、登录github官网
如果没有用户可以注册一个用户。
点击new
点击 create repository
二、本地服务器推送
[root@git-01 home]# cd /server/
[root@git-01 server]# git clone https://github.com/liangzzeyu/git-test.git ##克隆到本地仓库[root@git-01 server]# ls
git_data git-test scripts
[root@git-01 server]# cd git-test/[root@git-01 git-test]# touch test.txt
[root@git-01 git-test]# git add .
[root@git-01 git-test]# git commit -m "add test.txt"
[root@git-01 git-test]# git remote add origin https://github.com/liangzzeyu/git-test.git ##创建origin分支[root@git-01 git-test]# git push -u origin master ##推送已有仓库
已经有文件在里面了
二、将git-test下拉到服务器中
[root@git-01 scripts]# cd /server/scripts/
有问题请加博主微信进行沟通!
全部评论