[关闭]
@wuxin1994 2017-10-23T13:16:57.000000Z 字数 798 阅读 758

搭建博客时候问题

Linux


错误1

  1. $ git commit -m "first commit"
  2. On branch master
  3. Untracked files:
  4. .gitignore
  5. _config.yml
  6. git
  7. git.pub
  8. package-lock.json
  9. package.json
  10. scaffolds/
  11. source/
  12. themes/
  13. nothing added to commit but untracked files present

这个错误原因有两个:
1. 已经存在的项目?
2. 没有把需要提交的文件加载进来,所以需要用

  1. git add (文件名)

错误2

  1. fatal: remote origin already exists.

用到的解决办法:
1. 删除远程仓库,再添加远程仓库

  1. $git remote rm origin
  2. $git remote add origin git@github.com:wufans/wufans.github.io.git
  1. 修改git的config文件的内容。
  1. $vi .git/config

删除[remote "origin"]

错误3

  1. To github.com:wufans/wufans.github.io.git
  2. ! [rejected] master -> master (non-fast-forward)
  3. 'git@github.com:wufans/wufans.github.io.git'
  4. hint: Updates were rejected because the tip of your current branch is behind
  5. hint: its remote counterpart. Integrate the remote changes (e.g.
  6. hint: 'git pull ...') before pushing again.

这个方法就是因为本地仓库和github上面仓库的内容有冲突导致的
我用的解决办法是删除了原来的repository,重新建立了一个仓库,问题解决。

添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注