when you have worked on a project locally and would like to have it hosted on either GitLab or GitHub, then follow these steps:
i. initialise your folder by running
git init .
ii. then add the contents of your folder
git add .
iii. now, you have to have a commit message e.g
git commit -m "initial commit"
iv. when you proceed directly and do a
git push origin main
you will get a
fatal: 'origin' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists.
error message.
v. you would want to proceed to your profile on either GitLab or GitHub, create a new repo and copy that said URL.
vi. after the copying of the URL, do this
git remote add origin <link to repo>
vii. finally, do a push
git push -u origin main
![setting up new project](https://private-user-images.githubusercontent.com/55446293/264983173-34a8ddb6-131c-45b5-8fde-bb057953ea54.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjEwODYyMzIsIm5iZiI6MTcyMTA4NTkzMiwicGF0aCI6Ii81NTQ0NjI5My8yNjQ5ODMxNzMtMzRhOGRkYjYtMTMxYy00NWI1LThmZGUtYmIwNTc5NTNlYTU0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzE1VDIzMjUzMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTc0OWJlNDc0YmFkNDA1Y2JmYjNkYmQ1YjA2ZTNiMGQ2ZGU1NzU4ZDY1MzU0N2QxMjQ1Zjg4OGE1YzkxZThhMzEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.yNw4pU5WdOcl7kMnRvA_jrMNLgZK5uGiTaAZm4Mswhc)