Git and Git Flow

Collections of git commands and workflow

Git Commands

Cleaning

Dry run

git clean -n

Interactive mode

git clean -i

can be combined with other options

Remove directories

git clean -d

Remove ignored files

git clean -x -i

SO: How to remove local (untracked) files from the current Git branch?

Branch

Delete local branch

git -d <branch>

Delete remote branch

Warning! Dangerous!

git push origin :<branch>

Renaming a branch

SO: How to rename a local Git branch?

git branch -m <old name> <new name>

or to rename current branch:

git branch -m <new name>

Cloning specific branch

SO: How to clone a single branch in git?

Creating orphan branch

SO: In git, is there a simple way of introducing an unrelated branch to a repository? Useful for gh-pages

git checkout --orphan newbranch

Git Workflow

WIP

results matching ""

    No results matching ""