提交代码到自己的github仓库

说起来尴尬,好几年前就搞了github建了仓库,当时玩得还有点6,后来一直的公司都是svn,自己业务项目也没玩,都忘了要怎么提交代码到自己的仓库了。

这边再来一波记录吧。

一、配置用户名

git config --global user.name "Mona Lisa"

确认已修改:

git config --global user.name

二、本地配置邮箱

git config --global user.email "[email protected]"

确认已修改:

  git config --global user.email

三、修改github上邮箱,保持一致

https://help.github.com/articles/setting-your-commit-email-address-on-github/

四、https克隆自己的github仓库

本地找个目录用:

git clone url(拷贝的地址)

五、修改文件,提交

修改文件,切换到项目根路径下,打开git bash,执行:

git add .
git commit -m "Add existing file"
git push origin master

(这步没让我输密码,不知道为啥)

然后我再去github上,文件已经修改了。

猜你喜欢

转载自www.cnblogs.com/grey-wolf/p/9266987.html