- Version Control System (VCS).
- Much better than having
index.html
index.html_backup
index.html_before_bootstrap
index.html_working
- Developers
- Authors
- Designers
- Anyone that works with text
- Keep a history of changes to files
- Separate work on separate tasks
- Merge work from separate tasks
- Collaborate with others
- Develop complicated workflows
- Deploy code to production
- Open "Terminal" for Mac, "Git Bash" for Windows and probably "Gnome Terminal" or "Konsole" for Linux
pwd
is your "present working directory"ls
lists filescd
is "change directory". Switch to the root directory of your project- Start typing a directory and hit Tab for easy navigation
- Go up a directory with
cd ..
- Install git. Available for Windows, Mac, Linux, others
git config --global user.name "Abraham Lincoln"
git config --global user.email honestabe@lincoln.com
git config --global color.ui auto
- From project root run
git init
git status
git add
git status
git commit
- Edit a file
git status
git diff
git add
git status
git commit
git rm file
git commit
git log
git show
git blame
git branch
git checkout
git checkout -b
git merge
- Branch
master
git status
git add
git rm
- Merge markers
<<<<<<<|=======|>>>>>>>
- GitHub
- Bitbucket
- Others
git remote add
git push
- Fork on GitHub
- Clone your repo
git clone
- Make a branch for your change
git checkout -b myChange
- Make changes and commit
- Push changes
git push