0

When I push to github, I get an error that says git was unable to push some refs, but I can see on remote that the push is successful.

Here are the details:

[akhann16@login006 swift_proj]$ git push
warning: push.default is unset; its implicit value is changing in
Git 2.0 from 'matching' to 'simple'. To squelch this message
and maintain the current behavior after the default changes, use:
  git config --global push.default matching
To squelch this message and adopt the new behavior now, use:
  git config --global push.default simple
See 'git help config' and search for 'push.default' for further information.
(the 'simple' mode was introduced in Git 1.7.11. Use the similar mode
'current' instead of 'simple' if you sometimes use older versions of Git)
Counting objects: 7, done.
Delta compression using up to 24 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (5/5), 1.17 KiB | 0 bytes/s, done.
Total 5 (delta 1), reused 0 (delta 0)
remote: Resolving deltas: 100% (1/1), completed with 1 local object.
To [email protected]:khanna-lab/cadre.git
   a1563e5..2223084  ak-tinkering -> ak-tinkering
 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to '[email protected]:khanna-lab/cadre.git'
hint: Updates were rejected because a pushed branch tip is behind its remote
hint: counterpart. If you did not intend to push that branch, you may want to
hint: specify branches to push or set the 'push.default' configuration variable
hint: to 'simple', 'current' or 'upstream' to push only the current branch.

I see that the push is successful, but I don't understand why I get this error or what it is saying?

2
  • ak-tinkering push was successful, but master push failed. Commented Nov 17, 2022 at 17:04
  • What version of Git are you using? (Check with git --version .) I think it's been more than 8 years since git push would push multiple branches by default. Commented Nov 17, 2022 at 17:30

1 Answer 1

1

Indeed, this is because using an old git, version 1.8.3.1. I can't update git on the system I am using, so I updated the setting configuration setting:

git config --global push.default simple
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.