This kata will introduce you to the git add
and git commit
commands.
This is a very introductory kata. if you have used git status
, git log --oneline --graph
, git add
and git commit
extensively you should probably skip it.
You can look at the bottom of this file, if you have not yet done basic git configuration.
- Run
source setup.sh
(or.\setup.ps1
in PowerShell)
- Use
git status
to see which branch you are on. - What does
git log
look like? - Create a file
- What does the output from
git status
look like now? add
the file to the staging area- How does
git status
look now? commit
the file to the repository- How does
git status
look now? - Change the content of the file you created earlier
- What does
git status
look like now? add
the file change- What does
git status
look like now? - Change the file again
- Make a
commit
- What does the
status
look like now? Thelog
? - Add and commit the newest change
git add
git commit
git commit -m "My commit message"
git log
git log -n 5
git log --oneline
git log --oneline --graph
touch filename
to create a file (orsc filename ''
in PowerShell)echo content > file
to overwrite file with content (orsc filename 'content'
in PowerShell)echo content >> file
to append file with content (orac filename 'content'
in PowerShell)
git config --global user.name "John Doe"
git config --global user.email "[email protected]
For the vim scared:
git config --global core.editor nano
For the windows peeps:
git config --global core.editor notepad
Other editor options:
git config --global core.editor "atom --wait"
git config --global core.editor "code --wait"
git config --global core.editor "'C:/Program Files/Notepad++/notepad++.exe' -multiInst"