Skip to content

Instantly share code, notes, and snippets.

@choyan

choyan/Git cheatsheet.md

Last active Oct 6, 2020
Embed
What would you like to do?

Git Workflow

Initialize Git

git init
git add .
git commit -m 'new commit'

Create branch

git branch develop
git checkout develop (any branchname will shift to that branch)

or

git checkout -b developer

Manage branch

  • After completing some tasks we will commit our work.
  • Then we will again checkout to master and get the latest work and move back to develop branch again.
git checkout master
git pull origin master
git checkout develop
  • Now we will merge the master branch with the develop branch.
git merge master
  • Now lets push the develop branch to Github.
git push origin develop
  • A pull request will be created there. Lets tag them properly there to complete the automation.

Old docs

git merge --no-ff feature-branch (to merge to develop from its child branch)
git merge --no-ff develop
git merge --no-ff release-1.2
Merge made by recursive.
(Summary of changes)
git tag -a 1.2.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment