使用Git push到Github

下载git,地址:https://git-scm.com/downloads

打开git-bash,把自己的Repository git clone下来,稍作修改然后进入工程文件夹:

1
2
3
git add .
git commit -m "提交信息"
git push

push后会弹出要求账号密码的窗口,按要求输入即可。

可能遇到的几个小问题:

1
unable to auto-detect email address

按照提示输入:

1
2
git config --global user.email "邮箱"
git config --global user.name "姓名"

具体邮箱姓名随便填。

1
everything up-to-date

没有 git add .,或者没有 git commit -m “提交信息”,还有空文件夹不会上传。

1
! [rejected] master -> master (fetch first)

github上的内容有修改,可以先git pull回来再push

1
Please enter a commit to explain why this merge is necessary......

不用管它直接:wq退出。