git常用命令记录

简介:

Clone

git clone git@github.com:tangxuehua/eventsourcing.git

Pull

git pull

Commit & Push

git status
git add -A
git commit -a -m "commit detail"
git push

Pull-Request

http://www.worldhello.net/gotgithub/04-work-with-others/010-fork-and-pull.html

git add remote yourProject git@github.com:yourName/yourProject.git
git remote -v
git fetch yourProject
git branch -a
git merge yourproject/master
git log --graph -2

Pull-Request With Local Repos

http://stackoverflow.com/questions/5775580/git-pulling-changes-between-two-local-repositories

that's cool!

git add remote yourProject-local http://www.cnblogs.com/yourName/yourProject
git remote -v
git fetch yourProject-local
git branch -a
git merge yourProject-local/master

Link Commit to Issue

git commit -a -m "fix #1, other messages"

Add or Remove tags

View all tags: git tag
Add a new tag for the newest stable release: git tag -a v0.5 -m "Version 0.5 Stable"
Push the latest tag to GitHub (two dashes): git push --tags
Delete the v0.4 tag locally: git tag -d v0.4
Delete the v0.4 tag on GitHub (which removes its download link): git push origin :v0.4

Branch

create branch: git branch testingBranch
push branch to remote: git push origin testingBranch
view all the branches: git branch
switch branch: git checkout testingBranch
remove branch of local: git branch -D testingBranch
remove branch of remote: git push origin :testingBranch
refresh local branches from remote: git fetch -v --progress --prune origin
 

目录
相关文章
|
12天前
|
缓存 数据可视化 网络安全
Git命令大全
Git命令大全
45 1
|
16天前
|
开发工具 git
Git教程:深入了解删除分支的命令
【4月更文挑战第3天】
37 0
Git教程:深入了解删除分支的命令
|
1月前
|
存储 Shell Linux
【Shell 命令集合 文件管理】Linux git命令使用教程
【Shell 命令集合 文件管理】Linux git命令使用教程
34 0
|
1月前
|
开发工具 git
git常用命令整理
git常用命令整理
13 0
|
22天前
|
开发工具 git 开发者
Git常用命令大全:让你轻松驾驭版本控制
Git命令速查:`git init`新建仓库,`git clone`克隆,`git add`入暂存区,`git commit -m`提交,`git status`查看状态,`git log`查看历史,`git branch`创建分支,`git checkout`切换,`git merge`合并,`git pull`拉取更新,`git push`推送,`git remote -v`查看远程,`git checkout --`撤销本地修改,`git reset HEAD`取消暂存,`git reset --hard`回退版本。掌握这些,提升代码管理效率!
18 0
|
1天前
|
存储 Linux 开发工具
Git 分布式版本控制系统基本概念和操作命令
Git 分布式版本控制系统基本概念和操作命令
16 0
|
3天前
|
算法 Java BI
云效产品使用报错问题之平台上导出的统计数据和 git 中使用命令导出的数据统计都对不上,如何解决
本合集将整理呈现用户在使用过程中遇到的报错及其对应的解决办法,包括但不限于账户权限设置错误、项目配置不正确、代码提交冲突、构建任务执行失败、测试环境异常、需求流转阻塞等问题。阿里云云效是一站式企业级研发协同和DevOps平台,为企业提供从需求规划、开发、测试、发布到运维、运营的全流程端到端服务和工具支撑,致力于提升企业的研发效能和创新能力。
|
29天前
|
算法 开发工具 git
【git 实用指南】git 增加 本地代码 git add 相关命令和复杂情况需求
【git 实用指南】git 增加 本地代码 git add 相关命令和复杂情况需求
92 0
|
1月前
|
Shell Linux 开发工具
【Shell 命令集合 系统管理 】Linux 查看当前Git仓库的提交历史 gitps命令 使用指南
【Shell 命令集合 系统管理 】Linux 查看当前Git仓库的提交历史 gitps命令 使用指南
16 0
|
1月前
|
开发工具 git
git命令使用大全
git命令使用大全
20 1

相关实验场景

更多