Skip to content

Instantly share code, notes, and snippets.

@KaceCottam
Last active June 20, 2021 18:35
Show Gist options
  • Save KaceCottam/f66b45dc4f963a6a1b3fe56d820913e1 to your computer and use it in GitHub Desktop.
Save KaceCottam/f66b45dc4f963a6a1b3fe56d820913e1 to your computer and use it in GitHub Desktop.
various extra git commands
#!/bin/bash
# A git command for adding files to the gitignore
for i in $*; do echo $i >> .gitignore; done
git add .gitignore
#!/bin/bash
# A git command for listing tracked files
# from https://stackoverflow.com/questions/15606955/how-can-i-make-git-show-a-list-of-the-files-that-are-being-tracked
ls --group-directories-first --color=auto -d $(git ls-tree $(git branch | grep \* | cut -d " " -f2) --name-only)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment