Tag: git rebase

从git恢复特定的提交

我有一个很多提交和大量文件的git树。 现在,我想恢复只接触文件的特定提交。 解释: psankar@linux-9dni:~/specific> git init Initialized empty Git repository in /home/psankar/specific/.git/ psankar@linux-9dni:~/specific> echo "File a" > a psankar@linux-9dni:~/specific> git add a ; git commit -m "File a" [master (root-commit) 5267c21] File a 1 file changed, 1 insertion(+) create mode 100644 a psankar@linux-9dni:~/specific> echo "File b" > b psankar@linux-9dni:~/specific> git add b; git commit -m […]

删除/修改冲突后,Git rebase将不会继续

我正在把我的主人转到舞台分支 git checkout stage git rebase master 有时我删除了两个文件,然后根据GIT修改了这两个文件。 warning: too many files, skipping inexact rename detection CONFLICT (delete/modify): test-recommendation-result.php deleted in HEAD and modified in [Bug] Fix test recommender. Version [Bug] Fix test recommender of test-recommendation-result.php left in tree. CONFLICT (delete/modify): test-recommendation.php deleted in HEAD and modified in [Bug] Fix test recommender. Version [Bug] Fix […]

git rebase合并冲突

我分叉github回购,并在我的github回购工作。 我已经提出了要求,并已完成。 之后,上游有更多的承诺,所以现在我想rebase,我想这就是我必须做的。 但是我得到这些合并冲突: First, rewinding head to replay your work on top of it… Applying: Issue 135 homepage refresh Using index info to reconstruct a base tree… <stdin>:17: trailing whitespace. %h4 warning: 1 line adds whitespace errors. Falling back to patching base and 3-way merge… Auto-merging app/views/layouts/application.html.haml CONFLICT (content): Merge conflict in app/views/layouts/application.html.haml Auto-merging […]

正在重build。 无法提交。 如何进行或停止(中止)?

当我运行: git status 我看到这个: rebase in progress; onto 9c168a5 You are currently rebasing branch 'master' on '9c168a5'. (all conflicts fixed: run "git rebase –continue") nothing to commit, working directory clean 当我做: ls `git rev-parse –git-dir` | grep rebase || echo no rebase 我看到:rebase-apply 我不能承诺起源。 git branch 显示: * (no branch, rebasing master) develop master 我卡住了。 […]

git-subtree添加后如何rebase?

我试图学习Git 1.7.11中添加的新的git-subtree命令。 我添加一个子树后,似乎失去了rebase的能力。 我有与自述文件和库存储库,也有自述文件的主要存储库。 我将它添加到subtree add lib目录: $ git subtree add -P lib/mylib myliborigin master 这工作正常,但现在的历史看起来像这样: * 22c1fe6 (HEAD, master) Merge commit 'b6e698d9f4985825efa06dfdd7bba8d2930cd40e' as 'lib/mylib' – |\ | * b6e698d Squashed 'lib/mylib/' content from commit d7dbd3d * b99d55b Add readme * 020e372 Initial 现在,当我想重新对我的repo对origin/master ,它失败,因为南瓜提交是直接应用于其父提交不适用,因为它是应用于回购的根,而不是我给它的前缀添加子树时。 这样做的原因很明显,如果我看看南瓜的承诺。 没有关于前缀的信息。 这只是原来的mylib承诺压在一起。 只有下一个合并提交知道它的任何事情,但是rebase并没有把它记在这里。 是否有任何解决方法(除了从不分配subtree提交)?

我需要在主分支中popup并清除“中间”提交。 我该怎么做?

例如,在下面的master分支中,我只需要提交af5c7bf16e6f04321f966b4231371b21475bc4da,这是由于之前的rebase而导致的第二个: commit 60b413512e616997c8b929012cf9ca56bf5c9113 Author: Luca G. Soave <luca.soave@gmail.com> Date: Tue Apr 12 23:50:15 2011 +0200 add generic config/initializers/omniauth.example.rb commit af5c7bf16e6f04321f966b4231371b21475bc4da Author: Luca G. Soave <luca.soave@gmail.com> Date: Fri Apr 22 00:15:50 2011 +0200 show github user info if logged commit e6523efada4d75084e81971c4dc2aec621d45530 Author: Luca G. Soave <luca.soave@gmail.com> Date: Fri Apr 22 17:20:48 2011 +0200 add multiple .container […]

如何在不需要强制推送的情况下使用git rebase?

为了实现git涅</s>,我花了一天的时间学习如何在我现在合并的情况下利用rebase。 当运行我认为是git 101stream(我在下面详细说明)时,我必须在将更改推回到原点时push –force执行。 我不是唯一一个 – 我知道这是被掩盖的(见1,2,3,4,5 ),我也明白为什么一支部队是必要的技术原因。 我的问题是这样的 – 有很多(许多)博客文章赞美rebase以及它是如何改变他们的生活的(见1,2,3,4列出的),但没有一个提到push –force是他们stream动的一部分。 然而,对于现有的stackoverflow问题,几乎所有的答案都是这样的:“是啊,如果你要重新定位,你必须使用push –force ”。 考虑到亚特兰蒂斯倡导者的数量和宗教性, 我必须相信,使用“推力”并不是亚基stream动的固有组成部分,而且如果经常要迫使他们推动,他们就会做错事 。 push –force是一件坏事 。 所以这是我的stream程。 我怎样才能在没有武力的情况下取得同样的结果? 简单的例子 两个分支: v1.0 – 发行版分支,只包含补丁 掌握 – 下一个主要版本的一切。 我有几个补丁提交和下一个版本的一些提交。 我想将这些补丁合并到我的主文件中,以便在下一个版本中不会丢失。 启蒙之前我只是简单地说: git checkout master git merge v1.0 但现在我正在尝试 git checkout master git rebase v1.0 所以现在我在这里: 的时间: git push 没有骰子。

更改时间戳,同时重新设置git分支

在将要公开之前,我重组了一个分支中的提交,导致提交的时间戳混在一起。 我宁愿让他们都成为今天,只有两秒之间。 显然,这些时间戳也不会是正确的,但是由于这是公开事件的时间,所以我更喜欢在时间上混合起来的历史。 那么如何让git在重新绑定时创build新的时间戳呢?

Git rebase合并冲突无法继续

我正在尝试重新设定'dev'以赶上'master'分支。 $ git checkout dev $ git rebase master First, rewinding head to replay your work on top of it… Applying: Corrected compilation problems that came from conversion from SVN. Using index info to reconstruct a base tree… M src/com/…. <stdin>:125: trailing whitespace. /** <stdin>:126: trailing whitespace. * <stdin>:127: trailing whitespace. */ <stdin>:128: trailing whitespace. […]

之前的git合并之后的git rebase

我有以下情况: 我从一个主存储库(X)创build了一个clone (Y),因为有很多人在Y上工作,我们没有做任何rebase但是只merge s。 当我们想把( push )Y给X时,我们想要做一个rebase ,以便让事情变得漂亮和干净 问题是,在进行rebase我们被要求做前面merge步骤中所做的所有merge 。 有没有解决这个问题,除了那个意味着实际上重新合并? 我认为这是相当直接的,因为我们已经解决了冲突的合并。