本文讲述的是如何在mac上操作,windows基本同理可以网上去查。

1、首先你要有服务器地址账号,若没有可以用github账号,github地址 https://github.com

2、创建ssh key验证。

打开终端,输入:

ssh-****** -t rsa -C "[email protected]"

图文:如何将本地工程提交到git上


点击ssh,右侧title随便填,将生成的rsa key用文本打开,复制里面内容到new ssh key中,即可。


3、在终端输入敲入: ssh -T [email protected],如果出现以下内容说明成功

Warning: Permanently added the RSA host key for IP address '52.74.223.119' to the list of known hosts.

Hi johnlee8896! You've successfully authenticated, but GitHub does not provide shell access.


4、进入你工程目录,执行命令:

git init //初始化本地仓库 
git add README.md //添加 
git add * //加入所有项目 
git status //检查状态 如果都是绿的 证明成功 
git commit -m “first commit”//提交到要地仓库,并写一些注释 
git remote add origin [email protected]:xxx/yyyy.git //xxx就是你的github账号,比如我的账号名:li4236 === yyyy就在你自己刚才新建的项目名称 
git push -u origin master //将本地仓库的东西提交到地址是origin的地址,master分支下

到此为止本地的项目已经提交到github上了,刷新网页看看吧


以上内容参考文章:

https://blog.csdn.net/li4236/article/details/51159443


相关文章: