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

Next challenges

Recent achievements


  • Give kudos
  • My kudos


  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

how I can push the content of my local repository to online git repository?

Hi everyone

First I tried to sync my local repo with online bitbucket but I don't know that should i add git clone before URL as well or I just have to add URL( git remote add origin <URL>) or

( git remote add origin git clone <URL>)

Second when i tried to pushed the content of my local repository to online git repository its showing errors with some hints like:

git pull before pushing again

see the note about fast forward

1 answer

@Hamza_Baig , 

Sorry for the delayed answer.

If it is a new repository without any content these steps should help:

Perform these steps inside the project directory

  1. Initiate it as a Git repository by running these commands
    git init
    git add --all
    git commit -m "Message about your commit"
  2. Copy the URL for your empty repository in Bitbucket.
  3. Set the remote URL for your repository and push your initial commit
    git remote add origin <the URL for your Bitbucket repository>. 
    For e.g.
    git push -u origin master


In case of an existing Bitbucket Cloud repository these tutorials will answer your questions:

Cheers :)

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Bitbucket

Powering DevOps with Bitbucket Server & Data Center

Hi everyone, The Cloud team recently announced 12 new DevOps features that help developers ship better code, faster   ! While we’re all excited about the new improvements to Bitbucket ...

1,914 views 0 7
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you