天天看点

第一次上传代码到github (Linux)

1    初始化 执行git init 

第一次上传代码到github (Linux)

2   克隆

找到仓库地址,在github的具体项目上有

执行 git clone <地址> 并且把需要上传的文件拷贝过去

第一次上传代码到github (Linux)

3  添加提交文件 git add *   即添加所有变动的

第一次上传代码到github (Linux)

4 提交 git commit -m "描述"

第一次上传代码到github (Linux)

*** Please tell me who you are.

Run

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

  git config --global user.name "Your Name"

to set your account's default identity.

Omit --global to set the identity only in this repository.

fatal: unable to auto-detect email address (got '[email protected](none)')

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

 git config --global user.name  "usrname"

5 push到远端(服务器) git push origin master

第一次上传代码到github (Linux)

看到出错了,403 403错误,则请编辑 .git/config文件

第一次上传代码到github (Linux)

把红线的地方修改为    即在github前面加上 [email protected] (  url = https://[email protected]/username/repository.git )

第一次上传代码到github (Linux)

重新git push origin master

第一次上传代码到github (Linux)

执行unset SSH_ASKPASS 参考 http://stackoverflow.com/questions/16077971/git-produces-gtk-warning-cannot-open-display

第一次上传代码到github (Linux)

重新git push origin master    此时输入密码就ok了

第一次上传代码到github (Linux)
git