no changes to deployadded to commit 什么意思

502 Bad Gateway
Error 502源站异常(请求处理超时或者主动断开到牛盾加速节点的连接)如果您是网站管理员,点击查看
您的访问正常牛盾节点正常服务器访问错误7239人阅读
j2ee(14)
好久没用GIT,再次捡起来,遇到了些错误,比如没写comment,导致没提交成功,没有先从远程pull,导致没push成功。
于是将这个过程记录如下:
1:首先,跳转到项目根目录
2:查看当前状态
3:把我们要提交的文件的信息添加到索引库中
4: 提交文件到本地库
5:合并到远程代码库(首先要将远程库,pull到本地,否则不能push)
5.1:没有将远程库pull到本地,报错:
6:pull远程到本地
7:设置 git ignore 过滤文件,.class 后缀文件不提交到远程
8:再次push,成功
具体如下:
1:首先,跳转到项目根目录
$ cd CanYin-www
/e/abc/CanYin-www (master)
LICENSE& README.md& pom.xml& src& target
2:查看当前状态
On branch master
Changes not staged for commit:
& (use &git add &file&...& to update what will be committed)
& (use &git checkout -- &file&...& to discard changes in working directory)
&&&&&&& modified:&& src/main/java/cn/canyin/dao/MenuDao.java
&&&&&&& ...
Untracked files:
& (use &git add &file&...& to include in what will be committed)
&&&&&&& src/main/java/cn/canyin/dao/Dao.java
&&&&&&& ...
no changes added to commit (use &git add& and/or &git commit -a&)
3: 把我们要提交的文件的信息添加到索引库中
/e/abc/CanYin-www (master)
$ git add .
4: 提交文件
/e/abc/CanYin-www (master)
$ git commit -a&& #注意这一步要写comment
[master dfce490] add menu model, changed by jonsanguo at
&27 files changed, 546 insertions(+), 11 deletions(-)
&create mode 100644 src/main/java/cn/canyin/dao/Dao.java
&5:合并到远程代码库(首先要将远程库,pull到本地,否则不能push)
/e/abc/CanYin-www (master)
$ git push
Username for '': guojiangshan
Password for '':
Counting objects: 81, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (45/45), done.
Writing objects: 100% (49/49), 8.40 KiB | 0 bytes/s, done.
Total 49 (delta 16), reused 0 (delta 0)
&& 66640ab..dfce490& master -& master
5.1:没有将远程库pull到本地,报错:
$ git push
Username for '': guojiangshan
Password for '':
&! [rejected]&&&&&&& master -& master (fetch first)
error: failed to push some refs to '/guojiangshan/canyin'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
6:pull远程到本地
$ git pull
warning: no common commits
remote: Counting objects: 5, done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 5 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (5/5), done.
&* branch&&&&&&&&&&& master&&&& -& FETCH_HEAD
Merge made by the 'recursive' strategy.
&.gitignore |& 11 ++
&LICENSE&&& | 339 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
&README.md& |&& 4 +
&3 files changed, 354 insertions(+)
&create mode 100644 .gitignore
&create mode 100644 LICENSE
&create mode 100644 README.md
7:设置 git ignore 过滤文件,.class 后缀文件不提交到远程
$ echo *.class&.gitignore
查看设置是否成功:
$ cat .gitignore
8:再次push,成功
$ git push
Username for '': guojiangshan
Password for '':
Counting objects: 116, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (102/102), done.
Writing objects: 100% (115/115), 58.02 KiB | 0 bytes/s, done.
Total 115 (delta 6), reused 0 (delta 0)
&& f7ddeea..5fd03b6& master -& master
参考知识库
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:189808次
积分:3043
积分:3043
排名:第7598名
原创:97篇
转载:31篇
评论:39条
(1)(4)(1)(2)(12)(4)(3)(3)(1)(2)(1)(1)(2)(1)(2)(1)(1)(9)(8)(1)(4)(5)(4)(4)(6)(9)(4)(1)(2)(1)(1)(1)(1)(2)(7)(5)(4)(9)(6)(1)(2)(1)(1)用rm命令误删了一个文件,git add后不能恢复咋办?速求!!!_百度知道
用rm命令误删了一个文件,git add后不能恢复咋办?速求!!!
git status# On branch master# Changes not staged for commit:#
(use &git add/rm &file&...& to update what will be committed)#
(use &git checkout -- &file&...& to discard c珐贰粹荷诔沽达泰惮骏hanges in working directory)##
releasetools.py#no changes added to commit (use &git add& and/or &git commit -a&)
git add后是下面这样子git add releasetools.py[android @sw]$ git status# On branch master# Changes not staged for commit:#
(use &git add/rm &file&...& to update what will be committed)#
(use &git checkout -- &file&...& to discard changes in working directory)##
releasetools.py#no cha珐贰粹荷诔沽达泰惮骏nges added to commit (use &git add& and/or &git commit -a&)
提问者采纳
执行这句 git checkout releasetools.py
提问者评价
其实早解决了,不过还是谢谢你
其他类似问题
为您推荐:
git的相关知识
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁

我要回帖

更多关于 no added sugar 的文章

 

随机推荐