How to copy from master to branch

In this article let’s discuss about How to copy from master to branch. Let’s go through the following methods without any delay.

Method 1:

#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

If you are facing any issues with the above approach then try the alternative that is given below. It may look similar by have a try!

Method 2 :

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"

Hope the above solution works.

Realted Posts : How to combine commands bash