Back

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

I'm new to Git and using it for the very first time. I would appreciate it if someone could help me out. I tried finding the answer at forums, but there are tons of commands that are coming out and not sure which one to use.

On the prod server, if I do the git pull, it is giving me the following error:

Untracked files: (use "git add ..." to include in what will be committed)

Optimization/language/languageUpdate.php

email_test.php

nothing added to commit but untracked files present (use "git add" to track)

Please move or remove them before you can merge.

I'm not too sure how to make it work. If I remove them, from where would it be removed. Appreciate your reply.

1 Answer

+9 votes
by (19.4k points)
edited by

For this question, you have two options 

1. Add the untracked files to your git repository 

2. Add the files to .gitignore file If you want git to ignore them.

For adding the untracked files you could use :

git add Optimization/language/languageUpdate.php

git add email_test.php

And to ignore the files you need to add the following lines to your .gitignorefile:

/Optimization/language/languageUpdate.php

/email_test.php

these two options will allow the git pull to success.

For more information regarding git commands and concepts of git go through the following link:

Browse Categories

...