Wednesday, December 13, 2017

GitLab Commands


After create a new repository on gitlab, it usually gives below command line instructions.

Git global setup
git config --global user.name "Jim Zhao"
git config --global user.email "jim@example.com"

Create a new repository
git clone https://gitlab.com/jimzhao/test.git
cd test
touch README.md
git add README.md
git commit -m "add file"
git push -u origin master

Existing folder
cd existing_folder
git init
git remote add origin https://gitlab.com/jimzhao/test.git
git commit -m "init message"
git push -u origin master

Existing Git repository
cd existing_repo
git remote rename origin old-origin
git remote add origin https://gitlab.com/jimzhao/test.git
git push -u origin --all
git push -u origin --tags


No comments:

Post a Comment