This is probably an edge case, but every time I've got this specific error it is because I've recently mapped a drive in Windows, and powershell cannot find it.
git status
error: Your local changes to the following files would be overwritten by merge:
<my project>/pom.xml
Please, commit your changes or stash them before you can merge.
Aborting
as the above post suggested helped finding any conflicting changes and you can decide to discard or commit.
One more thing that can cause this is when you map a network drive or connect a VHD after GitHub Desktop has already been started. The reason for this is that GitHub Desktop uses ssh-agent from the portable GIT install to establish connections, and never closes it... even if you uninstall the application. The process starts with no knowledge of the new drive and never refreshes itself, and when it is used to run the GIT commands to work on your repo it fails because it doesn't understand the paths.
The solution in this instance is to close GitHub Desktop and use Task Manager to terminate the running ssh-agent before starting it again. This will start a new instance of ssh-agent when needed which will pick up the new drive mappings, etc.
I had the same issue. I removed the repo from the GitHub Windows client (right-click menu) and re-added it. When I re-added, I noticed I had about 300 uncommitted changes and it was reporting a memory error. I discarded all the changes and then sync started working fine again. (Rookie Git user - I'm sure there are better ways to do this on the command line)
我尝试用 Android Studio 提交更改并将其推到主窗口,但窗口显示了一个弹出窗口,我必须输入 Github 凭证(https://github.com)。我用我的 Gmail 账户注册了,所以我试着输入我的 Gmail ID 和密码,很明显 Git 没有我的 Gmail 密码,也不能与我提供的密码匹配,所以我最终取消了推送。
When I tried to sync my changes through GitHub GUI Window I encounter this error. On git status command Git Shell suggested to push changes as
Your branch is ahead of 'origin/master' by 1 commit.
(use "git push" to publish your local commits)