0
点赞
收藏
分享

微信扫一扫

4-4 哈夫曼编码

一葉_code 2023-06-08 阅读 43
gitgithub

Git命令

初始化一个新的 Git 仓库

git init

克隆一个远程 Git 仓库到本地

git clone 远程库URL

克隆指定分支

git clone -b master URL LocalURL

添加文件到 Git 暂存区

git add filename

提交暂存区中的文件到 Git 仓库

git commit -m "提交别名"

查看当前 Git 仓库的状态

git status

查看提交历史记录

git log 

log记录提交历史,reflog记录本地操作历史

git reflog

取消已经添加到暂存区的文件

git reset <file>

回退到head分支的上一个提交

git reset HEAD~1

撤销对文件的修改

git checkout <file>

列出当前 Git 仓库中所有的分支

git branch

创建一个新的分支

git branch <branch-name>

切换到指定的分支

git checkout <branch-name>

合并指定分支到当前分支

git merge <branch-name>

是brach-name里面装别的分支名,不需要装当前分支

删除指定的分支

git branch -d <branch-name>

推送本地分支到远程仓库

git push <remote> <branch>

remote(远程仓库名) brach(推送分支名)

拉取远程仓库的最新代码

git pull

查看本地 Git 配置信息

git config --list

修改本地 Git 配置信息

git config [--global] <key> <value>

查看 Git 帮助文档

git help

查看 Git 命令的帮助文档

git <command> --help
举报

相关推荐

0 条评论