Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
+1 vote
2 views
in DevOps and Agile by (29.3k points)

This will be my first git use. 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

1 Answer

+1 vote
by (50.2k points)

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:

git push origin 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. 

1.2k questions

2.7k answers

501 comments

693 users

Browse Categories

...