Git:nothing added to commit but untracked files present

user4943236 :

I'm new to Git and is using for the very first time. I would appreciate 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.

Tim Biegeleisen :

You have two options here. You can either add the untracked files to your Git repository (as the warning message suggested), or you can add the files to your .gitignore file, if you want Git to ignore them.

To add the files use git add:

git add Optimization/language/languageUpdate.php
git add email_test.php

To ignore the files, add the following lines to your .gitignore:

/Optimization/language/languageUpdate.php
/email_test.php

Either option should allow the git pull to succeed afterwards.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Git nothing added to commit but untracked files present - even with those files added to gitignore

Github desktop application - Nothing added to commit but untrack files present

git: How to ignore all present untracked files?

How to add untracked files to commit in git?

Git Changes not staged for commit and Untracked files

GIT: Restoring untracked files after reverting to previous commit

Git untracked files

git commit modified and untracked content

Git how to delete untracked files

How to pull untracked files with git

List temporarily untracked files in git

Show untracked files as git diff

Git: Ignore untracked files in submodule

how to remove untracked files in Git?

Unwanted untracked files in the snapshot - Git

Git remove new untracked files

Move tracked files to untracked with git

Files untracked in git not part of .gitignore

How can I commit my added files in git?

How does IntelliJ changes files before commit if they are already added to git

How to list all files added to the first commit of a GIT repository?

When I do git commit, it says nothing added + Macbook Pro created new Github account accidentally?

Git: How to get a listing of all untracked files, ignoring untracked submodules?

How to see untracked files in git instead of untracked directory

JPA, nothing is added to Database when commit

Git ignore files still listed in untracked list

git status showing code in untracked files

Git Dealing with merge conflict with tracked and untracked files

Git how to ignore untracked CDT files