1、git stash 的用法
Git提供了一个git stash命令可以将当前未提交的修改先暂时储藏起来,这样工作区干净了后,就可以切换分支
# 工作区的修改和暂存区的修改先暂时储藏起来,这样工作区就干净
git stash
# 将储藏的修改取出来,继续进行新功能的开发,取出最近一次储藏的修改到工作区中,并同时将该储藏从储藏记录列表中删除
git stash pop
# 针对 修改-储藏-再修改-再储藏 的情况
# 查看储藏记录列表
git stash list
# 通过打 标签的方式 保存
git stash save [stashMessage]
eg:
git stash save 'add log'
git stash list
stash@{0}: On (no branch): add log
# 取出指定index的储藏的修改到工作区中
git stash apply stash@{index}
# 将指定index的储藏从储藏记录列表中删除
git stash drop stash@{index}
eg:
git stash apply stash@{0}
git stash list
stash@{0}: On (no branch): add log
git stash drop stash@{0}
Dropped stash@{0} (e17275310f0a44a6dff9c5c4489bf19da92ec72b)
git stash list
2、git remote 的用法
git remote 命令用于在远程仓库的操作
$ git clone https://github.com/tianqixin/runoob-git-test
$ cd runoob-git-test
$ git remote -v
origin https://github.com/tianqixin/runoob-git-test (fetch)
origin https://github.com/tianqixin/runoob-git-test (push) # origin 为远程地址的别名