- Save time
- Make changes with confidence
- Reuse your work
- Collaborate with others
- Open 'Terminal'
- Check if 'git' is installed
- If not, install from: Git for Mac
- Before running the first time, you must configure your name and email:
git config --global user.name "Matt Jones"
git config --global user.email "[email protected]"
- Optional: Install TextMate, and configure it as the editor for git commit messages
git config --global core.editor 'mate -w'
- Install Git Bash
git config --global user.name "Matt Jones"
git config --global user.email "[email protected]"
git config --global core.editor '"C:\Program Files (x86)\Windows NT\Accessories\wordpad.exe"'
- Version control systems
- Creating a repository
- Adding and committing files
- Working with remote repositories
- Using tags
- Branching and merging
mkdir test
cd test
echo "This is a test file." > README.txt
# Initialize the git repository and start tracking files
git init
git status
git add README.txt
git status
git commit -m "Initial draft of README."
# Make some changes to the file and commit them
echo "===================" >> README.txt
git status
git add README.txt
git status
git commit -m "Added formatting."
# View the history of changes
git log
git blame README.txt
Use git clone
to copy a remote repository to your local host, and then use git push
to write your changes back up to the repository.
git clone [email protected]:mbjones/pgame.git
git remote -v
git pull origin master
echo " " >> README.md
git add README.md
git commit -m "Added a newline to end of Readme."
git status
git push origin master