Skip to content

Instantly share code, notes, and snippets.

@xpepper
Last active June 17, 2020 15:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xpepper/0e6738e4166dac9cfbae78943ceda047 to your computer and use it in GitHub Desktop.
Save xpepper/0e6738e4166dac9cfbae78943ceda047 to your computer and use it in GitHub Desktop.
script to have a mob session with two branches: mob-session-1, mob-session-2

INIT SESSION (only once!)

git fetch --prune
git pull --ff-only
git checkout master
git merge origin/master --ff-only
git branch mob-session-1
git checkout mob-session-1
git push --no-verify --set-upstream origin mob-session-1

START your turn in the mob session

git fetch --prune
git pull --ff-only
git checkout master
git checkout -B mob-session-1 origin/mob-session-1
git branch --set-upstream-to=origin/mob-session-1 mob-session-1

NEXT handover to the next person

git add --all
git commit --message "mob next [ci-skip]" --no-verify
git push --no-verify origin mob-session-1

RESET close session (only once, at the end of the session)

git fetch origin
git checkout master
git branch --delete --force mob-session-1
git push --no-verify origin --delete mob-session-1

INIT SESSION (only once!)

git fetch --prune
git pull --ff-only
git checkout master
git merge origin/master --ff-only
git branch mob-session-2
git checkout mob-session-2
git push --no-verify --set-upstream origin mob-session-2

START your turn in the mob session

git fetch --prune
git pull --ff-only
git checkout master
git checkout -B mob-session-2 origin/mob-session-2
git branch --set-upstream-to=origin/mob-session-2 mob-session-2

NEXT handover to the next person

git add --all
git commit --message "mob next [ci-skip]" --no-verify
git push --no-verify origin mob-session-2

RESET close session (only once, at the end of the session)

git fetch origin
git checkout master
git branch --delete --force mob-session-2
git push --no-verify origin --delete mob-session-2

INIT SESSION (only once!)

git fetch --prune
git pull --ff-only
git branch mob-session-refactoring-1
git checkout mob-session-refactoring-1
git push --no-verify --set-upstream origin mob-session-refactoring-1

START your turn in the mob session

git fetch --prune
git pull --ff-only
git checkout -B mob-session-refactoring-1 origin/mob-session-refactoring-1
git branch --set-upstream-to=origin/mob-session-refactoring-1 mob-session-refactoring-1

NEXT handover to the next person

git add --all
git commit --message "mob next [ci-skip]" --no-verify
git push --no-verify origin mob-session-refactoring-1

RESET close session (only once, at the end of the session)

git fetch origin
git checkout master
git branch --delete --force mob-session-refactoring-1
git push --no-verify origin --delete mob-session-refactoring-1

INIT SESSION (only once!)

git fetch --prune
git pull --ff-only
git branch mob-session-refactoring-2
git checkout mob-session-refactoring-2
git push --no-verify --set-upstream origin mob-session-refactoring-2

START your turn in the mob session

git fetch --prune
git pull --ff-only
git checkout -B mob-session-refactoring-2 origin/mob-session-refactoring-2
git branch --set-upstream-to=origin/mob-session-refactoring-2 mob-session-refactoring-2

NEXT handover to the next person

git add --all
git commit --message "mob next [ci-skip]" --no-verify
git push --no-verify origin mob-session-refactoring-2

RESET close session (only once, at the end of the session)

git fetch origin
git checkout master
git branch --delete --force mob-session-refactoring-2
git push --no-verify origin --delete mob-session-refactoring-2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment