मैं वास्तव में गिट के लिए नया हूं और मैं यह समझने की कोशिश कर रहा हूं कि जब मैं एक शाखा में एक शाखा में परिवर्तन करता हूं तो git दिखाता रहता है जब मैं शाखाओं के बीच स्विच करने के लिए git चेकआउट चलाता हूं पहले मैंने git ऐड का उपयोग नहीं करने की कोशिश की और काम नहीं किया। हालाँकि, मैंने तब git ऐड का उपयोग करने की कोशिश की, लेकिन समस्या को ठीक नहीं किया। मैं अभी तक git कमिट का उपयोग नहीं कर रहा हूँ।
यह मूल रूप से मैं क्या कर रहा हूँ:
$ git clone <a_repository>
$ git branch
* master
$ git branch testing
$ git checkout testing
...edit a file, add a new one, delete...
$ git status
# On branch testing
# Changed but not updated:
# (use "git add/rm <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# deleted: file1.txt
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# file2.txt
no changes added to commit (use "git add" and/or "git commit -a")
$ git branch
master
* testing
$ git checkout master
D file1.txt
Switched to branch 'master'
$ git status
# On branch master
# Changed but not updated:
# (use "git add/rm <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# deleted: file1.txt
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# file2.txt
no changes added to commit (use "git add" and/or "git commit -a")
मैंने सोचा था कि शाखाओं का उपयोग करते समय, आप एक शाखा में जो भी करते हैं, वह अन्य सभी शाखाओं के लिए अदृश्य है। क्या वह शाखाएँ बनाने का कारण नहीं है?
मैंने "गिट ऐड" का उपयोग करने की कोशिश की, लेकिन दोनों शाखाओं में परिवर्तन दिखाई दे रहे हैं। क्या मुझे इससे बचने के लिए शाखाओं के बीच स्विच करने से पहले "गिट कमिट" चलाने की आवश्यकता है?