git new repository上传

2021-12-07 19:05:44 浏览数 (1)

Command line instructions

Git global setup

代码语言:javascript复制
git config --global user.name "* *"
git config --global user.email "**@**.com"

New repository

代码语言:javascript复制
git clone ssh://git@***/***/abc.git
cd abc
touch README.md
git add README.md
git commit -m "add README"
git push -u origin master

Existing folder

代码语言:javascript复制
cd existing_folder
git init
git remote add origin ssh://git@***/***/abc.git
git add .
git commit -m "Initial commit"
git push -u origin master

Existing Git repository

代码语言:javascript复制
cd existing_repo
git remote rename origin old-origin
git remote add origin ssh://git@***/***/abc.git
git push -u origin --all
git push -u origin --tags

0 人点赞