Skip to content

Instantly share code, notes, and snippets.

@n-at-han-k
Last active August 4, 2024 14:38
Show Gist options
  • Select an option

  • Save n-at-han-k/ba17d56f35544f0f59c0367705553eef to your computer and use it in GitHub Desktop.

Select an option

Save n-at-han-k/ba17d56f35544f0f59c0367705553eef to your computer and use it in GitHub Desktop.
Bash shell script to quickly push all changes to git in one command from any sub-directory.
#!/bin/bash
GIT=`which git`
REPO_DIR=`${GIT} rev-parse --show-toplevel`
cd ${REPO_DIR}
${GIT} add --all .
${GIT} commit -m "Quick Git Push"
${GIT} push
@n-at-han-k
Copy link
Author

I have this script located in ~/bin which is added to my PATH in .zshrc

# .zshrc or .bashrc
export PATH="PATH:~/bin"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment