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
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jun 12, 2018 in Bitbucket

Do you use any Atlassian products for your personal projects?

After spinning my wheels trying to get organized enough to write a book for National Novel Writing Month (NaNoWriMo) I took my affinity for Atlassian products from my work life and decided to tr...

22,736 views 26 12
Join discussion

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