NoGit is a Python script that prevents the unnecessary repetition of the git keyword. It opens a shell CLI where you can input git commands without typing the
git keyword before every instruction. I wrote this script as an answer to a question on StackOverflow.
After calling ./nogit, a CLI (similar to the MySQL shell) should appear:
Note: Given that NoGit is a wrapper around Git, it provides all of the features of the Git VCS.
%undodeletes the last command from the stack
%runexecutes all commands in the stack and deletes it when done
%exitcloses the CLI without doing anything
ctrl+chas the same effect as executing
- Command history gets saved to a file called
nogit.historyin the same folder as the script
- You can add multiple commands in one line using a semi-colon
- You can use the
gitkeyword because the script doesn't add the
gitkeyword if it already exists
commit -m "initial commit"
Installation notes (Linux)
If you want you can remove the
.py extension and convert it into an executable:
mv nogit.py nogit chmod +x ./nogit ./nogit # open the NoGit CLI
You can also move this script to your
./bin/ directory and create an alias for it to run it without a
sudo cp ./nogit /bin/nogit sudo chmod +x /bin/nogit alias nogit="/bin/nogit"
Alternatively you can copy the following command into your CLI:
sudo cp ./nogit /bin/nogit && sudo chmod +x /bin/nogit && alias nogit='/bin/nogit'
To install NoGit locally, copy and paste the following source code into a file named
#!/usr/bin/env python import sys, os, signal, atexit, readline, subprocess commands, stop, history_file = , False, os.path.join(os.getcwd(), "nogit.history") def run_commands(): stop = True for cmd in commands: command = ["git" if not cmd.startswith("git ") else ""] command = [cmd] if command == "" else [command, cmd] subprocess.Popen(command).communicate() commands =  def signal_handler(sig, frame): run_commands() sys.exit(0) try: readline.read_history_file(history_file) signal.signal(signal.SIGINT, signal_handler) while True: if stop == True: break command = input("git> ") if command == "%undo": commands.pop() elif command == "%run": run_commands() elif command == "%exit": sys.exit(0) else: commands += [cmd.strip() for cmd in command.split(";")] signal.pause() readline.set_history_length(-1) except IOError: pass atexit.register(readline.write_history_file, history_file)