version control - Git add and commit all files in one _native git_ command? -
version control - Git add and commit all files in one _native git_ command? -
the mutual git command sequence is:
git add together . git commit -m "message"
i have searched native git command 1 line surprisingly not find it. there @ to the lowest degree 2 big threads concerned question here , here, surprisingly have high voted answers not doing job or doing using additional hacks.
the top voted solution in first thread linked above suggest define macro
git config --global alias.add-commit '!git add together -a && git commit'
which has downside of having 1 time again , 1 time again every new software environment. sec voted solution
git commit -a -m "message"
does not work - not add together new files! other "solutions" involve writing same 2 commands in single line - offers no advantage in terms of typing!
further, pro git - 1 of well-known books states on page 22:
2.2.7 skipping staging area
although can amazingly useful crafting commits how want them, staging area bit more complex need in workflow. if want skip staging area, git provides simple shortcut. providing -a alternative git commit command makes git automatically stage every file that tracked before doing commit, letting skip git add together part...
the emphasis mine - indeed works files already tracked. new files never tracked (or can alter setting create beingness tracked?), can't have added , committed using command!
i looking clean single line solution provided standard git software without additional hacks. given many rich advanced options of git, hard believe such command not exist. if there missing here, happy learn!
to knowledge there isn't native command this, , questions have linked seem back upwards view. because has potential cause problems, although may have reasons wanting work way.
you can tweak 1 of commands have mentioned:
git config --system alias.add-commit '!git add together -a && git commit'
replacing --global --system configure alias every business relationship on single machine in 1 shot. of course of study need run above command business relationship has permission write scheme gitconfig file in /etc
not perfect reply might closer want, @ to the lowest degree practical standpoint.
git version-control git-commit git-add
Comments
Post a Comment