You want to put your project on a remote Git repository like GitHub, Bitbucket, Gitlab or Gogs to share and collaborate?
Follow the following steps:
- Create a new repository on one of the git service quoted before and let it empty.
- In your terminal, go into your local project.
- Initialize the local repository as a Git repository:
git init
- Add the wanted files in the your local repository with
git add file
or add the entire repository withgit add .
. Files will be staged for the first commit. - Commit the staged files:
git commit -m "first commit"
. - In your terminal, add the URL of the remote repository:
git remote add origin https://example.com/examle.git
. - And push the changes to the remote Git repository:
git push -u origin master
.