1
0
mirror of https://github.com/namibia/tips.git synced 2024-05-30 17:01:11 +00:00

Merge pull request #22 from samarpanda/worktree

Git Worktree!
This commit is contained in:
hemanth.hm 2015-08-02 16:17:39 +05:30
commit 5566a52dc4
2 changed files with 40 additions and 0 deletions

View File

@ -19,6 +19,8 @@
* [Delete local branch](https://github.com/git-tips/tips#delete-local-branch)
* [Delete remote branch](https://github.com/git-tips/tips#delete-remote-branch)
* [Undo local changes with the last content in head](https://github.com/git-tips/tips#undo-local-changes-with-the-last-content-in-head)
* [Revert: Undo a commit by creating a new commit](https://github.com/git-tips/tips#revert-undo-a-commit-by-creating-a-new-commit)
* [Resert: Discard commits, advised for private branch](https://github.com/git-tips/tips#resert-discard-commits-advised-for-private-branch)
* [Reword the previous commit message](https://github.com/git-tips/tips#reword-the-previous-commit-message)
* [Changing a remote's URL](https://github.com/git-tips/tips#changing-a-remotes-url)
* [Get list of all remote references](https://github.com/git-tips/tips#get-list-of-all-remote-references)
@ -39,6 +41,8 @@
* [Show all tracked files](https://github.com/git-tips/tips#show-all-tracked-files)
* [Show all untracked files](https://github.com/git-tips/tips#show-all-untracked-files)
* [Show all ignored files](https://github.com/git-tips/tips#show-all-ignored-files)
* [Create new working tree from a repository (git 2.5)](https://github.com/git-tips/tips#create-new-working-tree-from-a-repository-git-25)
* [Create new working tree from HEAD state](https://github.com/git-tips/tips#create-new-working-tree-from-head-state)
<!-- Dont remove or change the comment below that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
<!-- @doxie.inject end toc -->
@ -132,6 +136,16 @@ git push origin :<remote_branchname>
git checkout -- <file_name>
```
## Revert: Undo a commit by creating a new commit
```sh
git revert <commit-ish>
```
## Resert: Discard commits, advised for private branch
```sh
git reset <commit-ish>
```
## Reword the previous commit message
```sh
git commit -v --amend
@ -257,5 +271,15 @@ git ls-files --others
git ls-files --others -i --exclude-standard
```
## Create new working tree from a repository (git 2.5)
```sh
git worktree add -b <branch-name> <path> <start-point>
```
## Create new working tree from HEAD state
```sh
git worktree add --detach <path> HEAD
```
<!-- Dont remove or change the comment below that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
<!-- @doxie.inject end -->

View File

@ -64,6 +64,14 @@
"title": "Undo local changes with the last content in head",
"tip": "git checkout -- <file_name>"
},
{
"title":"Revert: Undo a commit by creating a new commit",
"tip":"git revert <commit-ish>"
},
{
"title":"Resert: Discard commits, advised for private branch",
"tip":"git reset <commit-ish>"
},
{
"title": "Reword the previous commit message",
"tip": "git commit -v --amend"
@ -147,5 +155,13 @@
{
"title": "Show all ignored files",
"tip": "git ls-files --others -i --exclude-standard"
},
{
"title": "Create new working tree from a repository (git 2.5)",
"tip":"git worktree add -b <branch-name> <path> <start-point>"
},
{
"title": "Create new working tree from HEAD state",
"tip": "git worktree add --detach <path> HEAD"
}
]