Amazon Ad

Wednesday 9 July 2014

Merge Git Branch

Hi guys,

Today i am going to tell you the commands to merge your branch with your live branch. Assuming that you have two branches a. Test b. Live. Where Test branch has all the development files where as "Live" branch has the data of the live website. Here is how we can merge these two branches.

1. git pull origin test
2. git checkout live (in case the branch is not in local rep. then use git checkout -b live)
3. git branch (To check which branch is current branch. The live branch will be your current branch)
4. git add .
5. git commit -m "message"
6. git status
7. git merge test (Merge the live branch with test branch)
8. git pull origin live
9. git push origin live
10. git pull origin live

In case you want to pull all the live contents on to your local repository :
git reset --hard origin/test
This tells it to fetch the commits from the remote repository, and position your working copy to the tip of its master branch. The above command will replace all the local files from "test" branch with all the files on the Github remote branch "test".

Thanks
Ritesh

No comments:

Post a Comment

Comments are welcome, Please join me on my Linked In account

http://in.linkedin.com/pub/ritesh-tandon/21/644/33b

How to implement Captcha v3 in ASP.NET

 I was facing an issue of dom parsing in my website. I finally resolved it by using Google Captcha V3. Step 1: Get your keys from https:...