git上传代码(第一次或已有代码)

Command line instructions

You can also upload existing files from your computer using the instructions below.

Git global setup

git config --global user.name “xxx”
git config --global user.email “xxxxxxxx”

Create a new repository

git clone https://git.xxxx.com/innovation/aiprojects/ai_group/xxxxxx.git
cd xxxx
touch README.md
git add README.md
git commit -m "add README"

Push an existing folder

cd existing_folder
git init
git remote add origin https://git.xxxx.com/innovation/aiprojects/ai_group/xxxxxx.git
git add .
git commit -m "Initial commit"

Push an existing Git repository

cd existing_repo
git remote rename origin old-origin
git remote add origin https://git.xxxx.com/innovation/aiprojects/ai_group/xxxxxx.git

你可能感兴趣的:(git)