When we want to add, commit all file at once and push on single command from git bash what is the syntax/command for it so that I don't have to type multiple command?
1 Answer
Command to add, commit all file and push to git at once:
New approach:
git commit -am "message" && git push origin branch_name
Traditional:
Step-1:
git add. //for multiple file
or
git add file_name //for single file
Step-2:
git commit -m"hello message"
Step-3:
git push origin branch_name
Note: You can note that you don't have to write extra two command for add, commit and push if you want to do at once.
1 Comment
Rob Pomeroy
Note that
commit -am only commits changed or deleted files. It does not commit added files. See the -a flag in the official git commit reference. This SO question has more complete answers.