A custom git wrapper that extends Git with some custom commands that I find useful.
Any commands that are not a custom command is automatically passed to Git. Git should have full functionality (including using vim to edit commit message).
-
2g explore <repo.git>
Allows you to explore a Git repo without polluting your directories. -
2g install <repo.git>
Clones a repository in~/.local/bin
and adds the repository to yourPATH
environment variable. Note: You will have to reload your shell to use any programs/scripts that were installed. -
2g clone-file <repo.git>/<file_path>
Similar to the patched clone command, usingclone-file
allows you to clone a single file from a git repository. Without any Git history attached. -
2g cache-clone <repo.git>
A more optimized version ofgit clone
that will attempt to use a local cache of the repository and update it instead of cloning an entire repo from scratch. Additionally, it will fetch git history in the background, meaning that you will have access to all the repositories code, and (hopefully) by the time that you push, all the git history will have been fetched.
2g clone <repo.git>/[file_path]
By adding a file path to a clone command, you are able to clone a single file from a git repository. Warning: This file will not have any Git history attached to it because it was not cloned as part of a repository. Example: Clone the CUDA .gitignore file into your repository you would run2g clone https://github.com/github/gitignore/blob/main/CUDA.gitignore