Excerpts from Sebastian Schwarz's message of 2010-05-28 20:49:31 +0200:
On 2010-05-28 at 19:38 +0200, Philipp Überbacher wrote:
That's why I defaulted to "master", but I get the following error: fatal: git checkout: branch master already exists
It works, but I need some input on whether and how the default case can be handled more gracefully.
There isn't really a need to create a new branch if you just want to do a checkout. Simply change
git checkout --track -b ${_gitbranch} origin/${_gitbranch}
in http://pastebin.com/deqgqjJe to
git checkout origin/${_gitbranch}
See the amendment of the paste at http://pastebin.com/C8sC7wAe
Thanks Sebastian, I guess it makes sense, but I get a new message from git: Note: checking out 'origin/master'. You are in 'detached HEAD' state. You can look around, make experimental changes and commit them, and you can discard any commits you make in this state without impacting any branches by performing another checkout. If you want to create a new branch to retain commits you create, you may do so (now or later) by using -b with the checkout command again. Example: git checkout -b new_branch_name HEAD is now at 0cb24fc... add some text to README .. -- Regards, Philipp ----- "Wir stehen selbst enttäuscht und sehn betroffen / Den Vorhang zu und alle Fragen offen." Bertolt Brecht, Der gute Mensch von Sezuan