Here are the steps to connect existing git repository to local folder
- Create GIT repository on github, gitlab, bitbucket or any provider of your choice.
- Goto to your project folder and open it into terminal.
- Initialize existing local directory as a Git repository by this command.
git init
- Add all of your files into git this stages them for the first commit.
git add .
- Commit the files that you’ve staged in your local repository.
git commit -m "Your commit message"
- Connect local folder to GIT url.
git remote add origin remote {{repository URL}}
- Once its connected, you can push your code
git push -u origin master