Answer the question
In order to leave comments, you need to log in
How to create a new branch and push (send) a file, ignoring the data in the branch from which we start?
How to create a new branch and push changes, ignoring the data in the branch from which we start? You need to add one file, 1 branch - 1 file. .gitignore does not help unfortunately.
Answer the question
In order to leave comments, you need to log in
git checkout --orphan=testbranch #create an empty branch
git rm -rf . #remove all current files
git clean -fdx #remove all files in the branch, including ignored and uncommitted ones
git checkout master — test.html #checkout a file from another branch
git commit -am 'initial commit' #commit
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question