To stage files, you can use git add <file>
.
To unstage files, you can use git restore —staged <file>
We already know how to do this. Doing git branch newImage will create copy of a branch that is in the same state as the starting branch.
This is after git commit
.
It would commit to main branch since we haven’t checkout newImage branch after creating it
You can do Git checkout newImage; git commit;
This would checkout newImage branch and update the branch with new commit if applicable.
git checkout bugFix; git merge main
This would merge main into bugFix.