How to add multiple files to Git at the same time -git add multiple files ?
I am new to git. I have added new files ( a lot ) to the folder/project ( git local repository).
I went through online tutorials and forums and see I can do
git commit -a
So I go to the base folder of the repository and do a
sudo git commit -a
But then, some screens comes up and asks me to add a comment which I do. I do not know how to proceed or exit. I do not want to mess up so I did ctrl + Z and did not do anything.
Can you guys please outline the commands I need to use?
git commit -a
or
git push
How git add multiple files ?
To add all the changes you've made:
git add .
To commit them:
git commit -m "MY MESSAGE HERE"
To push your committed changes from your local repository to your remote repository:
<a href="https://www.janbasktraining.com/blog/git-push-vs-git-push-origin/"><a href="https://www.janbasktraining.com/community/sql-server/how-can-we-find-the-stored-procedure-in-the-database-if-we-have-just-some-idea-of-the-procedure-name">git push origin</a></a> master
You might have to type in your username/password for github after this. These steps will help you to add all files to the staging area in git.
Note:
To add and commit files to a Git repository
Create your new files or edit existing files in your local project directory. Enter git add --all at the command line prompt in your local project directory to add the files or changes to the repository. Enter git status to see the changes to be committed.