Follow the steps below add git remote origin to your local app :
- Use git init to create a new local repository.
- Add files and perform a git commit.
- Obtain the Git URL of the remote repo.
- Issue the git remote add origin command.
- Use the git push command to upload your files.
Commands are:
git init
git add --all
git commit -m "test_msg"
copy remote URL from Git
git remote add origin https://github.com/<user>/learnCAP.git
git push -u origin master
What if the remote repo isn't empty?
If it shows the error of conflicts or asks to pull if the remote is not empty and you don't want to pull as it is a fresh repo then you can force this via the force option below:
git push -u -f origin master
Hope it will help !!
Cheers
Kapil