大战熟女丰满人妻av-荡女精品导航-岛国aaaa级午夜福利片-岛国av动作片在线观看-岛国av无码免费无禁网站-岛国大片激情做爰视频

Git教程
Git標簽管理
Git分支
Git操作
Git應用
GitHub應用
IDEA對于Git&GitHub的支持
Git與GitHub使用注意事項

Git隱藏(Stash)操作

假設您正在為產品新的功能編寫/實現代碼,當正在編寫代碼時,突然出現軟件客戶端升級。這時,您必須將新編寫的功能代碼保留幾個小時然后去處理升級的問題。在這段時間內不能提交代碼,也不能丟棄您的代碼更改。 所以需要一些臨時等待一段時間,您可以存儲部分更改,然后再提交它。

在Git中,隱藏操作將使您能夠修改跟蹤文件,階段更改,并將其保存在一系列未完成的更改中,并可以隨時重新應用。

$ git status
On branch master
Your branch is up-to-date with 'origin/master'.

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

        modified:   main.py

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

現在,要切換分支以進行客戶升級,但不想提交一直在做的工作; 那么可以把當前工作的改變隱藏起來。 要將一個新的存根推到堆棧上,運行git stash命令。

$ git stash
Saved working directory and index state WIP on master: ef07ab5 synchronized with the remote repository
HEAD is now at ef07ab5 synchronized with the remote repository

現在,工作目錄是干凈的,所有更改都保存在堆棧中。 現在使用git status命令來查看當前工作區狀態。

$ git status
On branch master
Your branch is up-to-date with 'origin/master'.

nothing to commit, working directory clean

現在,可以安全地切換分支并在其他地方工作。通過使用git stash list命令來查看已存在更改的列表。

$ git stash list
stash@{0}: WIP on master: ef07ab5 synchronized with the remote repository

假設您已經解決了客戶升級問題,想要重新開始新的功能的代碼編寫,查找上次沒有寫完成的代碼,只需執行git stash pop命令即可從堆棧中刪除更改并將其放置在當前工作目錄中。

$ git status -s

Administrator@MY-PC /D/worksp/sample (master)

[jerry@CentOS project]$ git stash pop

上述命令將產生以下結果:

$ git stash pop
On branch master
Your branch is up-to-date with 'origin/master'.

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

        modified:   main.py

no changes added to commit (use "git add" and/or "git commit -a")
Dropped refs/stash@{0} (e713780380632c142ed5833a9087aca883a826fa)

Administrator@MY-PC /D/worksp/sample (master)

$ git status
On branch master
Your branch is up-to-date with 'origin/master'.

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

        modified:   main.py

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

可以看到,工作區中修改的文件(main.py)又顯示了。現在我們就可以繼續編寫上次編寫了未完成的代碼。

全部教程
主站蜘蛛池模板: 日韩欧美视频在线一区二区 | 国产精品乱码高清在线观看 | 国产一级片毛片 | 日本在线视频毛片 | 国产玖玖玖精品视频 | 精品资源在线 | 免费一级a毛片在线播出 | 国产69精品久久久久99 | 国产精品女仆装在线播放 | 久久这里| 亚洲无成人网77777 | 久久www免费人成看片入口 | 国产精品99久久久久久人 | 日日夜人人澡人人澡人人看免 | 在线观看中文字幕亚洲 | 天天干天天拍天天射 | 国产亚洲欧美日韩综合另类 | 日韩女人做爰大片 | 久草在线在线精品观看 | 北条麻妃手机在线观看 | 老子影院午夜精品欧美视频 | 国产亚洲自拍一区 | 久久乱码精品区中文字幕 | 久久青草免费视频 | 波多野结衣一区二区三区高清在线 | 久久精品国语 | 欧美5o老妇性xxx | 日本国产精品 | 热久久国产欧美一区二区精品 | 日本夜夜夜 | 丁香午夜| 欧美日韩乱码毛片免费观看 | 婷婷综合久久中文字幕 | 久久久久久久久久久观看 | 奇米影视在线 | 久久久国产99久久国产一 | 日韩有码在线视频 | 国产福利视精品永久免费 | 亚洲国产精品悠悠久久琪琪 | 97超级碰碰碰碰精品 | 四虎免费视频 |