Question:
In Git version control, which command creates a new branch named ‘feature’ and immediately switches to it?
गिट (Git) वर्जन कंट्रोल में, कौन-सा कमांड ‘feature’ नाम से एक नई शाखा बनाता है और तुरंत उस पर स्विच करता है?
Options:
- git checkout -b feature
- git branch feature
- git merge feature
- git switch feature
- git checkout -b feature
- git branch feature
- git merge feature
- git switch feature
Correct Answer: a)
Explanation:
The flag `-b` with `git checkout` creates the branch if it doesn’t exist and switches the working tree to it: `git checkout -b feature` (or `git switch -c feature`) (Option a).
`git checkout -b feature` नई शाखा बनाकर तुरंत उस पर स्विच कर देता है (विकल्प a)।