Git¶
Git常用命令¶
-
取消git pull/push时频繁输入账号密码
Bash -
git出现^M符号
-
git error: object file xxx is empty
-
git 重命名分支
-
git commit后撤销commit:
-
git 取消add操作:
-
git reset --hard丢失改动信息,可在30天内通过
git reflog
查看改动与恢复 -
git stash 保存备注信息
Bash -
git stash 部分文件
借用git add实现
-
git 保存patch
-
git 应用patch
-
git 取消应用patch
Bash -
git fork分支后与原仓库保持同步
Bash -
git合并一个分支的指定commit到另一个分支
Bash -
git 分支绑定
Bash
Repo命令¶
- 同步:repo sync -c -> repo forall -c 'git lfs pull'
- 删除本地修改并同步:repo sync -d
-
repo 重新init前需要reset所有分支,去除所有改动
-
repo 全仓库回退到某个时间提交之前
Bash