0

I am very new to bitbucket and linux. I am trying to upload files from my local to bitbucket. I tried the following command:

git commit -m 'commit to master'
git push -u origin 'master'

Then I got an error like

fatal: 'origin' does not appear to be a git repository fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists.

Then I tried

git remote add origin ssh://[email protected]:mjsofttechindia/project.git
git push origin master

Then I got an error like

ssh: Could not resolve hostname
bitbucket.org:yourname: Name or service not known fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists.

Please help. I don't know if this is correct or not. Please help me.

2
  • 1
    You have a colon : after bitbucket.org, it should be a forward slash / Commented Oct 17, 2017 at 11:48
  • 1
    It's either [email protected]:mjsofttechindia/project.git or ssh://[email protected]/mjsofttechindia/project.git Commented Oct 17, 2017 at 14:54

1 Answer 1

2

Change remote url to

ssh://[email protected]/mjsofttechindia/project.git

git remote set-url origin ssh://[email protected]/mjsofttechindia/project.git

Then you have to configure your name and email address (the one that you created your Bitbucket account with) in your local repository

git config user.name "Your Name"

git config user.email "[email protected]"

Then do a push again

git push -u origin master
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.