Thursday, June 27, 2019

How to upload an existing project to Gitlab

1. Visit Gitlab site and create a new project following the online instructions

2. Install git on your local computer

3. Configure git username & email
git config --global user.name "username"
git config --global user.email "myemail@example.com"

4. Initialize git in your project directory and upload files
cd your_project_dir
git init
git remote add origin https://gitlab.com/myusername/myproject.git
git add .
git commit -m "Initial version"
git push -u origin master

In case it fails with a rejection you may need to execute "git pull" first and then "git push" as per above.

No comments:

Post a Comment