Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,457,715
Community Members
 
Community Events
176
Community Groups

I am not able to push to remote repo

I am not able to push to remote repo. Please help 

I am seeing below error 

kumar@DESKTOP-24PTARK MINGW64 /d/gitrails/check (master)
$ git push
fatal: The current branch master has no upstream branch.
To push the current branch and set the remote as upstream, use

git push --set-upstream origin master


kumar@DESKTOP-24PTARK MINGW64 /d/gitrails/check (master)
$ git push --set-upstream origin master
To https://bitbucket.org/USERNAME/hbc.git
! [rejected] master -> master (fetch first)
error: failed to push some refs to 'https://bitbucket.org/USERNAMR/hbc.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

kumar@DESKTOP-24PTARK MINGW64 /d/gitrails/check (master)
$

2 answers

2 accepted

0 votes
Answer accepted
Caroline R Atlassian Team Mar 01, 2022

Hi, @Shyam, thank you for reaching out to Atlassian Community.

By the output you shared with us of git pull, apparently, your local main branch is not tracking the remote main branch:

If you wish to set tracking information for this branch you can do so with:

git branch --set-upstream-to=origin/<branch> master

In this case, I would suggest checking with the command git remote -v if your remote is named origin and if local and remote branches are named master. After confirming that, you can run:

git branch --set-upstream-to=origin/master master

and then try to pull. You can also try to run this command:

git pull origin master

Just to give you some context, when you clone a repo, the main branch gets cloned (usually called "master"), and then your local main branch is set to track your remote main branch. I’m not sure what happened in your repo, but it seems that somehow that connection was removed.

Please let me know how it goes and feel free to share any additional questions or concerns regarding this case.

Kind regards,
Caroline

Please pull the changes first by using following command:

git pull 

 

Hi Grabalski,

Thank you for the response. 

I am getting below message when I do git pull, 

kumar@DESKTOP-24PTARK MINGW64 /d/gitrails/check/hello-bitbucket (master)
$ git push
fatal: The current branch master has no upstream branch.
To push the current branch and set the remote as upstream, use

git push --set-upstream origin master


kumar@DESKTOP-24PTARK MINGW64 /d/gitrails/check/hello-bitbucket (master)
$ git pull
There is no tracking information for the current branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.

git pull <remote> <branch>

If you wish to set tracking information for this branch you can do so with:

git branch --set-upstream-to=origin/<branch> master


kumar@DESKTOP-24PTARK MINGW64 /d/gitrails/check/hello-bitbucket (master)

Hi Grabalski,

Did u have a chance to look my above thread?

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events