How do you add a new file to the Git remote repository?

Experience Level: Junior
Tags: Git

Answer

To add a new file, to the remote repository, you first need to add it to index (staging area). Use git add . command for this.

Then you need to commit the change to your local repository. Use git commit -m "Change description" command for this.

Then you need to push commits from the local repository to the remote repository. Use git push command for this.

Comments

No Comments Yet.
Be the first to tell us what you think.
Git for beginners
Git for beginners

Are you learning Git ? Try our test we designed to help you progress faster.

Test yourself
25 Git questions that will help you to nail your job interview
25 Git questions that will help you to nail your job interview

Are you learning Git ? Try our test we designed to help you progress faster.

Test yourself