6

I want a branch to hold all the files from my master branch except for foo.txt and foo2.txt. How do I do this?

user678392
  • 1,981
  • 3
  • 28
  • 50

1 Answers1

14

You have to branch off from master. Check out a new branch and remove the files you do not want.

git checkout master

Once in master:

git checkout -b new_branch

rm foo.txt
rm foo2.txt

git add -u
git commit -m "removed foo and foo2"
git push origin new_branch
Joel
  • 4,503
  • 1
  • 27
  • 41