Git Tips: How to merge your branch with master

1. create branch (git checkout -b <branch name> )work on your branch. push it to your branch (git push origin <branch name>)
2. git pull origin master
3. resolve conflicts by checking the list of conflict files. The differences are showed like this –
<<<< HEAD
your code
=========
others code
<<<<<452345245435234245
4. commit changes to your branch
5. git checkout master (change to master branch locally)
6. git merge <your-branch> (merge with master locally)
7. git add . | git commit -m "merging master with <your-branch>| git push origin master

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s