Showing + Sign and Red Background when Git working directory clean
I've been working on a git repo and after some changes and pushes I always see a + (plus) sign with a red background on the git segment even tough git status tells me:
# On branch whatever
nothing to commit, working directory clean
That's odd. The command powerline runs is git status --ignore-submodules. Can you run that and take a screenshot?
Thank you @milkbikis. I've run both git status and git status --ignore-submodules and in both cases my working directory is clean. Take a look at the screenshot (don't mind the big blank space in the path, I've obfuscated part of it)

Are u using a global gitignore ? - ~/.gitignore_global ? I'm facing a similar issue
yes I do indeed
@LeonardoGentile check the pull request I have sent across. You need to add the HOME env variable for git it to work
@jknair thanks, I've tried it. I don't get the + sign anymore for clean directories but I DO still get the red background even tough the message from git status is:
# On branch whatever
nothing to commit, working directory clean
@LeonardoGentile - Hey, could you put ur global .gitconfig, your project's .git/config and working directory's .gitignore.
It'll help to identify the problem. You can mask out relevant strings
Here my gloabal .gitconfig
[core]
quotepath = false
excludesfile = ~/.gitignore_global
attributesfile = ~/.gitattributes
editor = sub -n -w
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
meta = yellow bold
frag = magenta bold
old = red bold
new = green bold
[color "status"]
added = yellow
changed = green
untracked = cyan
[color]
ui = true
diff = true
[diff]
tool = diffmerge
[difftool "diffmerge"]
cmd = diffmerge \"$LOCAL\" \"$REMOTE\"
[merge]
tool = diffmerge
log = true
[mergetool "diffmerge"]
cmd = "diffmerge --merge --result=\"$MERGED\" \"$LOCAL\" \"$(if test -f \"$BASE\"; then echo \"$BASE\"; else echo \"$LOCAL\"; fi)\" \"$REMOTE\""
trustExitCode = true
[user]
name = **myname**
email = **[email protected]**
[mergetool]
keepBackup = true
My project/.git/config
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = [email protected]:MyGit/myrepo.git
[branch "master"]
remote = origin
merge = refs/heads/master
[branch "whatever1"]
remote = origin
merge = refs/heads/whatever1
[branch "whatever2"]
remote = origin
merge = refs/heads/whatever2
[branch "whatever3"]
remote = origin
merge = refs/heads/whatever3
[branch "whatever4"]
remote = origin
merge = refs/heads/whatever4
My .gitignore_global
# Compiled Python files
*.pyc
# Folder view configuration files
.DS_Store
Desktop.ini
# Thumbnail cache files
._*
Thumbs.db
# Files that might appear on external disks
.Spotlight-V100
.Trashes
#pycharm stuff
.idea/
#
*.sublime-project
*.sublime-workspace
My working directory .gitignore
*.DS_Store
*.pyc
*.swp
.sass-cache
cms/my_project.db
cms/my_project/local_settings.py
cms/my_project/media
cms/my_project/configs
data/my_projectconfig/*
data/my_project_download/*
data/my_project_transactions/*
FYI, after testing your solution I don't see the "top" or "bottom" arrow with the number of ahead/behind commits with respect to the remote tracked branch
@LeonardoGentile The problem related to the repo being behind or ahead (top / bottom arrows) is probably your branch not being 'tracked'. Could u confirm that ? I had the same problem when my 'branch-tracking' was lost.
@ruturajv nope, the local branches are correctly tracking remote branches, this happened after trying the @jknair solution. Reverting the @jknair solution restored the + sign and shows the correct numbers of ahed/behind commits of remote branches. So I'm back to the first problem: always having the red background and the + sign in clean working directories...
Being an idiot I haven't seen @jknair second commit that fixed a typo for pull reqest #126 . Applying it seems to solve all my issues, I'm gonna test it for a while, sorry for wasting your time
Sweet, thanks for the report!