> For the complete documentation index, see [llms.txt](https://hemantajax-2.gitbook.io/git-basics/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hemantajax-2.gitbook.io/git-basics/branching.md).

# Branching

```
git branch // show all branch
git branch -v // branches with some more details
```

## Create Branch

```
git branch myBranch ( create branch )
git checkout myBranch ( switch to myBranch )

// OR
git checkout -b myBranch ( create & switch to that branch )
```

## Branch merging

Go to the branch in which you want to merge another branch

```
// in dev branch & want to merge dev branch to master
git checkout master
git merge dev ( if master have no change , than all is well, else their may be conflict)
```

## Have conflict

```
git status ( show all files in red that have conflict )
git diff mydir/abc.txt ( show difference in command line )

// OR open file and resolve conflict manually
```
