Git global setup
git config --global user.name "Xiaoqiang Zhang"
git config --global user.email "[email protected]"
Create a new repository
git clone [email protected]:zhang_XQ/data_processing.git
cd data_processing
git switch -c main
touch README.md
git add README.md
git commit -m "add README"
git push -u origin main
Push an existing folder
cd existing_folder
git init --initial-branch=main
git remote add origin [email protected]:zhang_XQ/data_processing.git
git add .
git commit -m "Initial commit"
git push -u origin main
这里需要输入gitlab登入用户名和密码:
如果输入错误,则需要重新设置
git config --system --unset credential.helper
git config --global credential.helper store
Push an existing Git repository
cd existing_repo
git remote rename origin old-origin
git remote add origin [email protected]:zhang_XQ/data_processing.git
git push -u origin --all
git push -u origin --tags