Linking an Existing Project to a Git Remote

If you did not create your project from a Git repository, you can link an existing project to a Git remote (for example, git@github.com:username/repo.git) so that you can push and pull your code.

  1. Launch a new session.
  2. Open a terminal.
  3. Enter the following commands:

    Shell

    git init
    git add * 
    git commit -a -m 'Initial commit' 
    git remote add origin git@github.com:username/repo.git 

    You can run git status after git init to make sure your .gitignore includes a folder for libraries and other non-code artifacts.