Git/checkout: Difference between revisions
from HTYP, the free directory anyone can edit if they can prove to me that they're not a spambot
< Git
experience hath shewn |
→Links: local manpage |
||
| Line 13: | Line 13: | ||
==Links== | ==Links== | ||
===Reference=== | ===Reference=== | ||
* [https://git-scm.com/docs/git-checkout git- | * {{l/manpage|git-checkout|manpage @ HTYP}} | ||
* [https://git-scm.com/docs/git-checkout git-scm] - Switch branches or restore working tree files | |||
Revision as of 12:26, 31 October 2018
About
The git checkout command allows you to switch branches. If you've got incomplete changes you want to set aside before switching branches, use git stash.
When you do a checkout, all the files in your working folder-tree are replaced by a snapshot of that tree as saved when you last committed to that branch.
If there are any uncommitted changes, git will warn you of this and refuse to do the checkout. You can either commit or stash to resolve this.
Options
git checkout -b <name>does the same thing as executing these two commands:
Links
Reference
- manpage @ HTYP
- git-scm - Switch branches or restore working tree files
