Merge pull request #21 from ejmr/tips-from-my-personal-aliases

Three tips adapted from personal aliases which I use
This commit is contained in:
hemanth.hm 2015-07-30 05:48:07 +05:30
commit 328e594513
2 changed files with 30 additions and 0 deletions

View File

@ -19,6 +19,7 @@
* [Delete local branch](https://github.com/git-tips/tips#delete-local-branch) * [Delete local branch](https://github.com/git-tips/tips#delete-local-branch)
* [Delete remote branch](https://github.com/git-tips/tips#delete-remote-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) * [Undo local changes with the last content in head](https://github.com/git-tips/tips#undo-local-changes-with-the-last-content-in-head)
* [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) * [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) * [Get list of all remote references](https://github.com/git-tips/tips#get-list-of-all-remote-references)
* [Get list of all local and remote branches](https://github.com/git-tips/tips#get-list-of-all-local-and-remote-branches) * [Get list of all local and remote branches](https://github.com/git-tips/tips#get-list-of-all-local-and-remote-branches)
@ -26,6 +27,7 @@
* [Stage parts of a changed file, instead of the entire file](https://github.com/git-tips/tips#stage-parts-of-a-changed-file-instead-of-the-entire-file) * [Stage parts of a changed file, instead of the entire file](https://github.com/git-tips/tips#stage-parts-of-a-changed-file-instead-of-the-entire-file)
* [Get git bash completion](https://github.com/git-tips/tips#get-git-bash-completion) * [Get git bash completion](https://github.com/git-tips/tips#get-git-bash-completion)
* [What changed since two weeks?](https://github.com/git-tips/tips#what-changed-since-two-weeks) * [What changed since two weeks?](https://github.com/git-tips/tips#what-changed-since-two-weeks)
* [See all commits made since forking from master](https://github.com/git-tips/tips#see-all-commits-made-since-forking-from-master)
* [Pick commits across branches using cherry-pick](https://github.com/git-tips/tips#pick-commits-across-branches-using-cherry-pick) * [Pick commits across branches using cherry-pick](https://github.com/git-tips/tips#pick-commits-across-branches-using-cherry-pick)
* [Find out branches containing commit-hash](https://github.com/git-tips/tips#find-out-branches-containing-commit-hash) * [Find out branches containing commit-hash](https://github.com/git-tips/tips#find-out-branches-containing-commit-hash)
* [Git Aliases](https://github.com/git-tips/tips#git-aliases) * [Git Aliases](https://github.com/git-tips/tips#git-aliases)
@ -36,6 +38,7 @@
* [Delete all stored stashes](https://github.com/git-tips/tips#delete-all-stored-stashes) * [Delete all stored stashes](https://github.com/git-tips/tips#delete-all-stored-stashes)
* [Show all tracked files](https://github.com/git-tips/tips#show-all-tracked-files) * [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 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)
<!-- Dont remove or change the comment below that can break automatic updates. More info at <http://npm.im/doxie.inject>. --> <!-- Dont remove or change the comment below that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
<!-- @doxie.inject end toc --> <!-- @doxie.inject end toc -->
@ -129,6 +132,11 @@ git push origin :<remote_branchname>
git checkout -- <file_name> git checkout -- <file_name>
``` ```
## Reword the previous commit message
```sh
git commit -v --amend
```
## Changing a remote's URL ## Changing a remote's URL
```sh ```sh
git remote set-url origin <URL> git remote set-url origin <URL>
@ -170,6 +178,11 @@ curl http://git.io/vfhol > ~/.git-completion.bash && echo '[ -f ~/.git-completio
git whatchanged --since='2 weeks ago' git whatchanged --since='2 weeks ago'
``` ```
## See all commits made since forking from master
```sh
git log --no-merges --stat --reverse master..
```
## Pick commits across branches using cherry-pick ## Pick commits across branches using cherry-pick
```sh ```sh
git checkout <branch-name> && cherry-pick <commit-ish> git checkout <branch-name> && cherry-pick <commit-ish>
@ -239,5 +252,10 @@ git ls-files -t
git ls-files --others git ls-files --others
``` ```
## Show all ignored files
```sh
git ls-files --others -i --exclude-standard
```
<!-- Dont remove or change the comment below that can break automatic updates. More info at <http://npm.im/doxie.inject>. --> <!-- Dont remove or change the comment below that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
<!-- @doxie.inject end --> <!-- @doxie.inject end -->

View File

@ -64,6 +64,10 @@
"title": "Undo local changes with the last content in head", "title": "Undo local changes with the last content in head",
"tip": "git checkout -- <file_name>" "tip": "git checkout -- <file_name>"
}, },
{
"title": "Reword the previous commit message",
"tip": "git commit -v --amend"
},
{ {
"title": "Changing a remote's URL", "title": "Changing a remote's URL",
"tip": "git remote set-url origin <URL>" "tip": "git remote set-url origin <URL>"
@ -93,6 +97,10 @@
"title": "What changed since two weeks?", "title": "What changed since two weeks?",
"tip": "git whatchanged --since='2 weeks ago'" "tip": "git whatchanged --since='2 weeks ago'"
}, },
{
"title": "See all commits made since forking from master",
"tip": "git log --no-merges --stat --reverse master.."
},
{ {
"title": "Pick commits across branches using cherry-pick", "title": "Pick commits across branches using cherry-pick",
"tip": "git checkout <branch-name> && cherry-pick <commit-ish>" "tip": "git checkout <branch-name> && cherry-pick <commit-ish>"
@ -135,5 +143,9 @@
{ {
"title":"Show all untracked files", "title":"Show all untracked files",
"tip":"git ls-files --others" "tip":"git ls-files --others"
},
{
"title": "Show all ignored files",
"tip": "git ls-files --others -i --exclude-standard"
} }
] ]