Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tip to recover lost commit #32

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
* [Import from a bundle](https://github.com/git-tips/tips#import-from-a-bundle)
* [Get the name of current branch.](https://github.com/git-tips/tips#get-the-name-of-current-branch)
* [Ignore one file on commit (e.g. Changelog).](https://github.com/git-tips/tips#ignore-one-file-on-commit-eg-changelog)
* [Visualize each position of HEAD in the last 30 days](https://github.com/git-tips/tips#visualize-each-position-of-head-in-the-last-30-days)

<!-- Don’t remove or change the comment below – that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
<!-- @doxie.inject end toc -->
Expand Down Expand Up @@ -366,7 +367,7 @@ __Alternatives:__
git branch -m [<old-branch-name>] <new-branch-name>
```

## rebases 'feature' to 'master' and merges it in to master
## rebases 'feature' to 'master' and merges it in to master
```sh
git checkout feature && git rebase @{-1} && git checkout @{-2} && git merge @{-1}
```
Expand Down Expand Up @@ -443,5 +444,10 @@ git rev-parse --abbrev-ref HEAD
git update-index --assume-unchanged Changelog; git commit -a; git update-index --no-assume-unchanged Changelog
```

## Visualize each position of HEAD in the last 30 days
```sh
git reflog
```

<!-- Don’t remove or change the comment below – that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
<!-- @doxie.inject end -->
4 changes: 4 additions & 0 deletions tips.json
Original file line number Diff line number Diff line change
Expand Up @@ -251,5 +251,9 @@
{
"title": "Ignore one file on commit (e.g. Changelog).",
"tip": "git update-index --assume-unchanged Changelog; git commit -a; git update-index --no-assume-unchanged Changelog"
},
{
"title": "Visualize each position of HEAD in the last 30 days",
"tip": "git reflog"
}
]