git flow commit code example

Example 1: git flow feature

#Open a feature branch named: feature/feature_name
git flow feature start feature_name
#Close a feature branch
git flow feature finish feature_name
#Remember to push all branches
git push --all

Example 2: git flow release

#Starting a release create a branch release/release_version
#tipically version are Semantic Versioning standard X.Y.Z
git flow release start release_version
#Finish a release, remember to update your application version!
git flow release finish release_version
#Remember to push all branches and tags
git push --all --follow-tags

Example 3: Git commands workflow

GIT Commands and sudo-order of operations (* = not neccessary)
1. Initialize git
	git init <--perform in target directory

2. Create new branch
	*git branch <--check branch "inventory"
	git checkout -b <name> <---create AND switch to new branch

3. Once in branch of choice use the following:
	*git status
	git add <file name(s)>
	*git diff <--check if there are any changes to commit
	*git reset <--run to discard any changes
	git commit -m "<message>"

4. Merge branch with master
	git merge <branch name> <--i.e. "master"
	*git branch -d <branch name> <--delete branch
    *git branch -D <branch name> <--delete not merged branch

5. Eat pizza!

Example 4: gitflow workflow diagram

$ git checkout -b myfeature develop
Switched to a new branch "myfeature"