Skip to content
This repository has been archived by the owner on Jul 18, 2022. It is now read-only.

Useful Git Commands

Benjamin Bach edited this page Sep 8, 2016 · 4 revisions

The master branch is the public one, where things are working. The dev branch is the one under general development and testing.

Create and delete Branches

Create and switch to branch:

$ git checkout -b [name_of_your_new_branch]

Push branch to repository

$ git push origin [name_of_your_new_branch]

See all branches:

$ git branch

Switch to branch:

$ git checkout [name_of_your_new_branch]

Delete local branch

$ git branch -d [name_of_your_new_branch]

Then delete remote branch:

git push origin --delete [name_of_your_new_branch]

More information: https://github.com/Kunena/Kunena-Forum/wiki/Create-a-new-branch-with-git-and-manage-branches

Merge branches

Merge two branches

$ git checkout [main branch name]
$ git merge [branch to merge into main branch]

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

Clone this wiki locally