How to create a clean branch git?


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
7 views
I need to create a new clean branch, but since git is impossible, I choose the most popular configuration. Next, create a new branch with the command git checkout --orphan new-name and then make a minor change in any file and perform add and commit. Next, I will remove the file from, as I thought, a new branch, but it is removed from the branch from which I created the current one. Is this supposed to be? How to create a new clean branch in order not to repeat the above?
by | 7 views

2 Answers

0 like 0 dislike
git checkout --orphan newbranch git reset git commit --allow-empty-m "init"

Will create a new branch newbranch, independent of the current branches and with 1 empty commit.
by
0 like 0 dislike
git checkout-b branch_name...
by

Related questions

0 like 0 dislike
2 answers
asked Sep 3, 2019 by Fengol
0 like 0 dislike
2 answers
asked Jul 11, 2019 by Fengol
0 like 0 dislike
2 answers
asked Jul 8, 2019 by Fengol
0 like 0 dislike
1 answer
asked Apr 17 by RyanValen (550 points)
110,608 questions
257,186 answers
0 comments
27,920 users