git基本命令

发布时间:2023年12月20日

你有一个空的仓库

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

第一次使用Git??学习基本的Git命令

第一次配置Git

git config --global user.name "你的名字"
git config --global user.email "你的邮箱"

使用您的存储库

我只想克隆这个存储库

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

git clone https://******.git
我的代码已经准备好推送

如果你代码已经准备好推送到仓库,请在终端中执行该命令

cd existing-project
git init
git add --all
git commit -m "Initial Commit"
git remote add origin https://****/***.git
git push -u origin master
我的代码已经由Git跟踪

如果你的代码已经由Git跟踪,然后设置这个仓库作为你的“origin”推送。

cd existing-project
git remote set-url origin https://****/****.git
git push -u origin --all
git push origin --tags
文章来源:https://blog.csdn.net/lihuifen2011/article/details/135077677
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。