2012-09-24 10 views
17

किसी विशेष शाखा पर git update-index --assume-unchanged path/to/file चलाने के बाद, मैं git checkout का उपयोग करके शाखाओं को स्विच करने में असमर्थ हूं।गिट चेकआउट --समम-अपरिवर्तित फ़ाइलों पर एक त्रुटि फेंकता है

error: Your local changes to the following files would be overwritten by checkout:

 path/to/file 

Please, commit your changes or stash them before you can switch branches.

Aborting

लेकिन दोनों git diff & git status मुझसे कहता है वहाँ कोई अंतर नहीं &/गुप्त कोष के लिए प्रतिबद्ध की कोई बात नहीं है:

यह निम्न त्रुटि फेंकता है।

मैं शाखा से कैसे बाहर निकल सकता हूं?

क्या git update-index --assume-unchanged (.gitignore के अलावा कोई बेहतर विकल्प है, क्योंकि मैं इसे अनदेखा नहीं करना चाहता)? (प्रश्न 2 @git update-index --no-assume-unchanged doesn't work के समान)

उत्तर

6

कुछ उपयोग के बाद अब मैं git update-index --skip-worktree पसंद करता हूं जो git update-index --assume-unchanged के लिए एक बेहतर विकल्प है।

अधिक जानकारी के लिए Difference Between 'assume-unchanged' and 'skip-worktree' देखें।

मैं this answer to git assume unchanged vs skip worktree - ignoring a symbolic link में निर्दिष्ट विधि को देखने की भी योजना बना रहा हूं, जो अधिक रक्षात्मक दृष्टिकोण प्रतीत होता है।

संबंधित मुद्दे