How can I stop myself from using 'git commit -a'?

Tom Ritter

I confess that I sometimes use git commit -a when I should not. It's gotten to be reflex about half the time, often when I think I'm working in separate repositories - but I'm actually working in a much larger one that will affect directories far and wide.

Is there a .git/config setting I can specify that will cause the -a flag to throw an error?

VonC

Is there a .git/config setting I can specify that will cause the -a flag to throw an error?

Not that I know of.

You would need a wrapper for git which would check the arguments ("commit", "-a", ...), and on the specific command "commit -a" would throw an error.

Jubobs' script (mentioned in the comment above) is a good example of such a wrapper.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How can I stop sending Notification to myself?

From Dev

Using git diff, how can I show the patch from the index to a given commit?

From Dev

How can I rebase as one commit using Git

From Dev

How can I create a GIT Stash from a Commit?

From Dev

How can I create a GIT Stash from a Commit?

From Dev

How can I extract Git commit hash from VS/msbuild?

From Java

How do I stop Git from tracking any changes to a file from this commit forward?

From Dev

How can I protect myself while using public wifi hotspots?

From Dev

How can I email myself an error log from Flask?

From Dev

How can I prevent a folder from being inadvertently deleted by myself?

From Dev

I find myself reversing accumulators at the end of most functions; how can I stop?

From Dev

How can I revert back to a Git commit?

From Dev

How can I stop controls from using a KeyEvent?

From Dev

How can I stop controls from using a KeyEvent?

From Dev

How can I stop windows from using my Internet

From Java

How can I run `git commit` and `git push` in atom?

From Dev

How can I undo last local (not pushed) commit using git-plus?

From Dev

How can I use keyboard shortcuts to do a git commit and push from IntelliJ IDEA?

From Dev

How can I tell what happened in a Git commit with two parents that did not merge in the changes from the second parent?

From Dev

How can I take lines from someone's code via Git so that they are credited in commit history?

From Dev

How can I launch vim from my program and capture the written output, like Git commit

From Dev

How can I make a single commit of specific branch from other pushed commits in Git?

From Dev

How can I generate a Composer author list from Git's commit history?

From Dev

(How) can I run git checkout from within the pre-commit hook?

From Dev

How can i stop unity from script?

From Dev

How can I stop content from collapsing?

From Dev

How can I check for whitespace/tab errors in my git commit?

From Dev

How can i completely undo git commit just done

From Java

How can I move a tag on a git branch to a different commit?

Related Related

  1. 1

    How can I stop sending Notification to myself?

  2. 2

    Using git diff, how can I show the patch from the index to a given commit?

  3. 3

    How can I rebase as one commit using Git

  4. 4

    How can I create a GIT Stash from a Commit?

  5. 5

    How can I create a GIT Stash from a Commit?

  6. 6

    How can I extract Git commit hash from VS/msbuild?

  7. 7

    How do I stop Git from tracking any changes to a file from this commit forward?

  8. 8

    How can I protect myself while using public wifi hotspots?

  9. 9

    How can I email myself an error log from Flask?

  10. 10

    How can I prevent a folder from being inadvertently deleted by myself?

  11. 11

    I find myself reversing accumulators at the end of most functions; how can I stop?

  12. 12

    How can I revert back to a Git commit?

  13. 13

    How can I stop controls from using a KeyEvent?

  14. 14

    How can I stop controls from using a KeyEvent?

  15. 15

    How can I stop windows from using my Internet

  16. 16

    How can I run `git commit` and `git push` in atom?

  17. 17

    How can I undo last local (not pushed) commit using git-plus?

  18. 18

    How can I use keyboard shortcuts to do a git commit and push from IntelliJ IDEA?

  19. 19

    How can I tell what happened in a Git commit with two parents that did not merge in the changes from the second parent?

  20. 20

    How can I take lines from someone's code via Git so that they are credited in commit history?

  21. 21

    How can I launch vim from my program and capture the written output, like Git commit

  22. 22

    How can I make a single commit of specific branch from other pushed commits in Git?

  23. 23

    How can I generate a Composer author list from Git's commit history?

  24. 24

    (How) can I run git checkout from within the pre-commit hook?

  25. 25

    How can i stop unity from script?

  26. 26

    How can I stop content from collapsing?

  27. 27

    How can I check for whitespace/tab errors in my git commit?

  28. 28

    How can i completely undo git commit just done

  29. 29

    How can I move a tag on a git branch to a different commit?

HotTag

Archive