footer: © Epignosis LLC slidenumbers: true
ABCDEF GIT -- An in depth intro to GIT
- What is not GIT
- What is GIT
- Getting started
- Git concepts and architecture
- Making changes to files
- Undoing changes
- Ignoring files
- Navigating the commit tree
- Branching
- Merging Branches
- Stashing
- Remotes
- Tips and tricks
- Resources
Repetition is the mother of learning --Zig Ziglar
git add
git diff --staged
git commit -m "<message>"
rm -rf /path/to/file
git add /path/to/file
git commit -m "<message>"
git rm /path/to/file
git commit -m "<message>"
mv /path/to/file /path/to/new-file
git add /path/to/new-file
git rm /path/to/file
git commit -m "<message>"
git mv /path/to/file /new/path/to/new-file
git commit -m "<message>"
mv /path/to/file /new/path/to/file
git add /new/path/to/file
git rm /path/to/file
git commit -m "<message>"
git mv /path/to/file /new/path/to/file
git commit -m "<message>"
- Changes in the working directory
- Changes in the staging index
- Changes in the repository
git checkout -- /path/to/file
git clean -n
git clean -f
git clean -dn
git clean -df
git reset HEAD /path/to/file
git commit --amend
git commit --amend --no-edit
- You need to modify commit message
- You need to combine staged changes with the latest commit
git checkout -- <hash-of-previous-commit> /path/to/file
- You need to retrieve a previous version of a file
- The change will be applied into the staging area
- A good practice if you want to revert a particular change in previous SHA