Have you failed a job interview?
Send us your job interview questions and get correct answers.
How do you add a new file to the Git remote repository?
Experience Level: Junior
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.
Related Git job interview questions
What is Staging Area (or Index) in Git?GitSource control Junior
What does the Git clone command do?GitSource control Junior
What is a git commit command?GitSource control Junior
How can you identify who changed the specific file under version control and what were the changes?GitSource control Junior
How can you find out what were the most recent changes in Git repository and who made them?GitSource control Junior