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

Edit files #15

Closed
wants to merge 2 commits into from
Closed
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
11 changes: 10 additions & 1 deletion gitalias.txt
Original file line number Diff line number Diff line change
Expand Up @@ -478,9 +478,18 @@
unadd = reset HEAD
unstage = reset HEAD

# Edit all files of given type(s)
edit-files = !"f() { git ls-files \"$@\" | sort -u ; }; \"${VISUAL:-${EDITOR:-vi}}\" `f \"$@\"`"
edit-cached = !"f() { git edit-files --cached; }; f"
edit-deleted = !"f() { git edit-files --deleted; }; f"
edit-others = !"f() { git edit-files --others; }; f"
edit-ignored = !"f() { git edit-files --ignored; }; f"
edit-killed = !"f() { git edit-files --killed; }; f"
edit-modified = !"f() { git edit-files --modified; }; f"

# Editing and adding conflicted files: when we get many merge conflicts
# and want to quickly solve them using an editor, then add the files.
edit-unmerged = !"f() { git ls-files --unmerged | cut -f2 | sort -u ; }; $EDITOR `f`"
edit-unmerged = !"f() { git ls-files --unmerged | cut -f2 | sort -u ; }; "${VISUAL:-${EDITOR:-vi}}" `f`"
add-unmerged = !"f() { git ls-files --unmerged | cut -f2 | sort -u ; }; git add `f`"

# Ours & Theirs - easy merging when you know which files you want
Expand Down