当前位置:首页>记录>git 本地文件修改以后上传同步到 github 仓库中

git 本地文件修改以后上传同步到 github 仓库中

2017-04-21 2143 记录
git 本地文件修改以后上传同步到 github 仓库中 Git local file modified after uploading synchronization to github repository 更新上传过程中,提示: Everything up-to-date 说未进行任何更新。

1、执行更新

  1. git add *
1.1、如果只需要更新单个文件
  1. git add example.txt
1.2、更新文件中包含空格,加引号
  1. git add 'example abc.txt'
 

2、填写变更注释

  1. git commit -m "Enter commit message here--这里写注释"
 

3、推送「push」到仓库中

其中 origin 为仓库起初起的名称,默认 origin 。
  1. git push origin master
3.1、如果提示
  1. To https://github.com/xxx/xxxxx
  2. ! [rejected] master -> master (fetch first)
  3. error: failed to push some refs to 'https://github.com/xxx/xxxx'
  4. hint: Updates were rejected because the remote contains work that you do
  5. hint: not have locally. This is usually caused by another repository pushing
  6. hint: to the same ref. You may want to first integrate the remote changes
  7. hint: (e.g., 'git pull ...') before pushing again.
  8. hint: See the 'Note about fast-forwards' in 'git push --help' for details.
表示线上的版本比本地的新。需要下载「pull」线上的最新版更新到本地。
  1. git pull origin master --allow-unrelated-histories
3.2、如果提示
  1. fatal: AggregateException encountered.
  2. Username for 'https://github.com': xxx
  3. remote: Invalid username or password.
  4. fatal: Authentication failed for 'https://github.com/xxx/xxx/'
表示账号或密码输入错误。  

4、推送「push」项目到线上

  1. git push origin master
  完毕! 参考 http://stackoverflow.com/questions/7028442/how-can-i-upload-committed-changes-to-my-github-repository http://www.tuicool.com/articles/zeaQjav http://www.yiibai.com/git/git_pull.html http://blog.csdn.net/bear_wr/article/details/48950339 https://stackoverflow.com/questions/2936652/git-push-wont-do-anything-everything-up-to-date      

评论 (0)