I have 2-factor authentication enabled on my account. The repo is my own and I was unable to push changes to a private branch.
Steps to resolve
1. Check your remote of repo
$ git remote -v origin https://github.com/vishalkanaujia/gnome-connection-manager-1.git (fetch) origin https://github.com/vishalkanaujia/gnome-connection-manager-1.git (push)
Looked carefully, I was trying to push using https.
2. I updated local system’s SSH keys to my github account.
3. Next, I changed the remote to SSH.
# Remove original origin $ git remote remove origin # Added SSH origin $ git remote add origin email@example.com:vishalkanaujia/gnome-connection-manager-1.git #Pushed changes $ git push origin fix_shortcuts Counting objects: 3, done. Delta compression using up to 4 threads. Compressing objects: 100% (3/3), done. Writing objects: 100% (3/3), 536 bytes | 536.00 KiB/s, done. Total 3 (delta 2), reused 0 (delta 0) remote: Resolving deltas: 100% (2/2), completed with 2 local objects. remote: remote: Create a pull request for 'fix_shortcuts' on GitHub by visiting: remote: https://github.com/vishalkanaujia/gnome-connection-manager-1/pull/new/fix_shortcuts remote: To github.com:vishalkanaujia/gnome-connection-manager-1.git * [new branch] fix_shortcuts -> fix_shortcuts