Meaning of the GitHub message: push declined due to email privacy restrictions

The remote repository has been configured to disallow you pushing a commit that would reveal your personal e-mail address. For example in GitHub you have checked the Block command line pushes that expose my email checkbox to enable this. While you can of course uncheck that setting, it will expose your private e-mail address to everyone in the … Read more

What is the difference between git push origin and git push origin master

The default action of git push and git push origin has changed since git version 1.7.11: Before 1.7.11, git push by default pushes all branches that also exist remotely with the same name. Since 1.7.11, git push by default pushes the current branch to a remote branch with the same name. Before and after version 1.7.11, the default behavior can be configured with the push.default configuration option. This configuration option has … Read more

How do I properly force a Git push?

Just do: or if you have a specific repo: This will delete your previous commit(s) and push your current one. It may not be proper, but if anyone stumbles upon this page, thought they might want a simple solution… Short flag Also note that -f is short for –force, so will also work.

error: src refspec master does not match any

From git branch it appears that somehow your local branch name is “origin”. You can rename the branch with -mv flag, like this: git branch -mv origin master After this git branch should show master 🙂 Just to make sure the name is indeed the only thing that went astray, you can run git log and look at the last few commits – and compare … Read more

What does ‘–set-upstream’ do?

To avoid confusion,recent versions of git deprecate this somewhat ambiguous –set-upstream optionin favor of a more verbose –set-upstream-to optionwith identical syntax and behavior. sets the default remote branch for the current local branch. Any future git pull command (with the current local branch checked-out),will attempt to bring in commits from the <remote-branch> into the current local branch. One way to avoid having to explicitly type –set-upstream / –set-upstream-to is … Read more