![](/style/images/good.png)
5
![](/style/images/bad.png)
Git配置和常用命令
source link: https://panda843.github.io/article/3737903822.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Git配置和常用命令
发表于 2017-12-27 | 分类于 其他 | | 浏览2 次 | 字数统计: 1.8k | 阅读时长 ≈ 7
Git是一个分布式版本控制/软件配置管理软件,原来是linux内核开发者林纳斯·托瓦兹(Linus Torvalds)为了更好地管理linux内核开发而创立的。
Git配置
git config --global user.name "yourname" |
#用户的git配置文件在~/.gitconfig |
查看帮助命令
git help <command> # 显示command的help |
查看提交记录
git log |
添加、提交、删除、找回,重置修改文件
git co -- <file> # 抛弃工作区修改 |
查看文件diff
git diff <file> # 比较当前文件和暂存区文件差异 |
查看、切换、创建和删除分支
git br -r # 查看远程分支 |
分支合并和rebase
git merge <branch> # 将branch分支合并到当前分支 |
Git补丁管理
git diff > ../sync.patch # 生成补丁 |
Git暂存管理
git stash # 暂存 |
Git远程分支管理
git pull # 抓取远程仓库所有分支更新并合并到本地 |
Git远程仓库管理
git remote -v # 查看远程服务器地址和仓库名称 |
打patch过程
git status |
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK