0

I have a project that I have uploaded to github. I have some files that are already added that I want removed. I just want them to exist locally in my folder.

My git ignore file is check in with the git repository. I don't want ANY mention of these files any where in the repository. If I add them to git ignore file, there will be mention of them in the repository.

Secondly what if I want my gitignore file to be ignored?

How can I just make a file be COMPLETELY in a git initialized folder?

3
  • you don't have to track the .gitignore either. ignore it and it will not be tracked, and hence won't have changes saved. Add .gitignore as a line to the file .gitignore. As for removing data after a commit, read this As they indicate, if you have already pushed up to github, you should consider anything sensitive already compromised. Commented Nov 6, 2015 at 17:14
  • how do you ignore the .gitignore Commented Nov 6, 2015 at 17:16
  • 1
    @ScottF the same way you ignore other files: by adding its name to .gitignore. Commented Nov 6, 2015 at 17:18

2 Answers 2

2

I have a project that I have uploaded to github. I have some files that are already added that I want removed. I just want them to exist locally in my folder.

git rm --cached file1 file2...

will remove them from the repo but leave the files in your local directory. You can then add them to your .gitignore file so that git won't keep telling you that you have untracked files.

I don't want ANY mention of these files any where in the repository.

There's not much you can do to remove them from existing commits that are already in the repository short of removing all the commits that include the files. So if you want to pretend that these files never existed, you should probably just create a new repo with the current state of the project after you've removed the offending files.

Sign up to request clarification or add additional context in comments.

Comments

0

Secondly what if I want my gitignore file to be ignored?

put ".gitignore" inside .gitignore file

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.