git学习命令记录(自用)

git命令记录

Command Comment
git init [目录] 初始化[到哪个目录]
git status 查看当前状态
git add . 添加未提交的
git commit -m “注释信息” 提交并添加注释信息
git log [–pretty=oneline] 查看版本
git reset --head 版本标识 回溯
git reflog 查看历史操作
git clone 克隆远程仓库
git pull 拉取线上版本
git push 提交到线上仓库
ssh-keygen -t rsa -C “邮箱” 生成sshkey
git branch 查看分支
git branch branch_name 创建分支
git checkout branch_name 切换分支
git branch -d branch_name 删除分支
git merge 被合并的分支名 合并分支到本地

忽略文件

.gitignore /dic/ 过滤整个文件夹
*.zip 过滤所有zip文件
/dic/doc.txt 过滤某个具体文件
!index.php 不过滤具体某个文件

猜你喜欢

转载自blog.csdn.net/L333333333/article/details/104086955
今日推荐