-1

I'm using Sourcetree on OS X. I'm working on a WordPress project. For some reason, changes I make in the 'themes' directory are not being shown as Unstaged files. If I add a test file to /wp-admin/ or /wp-content/ it shows the test file as unstaged. I can't figure out why themes files are not being tracked.

I checked .gitignore and it's empty.

Any help is appreciated. Thanks!

Tom
  • 1,215
  • 3
  • 19
  • 30
  • Have you tried view->refresh? I have had source tree fail to recognize changes to files that are deep within the file structure. Also can you open up GIT console for that repo and execute "git status" then update your question with its output – ductiletoaster Sep 17 '15 at 19:53
  • @ductiletoaster Tried that with no luck. Thanks though. I tried putting a file in plugins/plugin-name/assests/test.php and sourcetree saw the change – Tom Sep 17 '15 at 19:57
  • Yeah sounds like an issue I have had before. I edited my last question do you mind reading through it again and let me know what you find? Thanks – ductiletoaster Sep 17 '15 at 19:58
  • On branch master Your branch is up-to-date with 'origin/master'. Untracked files: (use "git add ..." to include in what will be committed) .gitignore wp-content/themes/themename/ nothing added to commit but untracked files present (use "git add" to track) – Tom Sep 17 '15 at 20:02
  • Ok so it appears GIT sees untracked files. Was this theme newly added? Is it possible that the theme has either its own .gitignore or even a .git folder? – ductiletoaster Sep 17 '15 at 20:06
  • Yes, it has a .git folder in themes/themename – Tom Sep 17 '15 at 20:08
  • That is likely the problem. Sourcetree thinks this theme is part of a separate sub-repo... So it wont track changes for your repo. You could try to simply delete that second .git directory and see what happens – ductiletoaster Sep 17 '15 at 20:09
  • I deleted it. Still not in Sourcetree – Tom Sep 17 '15 at 20:33
  • To simplify things I'll try and replicate and update my posted answer below. – ductiletoaster Sep 17 '15 at 20:39
  • Can you review my edit on my posted answer. I need more information. – ductiletoaster Sep 17 '15 at 20:49

2 Answers2

1

To clarify the question. If SourceTree fails to recognize un-tracked files here are some steps you should take.

  1. Double check that you are not listing the file/directory in .gitignore
  2. Open up a GIT console for that repository and run git status This should show whether any changes are detectable by GIT.
  3. Go to the directory in which you are having problems and look to see if you have any .gitignore files or .git folders. If they exist then deleting them should allow you to add these files to your repository

Caution: Sometimes having a Repo inside a repo is by design (often referred to as a sub-repository) and could cause issues if removed.

Edit:

I just replicated this scenario with two repos and source tree appeared to see the untracked files once the .git was removed. Could you open up a terminal window to that themes directory and do an ls -a?

Community
  • 1
  • 1
ductiletoaster
  • 483
  • 2
  • 9
0

If you use SourceTree, open the terminal and use git add <fileName> -f to force shown any changes in this folder then you can push to Bitbucket

kenlukas
  • 3,616
  • 9
  • 25
  • 36