Link to existing github repository

I have created a repository on github and would now would like commit changes to this repository using git. I have a project file structure (created using heroku) to be commited. What steps are required in order to link an existing github repo with git ?

In the past I’ve used “github for windows” UI to create a github repository, this creates a file structure on my machine and as I update the file structure the changes are recognised.

  • using git read-tree without a work tree
  • bash: check if a particular git repository has github as remote repo?
  • git: Trying to re-create same repo but with some different files
  • Git push doesn't ignore files in .gitignore
  • Git Push Server doesn't update working branch
  • Git push Failed to connect to gitlab.com port 443: Bad access
  • But this new setup is a little different in that the project already exists and I want to link it to a new github repoistory.

  • So “tags” for versions and “branches” for new features?
  • Replace GitHub repository with a new Android Studio project while preserving old commits
  • .apk includes .git folder
  • How to restrict access to master branch on git
  • How can I rebase from a remote tag onto local master
  • Compilation error - package com.google.gson not found in Redhat “Openshift” application
  • One Solution collect form web for “Link to existing github repository”

    You need to add a new remote, pointing to github, and then push to it. The steps:

    1. Create repo on GitHub. Without a README, completely empty.

    2. In your existing repo: git remote add REMOTENAME URL. You could name the remote github, for example, or anything else you want. Copy the URL from the GitHub page of the repo you just created.

    3. Push from your existing repo: git push REMOTENAME BRANCHNAME. For example if you named your remote github and you want to push master to it, you would do git push github master

    Let me know if you need anything else.

    Git Baby is a git and github fan, let's start git clone.