Last active
September 17, 2021 07:39
-
-
Save alexfu/9f152162c105f1f5e787f68f03605423 to your computer and use it in GitHub Desktop.
Revisions
-
alexfu revised this gist
Aug 28, 2021 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -17,6 +17,8 @@ Add the following alias to your global `.gitconfig` file addi = !git add $(git status --porcelain | fzf -m | awk '{print $2}') ``` _* The `!` tells git to run an external command instead of a subcommand._ ## Step 2 Run `git addi`. To select multiple files, use `Shift + Tab`. Press `ENTER` when done. -
alexfu revised this gist
Aug 28, 2021 . 1 changed file with 4 additions and 27 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ # git addi Add git files interactively from the command line. @@ -10,36 +10,13 @@ Add git files interactively from the command line. ## Step 1 Add the following alias to your global `.gitconfig` file ``` [alias] addi = !git add $(git status --porcelain | fzf -m | awk '{print $2}') ``` ## Step 2 Run `git addi`. To select multiple files, use `Shift + Tab`. Press `ENTER` when done. -
alexfu revised this gist
Aug 28, 2021 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -42,4 +42,4 @@ $ mv git-addi ~/.git/bin ## Step 3 Run `git addi`. To select multiple files, use `Shift + Tab`. Press `ENTER` when done. -
alexfu revised this gist
Aug 28, 2021 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -42,4 +42,4 @@ $ mv git-addi ~/.git/bin ## Step 3 Execute `git addi`. To select multiple files, use `Shift + Tab`. Press `ENTER` when done. -
alexfu revised this gist
Aug 28, 2021 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -42,4 +42,4 @@ $ mv git-addi ~/.git/bin ## Step 3 Run `git addi` and rejoice! To select multiple files, use `Shift + Tab`. -
alexfu revised this gist
Aug 28, 2021 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,6 +2,8 @@ Add git files interactively from the command line. [](https://asciinema.org/a/cOqnPWQuMcbbGTqaB6qQPxLlq) ## Requirements - [fzf](https://github.com/junegunn/fzf) @@ -40,4 +42,4 @@ $ mv git-addi ~/.git/bin ## Step 3 Enjoy! -
alexfu created this gist
Aug 28, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,43 @@ # git-addi Add git files interactively from the command line. ## Requirements - [fzf](https://github.com/junegunn/fzf) ## Step 1 Create a new bash script called `git-addi`... ``` #!/bin/bash # Add files interactively git add $(git status --porcelain | fzf -m | awk '{print $2}') ``` Make it executable... ``` $ chmod +x git-addi ``` ## Step 2 Move `git-addi` script to a place that is in your `$PATH`. For example, I have `~/.git/bin` appended to my `$PATH` variable. This is where all my git scripts live. ``` export PATH=$PATH:~/.git/bin ``` ``` $ mv git-addi ~/.git/bin ``` ## Step 3 Enjoy!