Please refer below link

https://git-scm.com/book/en/v2/Git-Branching-Basic-Branching-and-Merging

https://www.atlassian.com/git/tutorials/using-branches/git-merge