Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Can't do a git pull or a git push

When I do a git pull in the master branch, git show this message:

There is no tracking information for the current branch.
Please specify which branch you want to merge to.
See git-pull(1) for details.

git pull <remote> <branch>

If you want to set up the tracing information for this branch, you can do it with:
git branch --set-upstream-to=origin/<branch> master

And when I do git push in the master branch, git show this message:

fatal: The current master branch does not have an upstream branch.
To push the current branch and set the remote as upstream, use

git push --set-upstream origin master

So I do git push --set-upstream origin master, git show this message:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

To <my-server-name>
! [rejected] master -> master (non-fast-forward)
error: failed to push some references to '<my-server-name>'.
help: Updates were rejected because the tip of your current branch is
help: behind its remote counterpart. Integrate remote changes (i.e.
help: 'git pull ...') before pushing again.
help: See 'Note about fast-forwards' in 'git push --help' for details.

Please help me!

>Solution :

You first need to make sure your local branch references the upstream branch by runing:
git branch --set-upstream-to=origin/<branch> master

After that, you’ll want to perform git pull to fetch the missing changes from your upstream branch.

Once you have the changes, you’ll be able to perform a git push, but it’s also possible that you’ll have to perform a manual merge in order to resolve any conflicts that arise from the changes you’ve made and those that were present in the upstream branch.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading