Excluding files Edited

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?


1 answer

0 votes


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!



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?

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?

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Thursday in Bitbucket Pipelines

Building a Bitbucket Pipe as a casual coder

....sh :  #!/bin/bash source "$(dirname "$0")/common.sh" enable_debug extra_args="" if [[ "${DEBUG}" == "true" ]]; then extra_args="--verbose" fi # mandatory variables ROLLBAR_ACCESS_TOKEN...

188 views 0 12
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you