repo—git入门使用

来源:互联网 发布:淘宝类目在线查询 编辑:程序博客网 时间:2024/05/16 07:51

repo统一管理多个git仓库

repo init -u URL 当前目录下安装仓库,生成.repo

.repo/manifest.xml 指向TAG

repo sync 更新下载 ==> * (no branch)

repo start master –all ( git branch - * (no branch) => master)

repo branch 查看项目下所有存在分支

git clone url 克隆代码仓库 : git checkout + branch_name 下载

git status 状态

git branch 分支名 -创建

git checkout 分支名 -切换

git branch -a 查看当前仓库所有的分支

git add 添加git管理中 当前下所有 .

git checkout – filename 去除修改 不做commit

git commit -a -m “” 强制 注释上传

git commit –amend 附加上一个commit 。可修改 注释 change-id

修改 git 默认编辑器nano 为 vim :git config –-global core.editor vim

git reset –mixed HEAD~2 回退2步

git merge 分支名 与当前分支合并

git remote 查看远程仓库

git fetch 远程仓库名 抓取远程仓库所有数据 / git merge 远程分支 :本地分支 /git rebase 远程分支名

gerrit 提交 gerrit push 远程仓库名 本地分支名:refs/for/远程分支名

1 0