入门专题-git

xiaoxiao2021-02-28  77

使命

版本管理

安装

网上由很对教程,不进行赘述

命令

基本命令

git clone url 克隆项目 git add 关联文件到git git commit 提交 git push 推送 git pull 更新 git status 查看状态

冲突解决

git pull 解决冲突 git commit git push

回退到过去某一版本

#hashid是提交编号

git log git reset --hard #hashid git reflog

合并

合并某分支到当前分支

git merge name

更新

git fetch 更新不合并,比pull更安全

git fetch origin master git log -p master..origin/master git merge origin/master

相当于

git fetch origin master:tmp git diff tmp  git merge tmp

git pull 更新并合并

git pull origin master

创建分支

创建分只并切换

git checkout -b develop

相当于

git branch develop git checkout develop

列出所有分支

git branch

里程碑/标签

描述信息message 名称name 提交idhashid

git tag -m  #message #name [#hashid]

暂存

暂存,查询暂存列表,回复缓存,缓存清理

git stash git stash list git stash apply git stash clear
转载请注明原文地址: https://www.6miu.com/read-38951.html

最新回复(0)