Git 吉特;本地更改已签入索引但未提交”;

Git 吉特;本地更改已签入索引但未提交”;,git,rollback,undo,Git,Rollback,Undo,我在家里的桌面上编辑文件,推到bitbucket.org,并上传到我的测试网站。 然后我从bitbucket.org下载到我的笔记本电脑上。 它告诉我我需要合并文件,但我不知道如何合并,所以我将测试网站上的文件复制到笔记本电脑本地目录中,继续我的工作。 我想我是mutt领导了合并过程,并使用gitg进行了更改(不确定是否提交) 当我试图从笔记本电脑推到bitbucket.org时,我的问题和无知变得更加明显: kurt@tosh ~/Public/laddercms $ git status

我在家里的桌面上编辑文件,推到bitbucket.org,并上传到我的测试网站。 然后我从bitbucket.org下载到我的笔记本电脑上。 它告诉我我需要合并文件,但我不知道如何合并,所以我将测试网站上的文件复制到笔记本电脑本地目录中,继续我的工作。 我想我是mutt领导了合并过程,并使用gitg进行了更改(不确定是否提交)

当我试图从笔记本电脑推到bitbucket.org时,我的问题和无知变得更加明显:

kurt@tosh ~/Public/laddercms $ git status

On branch NumPermit
Your branch is ahead of 'origin/NumPermit' by 2 commits.

nothing to commit (working directory clean)

kurt@tosh ~/Public/laddercms $ git push -u origin NumPermit 

Password
for 'https--kurtjensen@bitbucket.org':  To
https--kurtjensen@bitbucket.org/kurtjensen/laddercms.git  !

[rejected]        NumPermit -> NumPermit (non-fast-forward) error:
failed to push some refs to 'https--kurtjensen@bitbucket.org/kurtjensen/laddercms.git' 
hint: its remote counterpart. Merge the remote changes (e.g. 'git
pull') hint: before pushing again. hint: See the 'Note about
fast-forwards' in 'git push --help' for details.

kurt@tosh ~/Public/laddercms $ git pull origin NumPermit 

Password for
'https--kurtjensen@bitbucket.org':  From
https--bitbucket.org/kurtjensen/laddercms  * branch           

NumPermit  -> FETCH_HEAD Auto-merging profile/ajax/ProfileForm.php

CONFLICT (content): Merge conflict in profile/ajax/ProfileForm.php
Auto-merging Core/protect.php 

CONFLICT (content): Merge conflict in Core/protect.php Auto-merging 
Core/class.credentials.php 

CONFLICT (content): Merge conflict in Core/class.credentials.php 
Auto-merging Core/class.access.php 

CONFLICT (content): Merge conflict in Core/class.access.php Automatic
merge failed; fix conflicts and then commit the result.
我本地的笔记本电脑文件是我想要保存的(我最相信它们是正确的)

现在在gitk我看到:

作者:提交人:家长: 9D2CD77D425BBF71EE367021ACF65E2C2465D0DF(新的Protect.php正在工作 据我所知,即使是与NLIKey)的孩子: 0000000000000000000000000000000000(本地未提交的更改, 未签入索引)分支:如下:前置:

Local changes checked in to index but not committed
如何将(台式机、笔记本电脑、bitbucket)上的世界恢复到此“提交/签入”点

先谢谢你


引用:“展览是我的专长。”

一些信息可以帮你下次省去麻烦:

它告诉我我需要合并文件,但我不知道如何合并,所以我将测试网站上的文件复制到笔记本电脑本地目录,继续我的工作

当您从桌面推到bitbucket时,您应该在笔记本电脑上执行以下操作:

git fetch origin
git checkout master
git merge origin/master
fetch检索远程分支上最近的所有更改,签出将您放在任何要合并到的本地分支(本例中为master)中,merge命令表示将origin/master中的任何内容合并到本地分支master中。这是一个非常基本的工作流程,在同一个项目上工作2个ppl就可以了

无论如何,为了在不保留历史记录的情况下快速恢复,我只需删除
.git
文件夹,然后在根文件夹中运行
git init
git remote add
git add.
+
git push alias master-f
。要获得更智能的恢复方式,您需要提供有关git状态的更多信息,并稍微整理一下您的帖子。

请修复“换行符”,很难读取git命令的输出。