marcin
11/11/2017 - 8:03 PM

Git flow commands

commands which allow me to keep my work flow with git.

### CREATING A NEW BRANCH:

git checkout -b branch_name

### Switching between branches:

git checkout branch_name

### Coppying the updates from remote repository:

// check do you have a remote repository added:

git remote -v

// If not:

git remote add upstream https://github.com/whoever/whatever.git

# Fetch all the branches of that remote into remote-tracking branches,
# such as upstream/master:

git fetch upstream

# Make sure that you're on your master branch:

git checkout master

# Rewrite your master branch so that any commits of yours that
# aren't already in upstream/master are replayed on top of that
# other branch:

git rebase -i upstream/master

# after that you will have to do:

git push --force

### Deleting branch

##Delete Local Branch

# To delete the local branch use one of the following:

# -d option is an alias for --delete

$ git branch -d branch_name

# -D is an alias for --delete --force

$ git branch -D branch_name