How to push code to gitlab

In this article let’s discuss about How to push code to gitlab. Let’s go through the following methods without any delay.

Method 1:

cd existing_repo
git init
git remote add origin
git branch -M main
git add .
git commit -m "Initial commit"
git push -uf origin main

If you are facing any issues with the above approach then try the alternative that is given below. It may look similar by have a try!

Method 2 :

## Git push using SSH
git push --set-upstream master

## Git push using HTTPS
git push --set-upstream master

Hope the above solution works.

Realted Posts : How to create zip file ubuntu