git – branch PART 3

Read Part 1 and Part 2.

Git branch is a pointer to a snapshot of your changes, it represents the a series of commits. You should use it when you want to add a new feature or fix some bugs. Git branch is not a container for commits but a reference to commits.

  • git branch – list branches
git branch, <span>git – branch PART 3</span>, KandZ
  • git branch name – create a new branch
git branch, <span>git – branch PART 3</span>, KandZ
  • git branch -d name – delete a branch
git branch, <span>git – branch PART 3</span>, KandZ
  • git branch -D name – force delete a branch even if it has unmerged changes
  • git branch -m oldBranch newBranch – rename a branch
git branch, <span>git – branch PART 3</span>, KandZ
  • git branch -a – List both remote-tracking branches and local branches.
git branch, <span>git – branch PART 3</span>, KandZ
  • git checkout name – Switch to branch
git branch, <span>git – branch PART 3</span>, KandZ
  • git push repositoryName branchName – create remote branch
git branch, <span>git – branch PART 3</span>, KandZ
  • git push repositoryName –delete branchName – delete a remote branch
git branch, <span>git – branch PART 3</span>, KandZ

THE END!!!

90650cookie-checkgit – branch PART 3git – branch PART 3

Related posts