git initします。
[vagrant@localhost app]$ git init
Initialized empty Git repository in /home/vagrant/local/app/.git/
[vagrant@localhost app]$ vi sample.txt
[vagrant@localhost app]$ cat sample.txt
Hello Git!
[vagrant@localhost app]$ git add sample.txt
[vagrant@localhost app]$ git commit -m “git checkout”
[master (root-commit) c4b426e] git checkout
Committer: vagrant
Your name and email address were configured automatically based
on your username and hostname. Please check that they are accurate.
You can suppress this message by setting them explicitly:
git config –global user.name “Your Name”
git config –global user.email you@example.com
If the identity used for this commit is wrong, you can fix it with:
git commit –amend –author=’Your Name
1 files changed, 1 insertions(+), 0 deletions(-)
create mode 100644 sample.txt
git branchを作成する。
[vagrant@localhost app]$ git branch branch1
[vagrant@localhost app]$ git branch branch2
[vagrant@localhost app]$ git branch
branch1
branch2
* master
[vagrant@localhost app]$ git checkout branch1
Switched to branch ‘branch1’
[vagrant@localhost app]$ git branch
* branch1
branch2
master
なるほど、checkoutはbranchの切り替えです。
[vagrant@localhost app]$ git checkout branch2
Switched to branch ‘branch2’
[vagrant@localhost app]$ cat sample.txt
Hello Git!
なるほど、なるほど。
最近なるほどが異常に増えた。