my code

vom übergebenen Pfad+Branch

1. Git Stash
2. Gitch checkout Branch
3. Git Pull—rebase
4. Git Stash apply
5. Git Stash drop

Snippet options

Download: Download snippet as gitstashpullapplydrop.txt.
Copy snippet: For this you need a free my code account.
Embed code : You will find the embed code for this snippet at the end of the page, if you want to embed it into a website or a blog!


cd $path
Write-Host ("now in: "+$path) -foreground Green
git checkout $branch #setzt den genannten Branch auf aktiv
Write-Host ("checked out : "+$branch) -foreground Green
git stash save "gescriptete Aktualisierung" #Speichert die Änderungen zwischen
Write-Host ("stashed") -foreground Green
git pull --rebase origin $branch #aktualisiert den Stand vom genannten Branch
Write-Host ("pulled") -foreground Green
git stash apply #Wendet die Änderung vom Stash auf den Branch an
Write-Host ("stash applied") -foreground Green
git stash drop #löscht den neusten Stash
Write-Host ("stashes cleared") -foreground Green
cd $PSScriptRoot #Wechsel zurück ins Start Verzeichnis

Create a free my code account now.

my code is a free service, which allows you to save and manage code snippes of any kind and programming language. We provide many advantages for your daily work with code-snippets, also for your teamwork. Give it a try!

Find out more and register now

You can customize the height of iFrame-Codes as needed! You can find more infos in our API Reference for iframe Embeds.