Normally, I would need to create the branch before I could check it out, but in newer versions of git, it's smart enough to know that you want to checkout a local copy of this remote branch. Article 11 minutes to read 9 contributors Feedback In this article Install PowerShell using Winget (recommended) Installing the MSI package Installing the ZIP package Install as a. To switch to this branch, I can simply run: git checkout my-bugfix-branch Now git knows about my new my-bugfix-branch. * my-bugfix-branch -> origin/my-bugfix-branchįirst, rewinding head to replay your work on top of it.įast-forwarded master to 4316d296c55ac2e13992a22161fc327944bcf5b8. It will display an output that looks something like this: From :andrewhavens/example-project This will fetch all of the remote branches and merge the current branch. If I want to fetch the remote branches, I simply run: git pull My usual workflow is a little different now. I've learned a lot and git has improved since then. Update: It's been 5 years since I originally posted this question. The latter will create a branch that is also set to track the remote branch. Or you can do: git checkout -t origin/branch-name git checkout -b newlocalbranchname origin/branch-name Thanks to a related question, I found out that I need to "checkout" the remote branch as a new local branch, and specify a new local branch name.
0 Comments
Leave a Reply. |