1

I added a local existing git repo to github.com as a remote via the command

% git remote add origin https://github.com/username/synchm.git

and confirmed it with

% git remote -v
origin  https://github.com/username/synchm.git (fetch)
origin  https://github.com/username/synchm.git (push)

However when I log into github.com/username the new repository is not visible, not even after and hour.

I tried entering

https://github.com/username/synchm.git

but it redirected to

https://github.com/username/synchm.git

and returned a 404.

What's going on?

1

1 Answer 1

3

You must create the repository trough the github website and then push your local.

What you're doing is merely telling your local git configuration where the origin remote is located.

After creating the repository on github and setting the origin remote you still need to push your local branch before it will be visible on github. git push origin master (replace master with your current branch name).

Sign up to request clarification or add additional context in comments.

1 Comment

You are exactly right. As a point of interest only, creating on the github side is apparently also possible though github API, e.g. using curl as shown in (this answer)[stackoverflow.com/a/56099606/4376643].

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.