git 仓库建立

您有一个空存储库

要开始,您需要在终端中运行这些命令。

首次配置 Git

git config --global user.name "xxx(10032106)"
git config --global user.email "zhaopp-a@glodon.com"

与存储库一起工作

我只想克隆这个存储库

如果您想简单地克隆此空存储库,请在终端中运行此命令。

git clone http://空仓库地址.git

我的代码已准备好被推

如果您已经准备好代码以推至此存储库,请在终端中运行此代码。

cd existing-project
git init
git add --all
git commit -m "Initial Commit"
git remote add origin http://空仓库地址.git
git push -u origin master

我的代码已被Git跟踪

如果您的代码已被 Git 跟踪,则将此存储库设置为要推送的"源"。

cd existing-project
git remote set-url origin http://空仓库地址.git
git push -u origin --all git push origin --tags
原文地址:https://www.cnblogs.com/PengZhao-Mr/p/14758746.html