git 和我闹脾气 ,知道是为什么吗?

念茜 2011-05-19 12:40:04


前几天在提交的时候,遇到上图的问题,我纳闷很久,怎么了这是,死活add 不上。

叫来同事两下就解决了…… 你有遇到过没?
...全文
141 12 打赏 收藏 转发到动态 举报
写回复
用AI写文章
12 条回复
切换为时间正序
请发表友善的回复…
发表回复
zhj61808613 2011-05-30
  • 打赏
  • 举报
回复
你已经add了,下一步需要git commit,
天煞19 2011-05-28
  • 打赏
  • 举报
回复
zan mei yu dao
法尔我给他 2011-05-19
  • 打赏
  • 举报
回复
这个是我查到的一个文档,不知道有没有帮助:
There are a number of situations in Git where you may want to undo or revert a change that you made. Perhaps you staged a file and then decided that you didn’t want it staged, or you edited a file and then wanted to ‘un-edit’ it. This section will explore a couple of ways you can undo or revert actions in Git.

unstaging files

Here we’ve staged changes to both our REAME and simplegit.rb files, but then we decide that we want the changes to be two seperate commits. So, we need to unstage one, do a commit, then stage it again and do our second commit. Luckily, Git reminds you how to do this right in the ‘git status’ command output.

$ git status
# On branch nolimit
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# modified: README
# modified: lib/simplegit.rb
#
If you ever forget how to unstage a file, just run the ‘git status’ command to remind yourself with the (use “git reset HEAD (file)…” to unstage) text. So lets use that to unstage the README file.

$ git reset HEAD README
README: locally modified
Now if we run the ‘status’ command again, we can see that the README file is no longer staged.

$ git status
# On branch nolimit
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# modified: lib/simplegit.rb
#
# Changed but not updated:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: README
#
If you want an easier way of remembering this, you can add an ‘unstage’ alias in your Git config file.

$ git config --global alias.unstage 'reset HEAD'
Then you can just run:

$ git unstage README
A bit nicer, yes?
easycoola 2011-05-19
  • 打赏
  • 举报
回复
好像是head的问题
BaoShiqiang 2011-05-19
  • 打赏
  • 举报
回复
没遇到过 多散分 攒点人品试试
changy 2011-05-19
  • 打赏
  • 举报
回复
没遇到过
BaoShiqiang 2011-05-19
  • 打赏
  • 举报
回复
[Quote=引用 8 楼 yiyaaixuexi 的回复:]
引用 4 楼 wwwcs59 的回复:
这个是我查到的一个文档,不知道有没有帮助:

呵呵 这个问题发帖的时候就解决了 我只是贴出来讨论下 谢谢[/Quote]

解决方案是什么?
念茜 2011-05-19
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 easycoola 的回复:]
好像是head的问题
[/Quote]


head无问题哦
念茜 2011-05-19
  • 打赏
  • 举报
回复
[Quote=引用 4 楼 wwwcs59 的回复:]
这个是我查到的一个文档,不知道有没有帮助:
There are a number of situations in Git where you may want to undo or revert a change that you made. Perhaps you staged a file and then decided that you didn’t want it staged, o……
[/Quote]

呵呵 这个问题发帖的时候就解决了 我只是贴出来讨论下 谢谢
念茜 2011-05-19
  • 打赏
  • 举报
回复
[Quote=引用 6 楼 hxdanya 的回复:]
好像是你修改的Camera.java这个文件在server上有别的用户也修改过了,并且已经提交了。估计你先打个patch,然后git reset一下,同步之后应该就可以提交。
[/Quote]


没有人修改,只有我。
hxdanya 2011-05-19
  • 打赏
  • 举报
回复
好像是你修改的Camera.java这个文件在server上有别的用户也修改过了,并且已经提交了。估计你先打个patch,然后git reset一下,同步之后应该就可以提交。

80,351

社区成员

发帖
与我相关
我的任务
社区描述
移动平台 Android
androidandroid-studioandroidx 技术论坛(原bbs)
社区管理员
  • Android
  • yechaoa
  • 失落夏天
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧