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 vote

 

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?

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
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Piotr Plewa
Published Dec 27, 2017 in Bitbucket

Recipe: Deploying AWS Lambda functions with Bitbucket Pipelines

Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda&nbsp...

1,767 views 1 5
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