Suppose I have a local repository, I want to throw it on the github, I need to create an empty repository on the githaba, then make a gitclone on the computer, then move the project to this folder ... But this is a bad way, how can I connect an already existing repository with an empty githkhabovsky?
2 answers
For the local repository, add a remote repository:
git remote add origin git://github.com/<username>/<reponame>.git
Such commands can be added to the remote repository on the githaba, where origin is the name for the remote repository (there may be several). You can also do this using the https protocol:
git remote add origin https://github.com/<username>/<reponame>.git
|
You must copy the repository address ( github.com/example/rep.git ). In the local repository add a remote server:
git add remote origin github.com/example/rep.git
Then push all data
git push - all origin git push - tags
|
git remote add ...doesn't work for you? - PinkTux