配置GitHub过程中遇到的问题

1

/d/Androi dProj ects/JCamera2Demo (master)  JasonWu@DESKTOP-JASONWU MINGW64  $ git push origin master  fatal: 'origin' does not appear to be a git repository  fatal: Could not read from remote repository.  Please make sure you have the correct access rights  and the repository exists.

 

.git文件夹下的config文件没有注明origin master的远程地址,使用如下命令即可解决:

git remote add origin https://github.com/hfutwj/Camera2Demo.git

 

 

 

 

2

/d/Androi dProj ects/JCamera2Demo (master)  JasonWu@DESKTOP-JASONWU MINGW64  $ git push —u origin master  To https://gi Chub.com/hfutwj/Camera2Demo.git  ! C rejected]  master —> master (fetch fi rst)  error  hint:  hint:  hint:  hint:  hint:  : failed to push some refs to 'https://github.com/hfutwj/Camera2Demo.git'  Updates were rej ected because the remote contains work that you do  not have locally. This is usually caused by another repository pushing  to the same ref. You may want to fi rst integrate the remote changes  (e.g., 'g it pull  . ' ) before pushing again.  See the 'Note about fast—forwards' in ' git push  —help' for details.

本地仓的文件不全,需要先同步,可以参考https://jingyan.baidu.com/article/f3e34a12a25bc8f5ea65354a.html

先输入如下命令合并本地和远程仓:

git pull --rebase origin master

<wiz_tmp_tag id="wiz-table-range-border" contenteditable="false" style="display: none;">





posted @ 2018-04-15 22:55  LeoJason  阅读(126)  评论(0编辑  收藏  举报