I also struggled quite a lot to figure out the right configuration. Once getting it right, I wrote this Article guiding one through the setup of powerline. Including installing the right font and configuring Visual Studio Code. I hope it helps.
To summarize do the following:
Create the directories:
mkdir ~/.config/powerline
mkdir ~/.config/powerline/colorschemes
mkdir ~/.config/powerline/themes
mkdir ~/.config/powerline/themes/shell
Copy the default config files (maybe path has another python version):
cp ~/.local/lib/python3.7/site-packages/powerline/config_files/colorschemes/default.json ~/.config/powerline/colorschemes/
cp ~/.local/lib/python3.7/site-packages/powerline/config_files/colorschemes/solarized.json ~/.config/powerline/colorschemes/
cp ~/.local/lib/python3.7/site-packages/powerline/config_files/themes/shell/default.json ~/.config/powerline/themes/shell/
Add the following lines to both files in ~/.config/powerline/colorschemes
The lines need to be added to the "groups" section, and don't forget the comma in the last line before appending the lines.
"gitstatus": { "fg": "gray8", "bg": "gray2", "attrs": [] },
"gitstatus_branch": { "fg": "gray8", "bg": "gray2", "attrs": [] },
"gitstatus_branch_clean": { "fg": "green", "bg": "gray2", "attrs": [] },
"gitstatus_branch_dirty": { "fg": "gray8", "bg": "gray2", "attrs": [] },
"gitstatus_branch_detached": { "fg": "mediumpurple", "bg": "gray2", "attrs": [] },
"gitstatus_tag": { "fg": "darkcyan", "bg": "gray2", "attrs": [] },
"gitstatus_behind": { "fg": "gray10", "bg": "gray2", "attrs": [] },
"gitstatus_ahead": { "fg": "gray10", "bg": "gray2", "attrs": [] },
"gitstatus_staged": { "fg": "green", "bg": "gray2", "attrs": [] },
"gitstatus_unmerged": { "fg": "brightred", "bg": "gray2", "attrs": [] },
"gitstatus_changed": { "fg": "mediumorange", "bg": "gray2", "attrs": [] },
"gitstatus_untracked": { "fg": "brightestorange", "bg": "gray2", "attrs": [] },
"gitstatus_stashed": { "fg": "darkblue", "bg": "gray2", "attrs": [] },
"gitstatus:divider": { "fg": "gray8", "bg": "gray2", "attrs": [] }
Next, edit the file ~/.config/powerline/themes/shell/default.json
Change:
"function": "powerline.segments.shell.jobnum",
"priority": 20
To:
"function": "powerline_gitstatus.gitstatus",
"priority": 40
Finally, restart the powerline daemon:
powerline-daemon --replace
After that the GIT specific information should be visible within powerline.