Git基本命令

Git是一种分布式版本控制系统,用于跟踪代码的更改并协作开发。下面是一些常用的Git基本命令:

设置用户签名

git config --global user.name lushanyanyv
git config --global user.email 1924884531@qq.com

获取软件配置信息

git config -l

初始化一个新的Git仓库:

git init
Git基本命令插图

查看当前文件状态:

git status
Git基本命令插图1

添加文件到暂存区:

git add <file>

删除暂存区文件

git rm --cached <file>

提交更改到本地仓库:

git commit -m "版本" <file>

日志

git reflog
git log

回滚

git reset --hard <版本>

克隆(拷贝)一个远程仓库到本地:

git clone <repository-url>

查看文件的具体更改:

git diff <file>

创建一个新的分支:

git branch <branch-name>

删除分支:

git branch -d <branch-name>

查看分支

git branch -v

切换到一个分支:

git checkout <branch-name>

合并指定分支到当前分支:

git merge <branch-name>

推送本地更改到远程仓库:

git push <remote> <branch>

拉取远程仓库的最新更改到本地:

git pull

查看远程地址

git remote -v
Git基本命令插图2

创建远程库别名

git remote <别名> <地址>

Git基本命令插图3

修改远程库别名

git remote rename <old-name> <new-name>

删除远程库

git remote rm <remote-name>
感谢观看Git基本命令,欢迎分享https://cn-lcx.cn/2023/08/03/git%e5%9f%ba%e6%9c%ac%e5%91%bd%e4%bb%a4/
暂无评论

发送评论 编辑评论


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
颜文字
Emoji
小恐龙
花!
上一篇
下一篇