git 常用命令

git log  -p --stat            ;查看log信息,详细信息
git diff             ;查看当前的修改

git format-patch -1  ;生成基于当前的commit head的一个patch

git format-patch -n commit_no; 生成基于commit_no的n个patch.

git am + patch_file  ;打补丁(patch)
git branch           ;查看分支


git checkout + branch_name ;切换分支
git checkout + commit_no + file_name; 获取指定commit_no的file.
git checkout + branch_name~number + file_name; 获取指定分支后退number个commit的文件。


git reset  HEAD^     ; 撤消前一次的commit, 保留原来的modified.
git reset --hard HEAD^ ; 撤消前一次的commit,不保留modified.


git commit -C HEAD -a --amend ;增补提交, 不会产生新的历史记录


repo format-patch + xxx.xml
-------
build patch sets for each project common to a manifest baseline


Usage: repo format-patch <baseline manifest file name>


Provide the manifest file name documenting the baseline


i.e. repo format-patch eclair-20091115.xml


Will generate the set of patches for each project that is common with
the baseline defined by the file eclair-20091115.xml.


Options:
  -h, --help            show this help message and exit
  -j, --json_summary    output a json summary of differences
  -o OUTPUTDIR, --outputdir=OUTPUTDIR
                        output the results in a specific place


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值