Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create a local repository and remote repository in Gitlab using command line?

Tags:

git

gitlab

I have created one project. I want to store my project in Gitlab. How to create a local repository and remote repository in Gitlab using command line? I am looking for creating both local repository and remote repository creation.

I got the solution. Steps to create Local repository and remote repository using Gitlab.

  1. git init(Local repository created)
  2. git add .
  3. git commit -m "message"
  4. Git push using SSH(Remote repository created):

git push --set-upstream [email protected]:your-username/nonexistent-project.git master

Git push using HTTP:

git push --set-upstream https://gitlab.example.com/your-username/nonexistent-project.git master
like image 415
Gobind Avatar asked Aug 12 '18 17:08

Gobind


People also ask

What git command is used to create a local repository of the remote?

To add a new remote, use the git remote add command on the terminal, in the directory your repository is stored at. The git remote add command takes two arguments: A unique remote name, for example, “my_awesome_new_remote_repo”


1 Answers

Steps to create Local repository and remote repository using Gitlab.

  1. git init(Local repository created)
  2. git add .
  3. git commit -m "message"
  4. Git push using SSH(Remote repository created):

    git push --set-upstream [email protected]:namespace/nonexistent-project.git master
    

    Git push using HTTP:

    git push --set-upstream https://gitlab.example.com/namespace/nonexistent-project.git master
    
like image 199
Gobind Avatar answered Oct 05 '22 08:10

Gobind