git rebase 后找回消失的commit
来源:互联网 发布:debian 8 切换php版本 编辑:程序博客网 时间:2024/05/17 04:05
git rebase 后找回消失的commit
在git rebase操作时,存在冲突时,使用git rebase --abort
处理后,结果发现commit的修改和记录都没有了。(使用git rebase --skip
处理,也有导致commit消失不见得情况),就是使用git log
看不到。
并不是真的在git中完全消失了。
这是可以使用reflog命令列出log 信息。
reflog : reference logs
$ git reflog d185b35 HEAD@{0}: rebase finished: returning to refs/heads/passportd185b35 HEAD@{1}: rebase: checkout origin/passport4ab8e52 HEAD@{2}: checkout: moving from passport_email to passportd185b35 HEAD@{3}: checkout: moving from passport to passport_email4ab8e52 HEAD@{4}: checkout: moving from passprot_bak to passportd185b35 HEAD@{5}: checkout: moving from passport to passprot_bak4ab8e52 HEAD@{6}: checkout: moving from passprot_bak to passportd185b35 HEAD@{7}: commit: 添加邮件发送处理操作............
这里显示了commit 的sha, version, message,找到你消失的commit,然后可以使用这个‘消失的’commit重新建立一个branch.
$git checkout -b branch-bak [commit-sha]
然后可以出来冲突,再git add
, git commit
, git push
等操作,把修改提交。
最后,看看git help
NAME git-reflog - Manage reflog informationSYNOPSIS git reflog <subcommand> <options>DESCRIPTION The command takes various subcommands, and different options depending on the subcommand: git reflog [show] [log-options] [<ref>] git reflog expire [--expire=<time>] [--expire-unreachable=<time>] [--rewrite] [--updateref] [--stale-fix] [--dry-run] [--verbose] [--all | <refs>...] git reflog delete [--rewrite] [--updateref] [--dry-run] [--verbose] ref@{specifier}... Reference logs, or "reflogs", record when the tips of branches and other references were updated in the local repository. Reflogs are useful in various Git commands, to specify the old value of a reference. For example, HEAD@{2} means "where HEAD used to be two moves ago", master@{one.week.ago} means "where master used to point to one week ago in this local repository", and so on. See gitrevisions(7) for more details. This command manages the information recorded in the reflogs. The "show" subcommand (which is also the default, in the absence of any subcommands) shows the log of the reference provided in the command-line (or HEAD, by default). The reflog covers all recent actions, and in addition the HEAD reflog records branch switching. git reflog show is an alias for git log -g --abbrev-commit --pretty=oneline; see git-log(1) for more information. The "expire" subcommand prunes older reflog entries. Entries older than expire time, or entries older than expire-unreachable time and not reachable from the current tip, are removed from the reflog. This is typically not used directly by end users -- instead, see git-gc(1). The "delete" subcommand deletes single entries from the reflog. Its argument must be an exact entry (e.g. "git reflog delete master@{2}"). This subcommand is also typically not used directly by end users.OPTIONS Options for show git reflog show accepts any of the options accepted by git log. Options for expire --all Process the reflogs of all references. --expire=<time> Prune entries older than the specified time. If this option is not specified, the expiration time is taken from the configuration setting gc.reflogExpire, which in turn defaults to 90 days. --expire=all prunes entries regardless of their age; --expire=never turns off pruning of reachable entries (but see --expire-unreachable). --expire-unreachable=<time> Prune entries older than <time> that are not reachable from the current tip of the branch. If this option is not specified, the expiration time is taken from the configuration setting gc.reflogExpireUnreachable, which in turn defaults to 30 days. --expire-unreachable=all prunes unreachable entries regardless of their age; --expire-unreachable=never turns off early pruning of unreachable entries (but see --expire). --updateref Update the reference to the value of the top reflog entry (i.e. <ref>@{0}) if the previous top entry was pruned. (This option is ignored for symbolic references.) …………
1 0
- git rebase 后找回消失的commit
- git rebase后commit丢失
- git rebase后commit丢失
- git rebase后丢失本地commit记录
- git 找回丢失的对象 找回commit
- git 找回丢失的commit
- git 找回丢失的commit
- git合并多个commit的方法: git rebase -i
- git找回commit
- git commit/git commit --amend/git commmit rebase, reset
- git rebase -i 重新提交多个commit之前的commit
- git fetch 后, git merge 和 git rebase的区别
- git中各个commit节点的查询 回溯 与 合并:git rebase与git reset
- 通过git cherry-pick找回丢失的commit
- Git ---游离状态下的commit 分支切换与找回
- 找回git reset中只 add,未commit的内容
- 回滚到历史版本后,找回未push的commit
- git rebase之前需要commit才行
- memcached—协议
- 自定义ImageView实现地图(一)
- HDU 1568 Fibonacci【数学】
- hdoj1049
- Android RecyclerView的使用
- git rebase 后找回消失的commit
- <LeetCode OJ> 328. Odd Even Linked List
- 关于Android Studio如何导入library project
- ♥Vijos 1242-邮局问题【经典DP】
- UIWebView的前进和后退功能
- 人工智能-搜索算法
- 数据标准化
- 排序问题
- hdu 1009