git and repo
在网上我大把介绍git的教程与原理在这里便不做详细的介绍了·在这里我主要做的是对git做一些笔录
- 安装git
sudo apt-get install git
- 配置用户信息
git config --global user.name "*****"
git config --global user.email "*****"
git init
- 在工作目录中初始化新仓库
git init
- 检查当前文件状态
git status
- 添加新文件
git add readme.txt
git add -A
- 提交更新
git commit -m "****" //***为你的标记
- 查看提交历史
git log
- 分支的新建
git checkout -b [branch]
- 查看分支
git branch
- 将提交从一个分支拉到另一个分支
git cherry-pick [commit id]
- 将另外一个分支并到当前分支
git checkout [current branch]
git merge [branch]
至于如何链接服务器,可以参考 git使用系列(1)-使用SSH密钥连接Github【图文教程】
git的远程操作
- 从服务器上抓code
git clone *******
- 查看远端
git remote -v
- 查看所有分支
git branch -a
- 查看远端分支
git branch -r
- 跟踪远端工作目录
git pull
Repo
它是 Google 开发的用于管理 Android 版本库的一个工具·它只是用python对git进行了封装·
因为我们无法访问google的网站,因此在没有代理的情况下基本上算是用不到了吧·
- 同步项目
repo sync -c -d
- 建立本地分支
repo start <newbranch>
- 检查状态
repo status