Home>

Rails Tutorial 1.4.3 Bitbucket is tripping ...

◼︎Conclusion
If i try (2) after running (1) in the Cloud9 terminal, an error message (3) will be displayed.

# (1)
ec2-user: ~/environment/hello_app (master) $git remote add origin [email protected]: shogotagami/hello_app.git
# (2)
ec2-user: ~/environment/hello_app (master) $git push -u origin --all
# (3)
repository does not exist.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.

◼︎I've already done
・ Create a Bitbucket account and set ssh public key to the account
・ Create a repository with Bitbucket

I think that it is wrong at the fundamental point because there are multiple contents of the error.
I don't know the cause. .

I would appreciate it if you could teach me the lack of study.

  • Answer # 1

    I tried to mistake the git push settings on purpose.


    1.If you make a mistake in the repository name

    Createfoo_app


    foo_appCreate repository on Bitbucket

    Set origin to a non-existent bar_app repository
    git remote add origin [email protected]: shogotagami/bar_app.git

    git push -u origin --all

    repository does not exist.
    fatal: Could not read from remote repository.
    Please make sure you have the correct access rights
    and the repository exists.

    2.If you make a mistake with the remote settings

    Create foo_app

    Create foo_app repository

    Set origin to a nonexistent username
    git remote set-url origin [email protected]:sssssssshogotagami/foo_app.git

    git push -u origin --all

    repository does not exist.
    fatal: Could not read from remote repository.
    Please make sure you have the correct access rights
    and the repository exists.

    Both got the same error message.

    So the possibilities are

    1. Pushing to a non-existent repository
    Example: On Bitbucket, foo_app is pushing from Cloud9 to bar_app

    2.Pushing to a non-existent username
    Example: On Bitbucket, the username is shogotagami, but I set it to sssssssshogotagami in Cloud9

    is possible. There may be other possibilities, but this is about this because I am a beginner.
    How about checking the user name repository name in both Cloud9 and Bitbucket?

    Reference: Change the remote url of git (at the time of repository migration)

    https://qiita.com/minoringo/items/917e325892733e0d606e