I am new to git, initially I only worked on the main branch and then read a little about git branching, and I was amazed at its power, so I started using branches in my workflow
when I started with branching, my main branch was clean so as not to commit anything. Then I created a new feature1 branch
git checkout -b feature1
i made my changes in the feature1 branch, added some js and css files. Then I created another branch from the master branch without making changes to the feature1 branch as follows:
git checkout master git checkout -b feature2
I added another code to the feature2 branch and added some new css files, and then again created another feature3 branch from the wizard with commit changes in the feature2 branch as follows:
git checkout master git checkout -b feature 3
I added new code to the feature3 branch with 1 new css file. now that i have done:
git status
I have a list of all the files that I changed but did not commit in all three branches. I expected that I would only get a list of files changed in the current branch ie feature3 , now I do not remember which files I created in which branch.
Can someone please help me list only the files that I created or changed in a particular branch and commit them. to the corresponding branches.
For instance,
list all files modified or created in the Feature1 branch, and transfer them to the feature1 branch and do it with all three branches.
I also want to know how I can create a branch from the master branch without getting other files that were changed in another branch but were not committed. i.e. I want the new branch to be an exact clone of the commit writer.
source share