git worktree 实际使用
Create
1.mkdir Connect_Backend_Database
2. cd Connect_Backend_Database
3. git clone url main
4. cd main
5. git worktree add -b v5 ../v5 origin/v5
6. git worktree add -b v6 ../v6 origin/v6
7. git worktree list
Clean
1.cd Connect_Backend_Database/main
2. rm -rf ../v5
3. rm -rf ../v6
4. git worktree prune
5. git worktree list
https://git-scm.com/docs/git-worktree
You are in the middle of a refactoring session and your boss comes in and demands that you fix something immediately. You might typically use git-stash[1] to store your changes away temporarily, however, your working tree is in such a state of disarray (with new, moved, and removed files, and other bits and pieces strewn around) that you don’t want to risk disturbing any of it. Instead, you create a temporary linked working tree to make the emergency fix, remove it when done, and then resume your earlier refactoring session.
$ git worktree add -b emergency-fix ../temp master $ pushd ../temp # ... hack hack hack ... $ git commit -a -m 'emergency fix for boss' $ popd $ git worktree remove ../temp
- GitHub版本控制使用(命令行实际操作图解Git使用方法)
- 实际开发中Git的使用总结
- 实际开发中使用Git流程
- Git本地项目上传 & SourceTree & GitHub 简单使用
- 通过实际的操作练习学习git的使用(四)
- [git] fatal: This operation must be run in a work tree
- 【git】fatal: This operation must be run in a work tree
- GIT_DIR和GIT_WORK_TREE的妙用,工作区和仓储可隔离
- 再也不用克隆多个仓库啦!git worktree 一个 git 仓库可以连接多个工作目录
- Git Bash出现 fatal: This operation must be run in a work tree
- Git使用之SourceTree
- Git实际使用
- Git系列之二 --- git-dir & work-tree
- Git 实际使用总结
- 第一次实际地使用git
- Git系列之二 --- git-dir & work-tree
- git clone故障:fatal: could not create work tree dir 'project'.: ????
- 实际开发git使用流程
- Git 实际开发中的使用