Skip to content

Instantly share code, notes, and snippets.

@AbhishekAshokDubey
Created November 15, 2018 14:21
Show Gist options
  • Save AbhishekAshokDubey/1af1f6e2f2648f7c507f2f69456f087e to your computer and use it in GitHub Desktop.
Save AbhishekAshokDubey/1af1f6e2f2648f7c507f2f69456f087e to your computer and use it in GitHub Desktop.
https://www.youtube.com/githubguides
https://guides.github.com/introduction/flow/
git clone <url>
cd <repo_folder>
<make changes>
git add .
git commit -m "1st"
git push
===========================================================
git push origin <feature>
git branch
git branch <feature_branch>
git checkout <feature_branch> // git checkout master // git checkout -b <feature_branch>
git push origin <feature_branch>
// to make sure master is updated locally
git checkout master
git pull
git checkout f1
(on branch development)$ git merge master
(resolve any merge conflicts if there are any)
git checkout master
git merge --no-ff f1 (there won't be any conflicts now)
git push
git push origin :f1
git checkout master
git branch -D branch_name
// When you are working on test branch for long but would
// https://stackoverflow.com/questions/5601931/best-and-safest-way-to-merge-a-git-branch-into-master
======================================
in conflicts:
git status
git config --global user.name
git config --global user.email
git config --global credential.helper wincred // git config --global credential.helper osxkeychain // git config --global --unset user.password
==================================================================================
GIT FLOW: Just the branching model/ Guidelines not rules
https://medium.com/@muneebsajjad/git-flow-explained-quick-and-simple-7a753313572f
https://gist.github.com/JamesMGreene/cdd0ac49f90c987e45ac
Master (Represent production-ready state of source code)
Develop (Represent Latest delivered development changes or also called integration branch)
Feature (
May branch off from: develop
Must merge back into: develop
topic branches, Merge back to develop,
Typically exist in developer repos only, not in origin
Delete feature branches when they are finished )
Release branches
May branch off from: develop
Must merge back into: develop and master
Represent preparation of a new production release to deploy changes on Testing server/ QA Testing
Do bug fixing in this branch, bug fixes may be continuously merged back into the develop branch
In this branch Adding large new features here is strictly prohibited
Hotfix branches
May branch off from: master
Must merge back into: develop and master
git checkout -b hotfix-1.7.1 master
Exception Case
The one exception to the rule here is that, when a release branch currently exists,
the hotfix changes need to be merged into that release branch, instead of develop.
Back-merging the bug fix into the release branch will eventually result in the bug fix being merged into develop too,
when the release branch is finished. (If work in develop immediately requires this bug fix and cannot wait
for the release branch to be finished, you may safely merge the bug fix into develop branch)
apt-get install git-flow
wget -q -O - --no-check-certificate https://raw.github.com/petervanderdoes/gitflow-avh/develop/contrib/gitflow-installer.sh install stable | bash
git flow init
git checkout develop
git pull origin master
git flow feature start f2
git flow feature finish f2
git push origin develop
NOte: for normal git world, the branch is "feature/f2" and not just "f2"
Ref:
https://github.com/Kunena/Kunena-Forum/wiki/Create-a-new-branch-with-git-and-manage-branches
https://confluence.atlassian.com/bitbucket/branching-a-repository-223217999.html
https://stackoverflow.com/questions/14168677/merge-development-branch-with-master
https://stackoverflow.com/questions/18137175/in-git-what-is-the-difference-between-origin-master-vs-origin-master
https://medium.com/@muneebsajjad/git-flow-explained-quick-and-simple-7a753313572f
http://danielkummer.github.io/git-flow-cheatsheet/
https://koukia.ca/delete-a-local-and-a-remote-git-branch-61df0b10d323
http://weaintplastic.github.io/web-development-field-guide/Collaboration/Working_with_Git/Git_Workflow/Working_with_Gitflow.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment