Skip to content

Commit

Permalink
Reformatted git notes
Browse files Browse the repository at this point in the history
  • Loading branch information
Andres Hermosilla committed Aug 24, 2017
1 parent 6c7cbae commit ede31a5
Showing 1 changed file with 25 additions and 15 deletions.
40 changes: 25 additions & 15 deletions git.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,29 @@
# git

- Files changes in a commit
`git diff-tree --no-commit-id --name-only -r c06d5186ed7`
- Last commit files changes
`git rev-parse HEAD | xargs -I {} git diff-tree --no-commit-id --name-only -r {}`
- Current files
`git status -s | grep php | sed 's/^ *//' | cut -d' ' -f2`
- Pipe to lint quickly
`xargs -I {} php -l {}`
`git rev-parse HEAD | xargs -I {} git diff-tree --no-commit-id --name-only -r {} | xargs -I {} php -l {}`
- Php file changes in a merge
`git log -1 --name-only | grep '.php' | xargs -I{} php -l {}`
- Show files changes between branches
`git diff remotes/origin/master remotes/origin/security-tweak --name-only`
- Git show pending merges
`git show-ref | grep merge | cut -d' ' -f1 | xargs -I{} git show {}`
```bash
# Files changes in a commit
git diff-tree --no-commit-id --name-only -r c06d5186ed7

# Last commit files changes
git rev-parse HEAD | xargs -I {} git diff-tree --no-commit-id --name-only -r {}

# Current files
git status -s | grep php | sed 's/^ *//' | cut -d' ' -f2

# Pipe to lint quickly changes
git rev-parse HEAD | xargs -I {} git diff-tree --no-commit-id --name-only -r {} | xargs -I {} php -l {}

# Php file changes in a merge
git log -1 --name-only | grep '.php' | xargs -I{} php -l {}

# Show files changes between branches
git diff remotes/origin/master remotes/origin/security-tweak --name-only

# Git show pending merges
git show-ref | grep merge | cut -d' ' -f1 | xargs -I{} git show {}

# Bring changes into your branch without commits
git merge --no-commit --squash other_branch
```

- https://github.com/blog/2019-how-to-undo-almost-anything-with-git

0 comments on commit ede31a5

Please sign in to comment.