美文网首页
git系列4-保存到暂存区

git系列4-保存到暂存区

作者: 蕴重Liu | 来源:发表于2019-07-12 11:11 被阅读0次

git stash
然后就可以切换分支
git stash pop

这样就可以不commit也切换分支

lyq@DESKTOP-40030BI MINGW64 ~/workspace/CTFS-BS (feature-course)
$ git status
On branch feature-course
Your branch is ahead of 'origin/feature-course' by 29 commits.
  (use "git push" to publish your local commits)

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

        modified:   app/commbobox_data/api.py
        modified:   app/commbobox_data/service.py
        modified:   app/db.py
        modified:   app/device/service.py
        modified:   app/wrappers.py
        modified:   manage.py

Untracked files:
  (use "git add <file>..." to include in what will be committed)

        avatar/

no changes added to commit (use "git add" and/or "git commit -a")
(base)
lyq@DESKTOP-40030BI MINGW64 ~/workspace/CTFS-BS (feature-course)
$ git stash
Saved working directory and index state WIP on feature-course: 34efd85 Merge branch 'develop' of chain-gitlab:CTFS_Group/CTFS-BS into feature-course
(base)

lyq@DESKTOP-40030BI MINGW64 ~/workspace/CTFS-BS (bugfix-kafka)
$ git checkout feature-course
Switched to branch 'feature-course'
Your branch is ahead of 'origin/feature-course' by 29 commits.
  (use "git push" to publish your local commits)
(base)

lyq@DESKTOP-40030BI MINGW64 ~/workspace/CTFS-BS (feature-course)
$ git stash pop
On branch feature-course
Your branch is ahead of 'origin/feature-course' by 29 commits.
  (use "git push" to publish your local commits)

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

        modified:   app/commbobox_data/api.py
        modified:   app/commbobox_data/service.py
        modified:   app/db.py
        modified:   app/device/service.py
        modified:   app/wrappers.py
        modified:   manage.py

Untracked files:
  (use "git add <file>..." to include in what will be committed)

        avatar/

no changes added to commit (use "git add" and/or "git commit -a")
Dropped r

相关文章

网友评论

      本文标题:git系列4-保存到暂存区

      本文链接:https://www.haomeiwen.com/subject/esqekctx.html