V
V
Vadim2021-06-23 14:59:00
git
Vadim, 2021-06-23 14:59:00

What is the best way to split a branch in git into other branches by specific files?

Hello everyone, I have a

currentbranch branch from master, in which there are 3 modified and 3 added files, everything is

already committed : thus branch1: modified_file_1.tf new_file_1.tf branch2: modified_file_2.tf new_file_2.tf etc... which commands are better to do this? all the best, Vadim






Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
Lynn "Coffee Man", 2021-06-23
@Viji

# создаём новую ветку branch1 на основе master
git checkout -b branch1 master
# берём нужные файлы из currentbranch
git checkout currentbranch -- modified_file_1.tf new_file_1.tf
# коммитим
git commit

# повторяем для branch2/3/...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question