Skip to content

Instantly share code, notes, and snippets.

@Shaz3e
Last active April 30, 2023 15:01
Show Gist options
  • Save Shaz3e/955b3371f1e5fbfc76206ebf28df83df to your computer and use it in GitHub Desktop.
Save Shaz3e/955b3371f1e5fbfc76206ebf28df83df to your computer and use it in GitHub Desktop.
5 Commands to add an existing project to GitHub

Use the following command to initialize the repository

> git init

Use the following command to index repository

> git add .

Use the following command to commit into repository

> git commit -m "Add existing project files to Git"

Use the following command to connect to the existing repository

> git remote add origin https://github.com/username/repository-name.git

Use the following command to push the local directory into repository

> git push -u -f origin master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment