mirror of
https://github.com/denisidoro/navi
synced 2024-11-24 20:43:06 +00:00
Merge pull request #180 from enisozgen/multi-git-add-function
Hello this PR supports multiple selection for files in `git diff` and `git add` In my tests `cd` didn't create problem. Please think about can it create problem. Best Regards,
This commit is contained in:
commit
68651bb1c8
2 changed files with 15 additions and 8 deletions
|
@ -31,12 +31,14 @@ git checkout <branch>
|
|||
git status
|
||||
|
||||
# Displays unstaged changes for file
|
||||
git diff <toplevel_directory>/<unstaged_files>
|
||||
cd <toplevel_directory>; \
|
||||
git diff <unstaged_files>
|
||||
|
||||
# Stages a changed file
|
||||
git add <toplevel_directory>/<unstaged_files>
|
||||
# Stage single or multiple files
|
||||
cd <toplevel_directory>; \
|
||||
git add <changed_files>;
|
||||
|
||||
# Stages all changed files
|
||||
# Stage all files in project
|
||||
git add -A
|
||||
|
||||
# Saves the changes to a file in a commit
|
||||
|
@ -94,12 +96,13 @@ git submodule foreach git pull origin master
|
|||
# Update all submodules
|
||||
git submodule update --init --recursive
|
||||
|
||||
# Start ssh agent
|
||||
eval "$(ssh-agent -s)"; ssh-add
|
||||
|
||||
# Skip git hooks
|
||||
git commit --no-verify
|
||||
|
||||
# Create new branch from current HEAD
|
||||
git checkout -b <new_branch_name>
|
||||
|
||||
$ branch: git branch | awk '{print $NF}'
|
||||
$ toplevel_directory: git rev-parse --show-toplevel
|
||||
$ unstaged_files: git --no-pager diff --name-only
|
||||
$ unstaged_files: git status --untracked-files=no -s --porcelain | awk '{print $NF}' --- --multi true
|
||||
$ changed_files: git status --untracked-files=all -s --porcelain | awk '{print $NF}' --- --multi true
|
||||
|
|
4
cheats/ssh.cheat
Normal file
4
cheats/ssh.cheat
Normal file
|
@ -0,0 +1,4 @@
|
|||
% ssh
|
||||
|
||||
# Start ssh agent
|
||||
eval "$(ssh-agent -s)"; ssh-add
|
Loading…
Reference in a new issue