Answers for "how to copy main branch to another branch"

1

copy from master to branch

#If you can use: git merge 
git checkout old_branch.
git checkout master . #With period
git add --all
git commit -m "Copy from master to old_branch"
git push -u origin old_branch
Posted by: Guest on October-19-2021
2

git copy file from another branch

git checkout <commit_hash> <relative_path_to_file_or_dir>
git checkout <remote_name>/<branch_name> <file_or_dir>
Posted by: Guest on June-16-2020
0

git copy file from another branch

git show commit_id:path/to/file > path/to/file
Posted by: Guest on June-16-2020
-1

copy branch to master

git checkout master.
git checkout branch_from_which_you_have_to_copy_the_files_to_master . (with period)
git add --all.
git push -u origin master.
git commit -m "copy from branch to master"
Posted by: Guest on November-26-2020

Code answers related to "how to copy main branch to another branch"

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language