Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

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

Deleted user May 8, 2020

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

0 votes
Joao Sgreccia
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 1, 2020

@[deleted] , 

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@bitbucket.org:example_workspace/example_repo_name.git
    git push -u origin master

         

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

https://confluence.atlassian.com/bitbucket/copy-your-git-repository-and-add-files-746520876.html

https://www.youtube.com/watch?v=lYkghPud4dA

Cheers :)

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events