-1

As you can see Git command to check status untrack file in my repository. git status enter image description here

i want to remove/ reset those untrack file but git command is not working enter image description here

even i try clean untrack file still hard luck enter image description here

even i try to pull from remote repository still no luck.

can anyone tell me how to remove those file from untrack status?

Thanks in advance.

poke
  • 369,085
  • 72
  • 557
  • 602
Syan
  • 137
  • 1
  • 5
  • 17

1 Answers1

0

I think this answer should resolve all your queries.

Step 1 is to show what will be deleted by using the -n option:

# Print out the list of files and directories which will be removed (dry run)
git clean -n -d

Step 2 Clean Step - beware: this will delete files:

# Delete the files from the repository
git clean -f
  • To remove directories, run git clean -f -d or git clean -fd
  • To remove ignored files, run git clean -f -X or git clean -fX
  • To remove ignored and non-ignored files, run git clean -f -x or git clean -fx

Note the case difference on the X for the two latter commands.

If clean.requireForce is set to "true" (the default) in your configuration, one needs to specify -f otherwise nothing will actually happen.

Again see the git-clean docs for more information.

git clean -n doesn't actually remove the files, but actually shows which files are going to be removed.

git clean -f removes and deletes the files from the repository.

Shujath
  • 846
  • 1
  • 8
  • 22