Stash-Nutzung
Wir haben immer noch den Stash mit Änderungen, die in das Projekt eingepflegt werden sollen. Wie üblich geschieht die Arbeit in einer Branch.
$ git checkout -b feature/default-nameSwitched to a new branch 'feature/default-name'$ git stash popOn branch feature/default-nameChanges not staged for commit:(use "git add <file>..." to update what will be committed)(use "git restore <file>..." to discard changes in working directory)modified: Main.javano changes added to commit (use "git add" and/or "git commit -a")Dropped refs/stash@{0} (e67d924efbe145c7d263033c53cfc774a95389b8)$ git add Main.java$ git commit
Add fallback value for greeting
Hierbei ist git stash pop eine Kurzschreibweise für git stash apply 'stash@{0}' && git stash drop 'stash@{0}'. Falls apply in einem Fehler endet, entfällt das drop.
Auch diese Änderung wird nach master gemerged und anschließend produktiv gestellt.
$ git checkout master[...]$ git pull[...]$ git merge --no-ff feature/default-name[...]$ git push[...]$ git checkout production[...]$ git pull[...]$ git merge --no-ff master[...]$ git tag -a prd/2019-11-29-2-default-greeting[...]$ git push[...]$ git push --tags[...]$ git checkout master[...]