-2

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?

0

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

1 Comment

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.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.