最近開始學習git
但有點搞不懂他對分支中刪除檔案的定義
我原本在 master
把一個檔案加入追蹤 ( git add test.txt )
然後commit ( git commit -m "master" )
接著創建並切換到分支 develop ( git checkout -b develop master )
然後在develop中刪掉這個檔案 ( rm test.txt )
這時候如果我不做其他事情就切換回 master ( git checkuot master )
發現master的 text.txt檔案也被砍了!?
即使我先在develop做了commit ( git commit -m "delete test" )
然後再切換回master 也一樣該檔案不見
---
我看教學上的想法是所有在develop裡面做的更動
直到我回master下git merge指令前,都不會動到master裡面的東西
請問是我的想法錯了嗎?
還是我的指令下的不對呢
--
Insanity is doing the same thing over and over again while expecting a
different outcome.
--
但有點搞不懂他對分支中刪除檔案的定義
我原本在 master
把一個檔案加入追蹤 ( git add test.txt )
然後commit ( git commit -m "master" )
接著創建並切換到分支 develop ( git checkout -b develop master )
然後在develop中刪掉這個檔案 ( rm test.txt )
這時候如果我不做其他事情就切換回 master ( git checkuot master )
發現master的 text.txt檔案也被砍了!?
即使我先在develop做了commit ( git commit -m "delete test" )
然後再切換回master 也一樣該檔案不見
---
我看教學上的想法是所有在develop裡面做的更動
直到我回master下git merge指令前,都不會動到master裡面的東西
請問是我的想法錯了嗎?
還是我的指令下的不對呢
--
Insanity is doing the same thing over and over again while expecting a
different outcome.
--
All Comments