Catch this condition beforehand by checking the exit code of git diff-index
?
For example (in shell):
git add -A
git diff-index --quiet HEAD || git commit -m 'bla'
EDIT: Fixed git diff
command according to Holger’s comment.
More Related Contents:
- pip install from git repo branch
- Python not working in the command line of git bash
- Configuring so that pip install can work from github
- Is it possible to use pip to install a package from a private GitHub repository?
- pip connection failure: cannot fetch index base URL http://pypi.python.org/simple/
- Should I be adding the Django migration files in the .gitignore file?
- Best practices for adding .gitignore file for Python projects? [closed]
- How can I save my secret keys and password securely in my version control system?
- Python Git Module experiences? [closed]
- Using an SSH keyfile with Fabric
- How to write setup.py to include a Git repository as a dependency
- Python way to clone a git repository
- Specify extras_require with pip install -e
- Activate a virtualenv via fabric as deploy user
- Get the current git hash in a Python script
- Can not activate a virtualenv in GIT bash mingw32 for Windows
- fabric password
- Use Git commands within Python code
- Deploy a Python (Dash) app to Heroku using Conda environments (instead of virtualenv)
- Executing command using “su -l” in SSH using Python
- How to answer to prompts automatically with python fabric?
- How to set target hosts in Fabric file
- How do I copy a directory to a remote machine using Fabric?
- How can I install from a git subdirectory with pip?
- Converting a Mercurial (hg) repository to Git on Windows (7)
- How to run cloned Django project?
- GitPython and SSH Keys?
- How can I call ‘git pull’ from within Python?
- task: Prime numbers in function
- How do I hide the console when I use os.system() or subprocess.call()?