Initial loading of a website on github

I installed Git on my server and successfully connected to Github. Now I want to upload my site (which has already been developed) to Github to start version tracking. However, I have a problem with this.

I signed up with Github and created an empty repository with a readme file.

I went to my server and created id_rsa.pub I copied the contents of id_rsa.pub with cat and put the key in my github account.

Now I want to push my site to the repository on Github.

However, I cannot get it to work. Please can someone give me a step-by-step guide? This is the initial boot from the server on Github.

When i do

git push -u origin master

I'm coming back:

To git@github.com:<github-username>/<github-repo-name>.git
! [rejected] master → master (without fast-forwarding)
Error: several links to could not be pressed git@github.com:<github-username>/<github-repo-name>.git
To prevent loss of history, updates without redirection were canceled. Add the remote changes again (e.g. git pull). For more information, see the "Quick Navigation Note" section git push --help.

When i do

git pull

I'm coming back:

Information about the current branch is missing. please indicate which branch you want to merge with. See git-pull (1) for more details.

git pull <remote> <branch>

If you want to set tracking information for this thread, you can do this with:

git branch --set-upstream master <remote>/<branch>
+3
source share
2 answers

First you need:

git pull origin masterto make changes from the server.

Then it git push origin masterwill work.

, readme git init clone.

readme github , readme - , . , github, github.

+2

, github :

Git Repo?

cd existing_git_repo
git remote add origin git@github.com:<github-username>/<github-repo-name>.git
git push -u origin master
+1

All Articles