How do I exclude files from the "unstage" box in Bitbucket?
I have a Wordpress site. The entire site, including the Core files, are uploaded to the repo. I only care about changes to one subdirectory of my Repo, the theme directory. How can I "exclude" all core files from being tracked locally?
I don't want to ignore the files and can't use .gitignore, because these files are already in repo. I am trying to use exlude, to no avail. I tried adding a file called .git/info/exclude; i've updated my local config and my global config to use exclude. Nothing happens, and Bitbucket is still showing WP Core files as needing to be committed.
Why isn't there an easy way to tell Git/Bitbucket to "forget" about these files?
Hi Jeffrey, you can try
git rm --cached
This is used to remove a file from the index, it makes git stop tracking the file completely. In the case where the file is already in the repo, git rm --cached
will remove the file from the index, leaving it in the working directory and a commit will now remove it from the repo as well. Basically, after the commit, you would have unversioned the file and kept a local copy. You can check the official documentation at Git rm.
Let us know if that's what you wanted!
Cheers,
Ana
Thank you for the reply. I don't want to remove any files. Is there not a way to have Git or Bitbucket "forget" these files in my local repo? Can I remove these unecessary files from my list of 'unstaged' files?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm trying to "Exclude" these files, but it seems those attempts are not doing anything. I've added an exclude file to .git/info directory, and i've updated my global .gitconfig file specifying what to exclude, but I don't see any changes. Perhaps I'm confused on the purpose of exclude?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.