Table of Contact
- [What is git?](#what is git?)
- Source
version control group that saves changes into your files e.g Local Version Control (Database on local computer ) Centralized Version Control (Shared Server) Distributed Version Control (Both server and local)
File transition between 3 states
- Modified Files
- Staged Files
- Committed Files
git config --global user.name "your name"
git config --global user.email [email protected]
git config --global core.editor "<subl/vi/..> -n -w"
git config --global core.editor "vim"
git config --list
git help add
git init
git add *.java
git remote add origin <linkhere>
git push -u origin master
you need to create a file [.gitignore] e.g *.jar //ignore all .jar files in your repo
git diff //it should shows exactly what has been changed
git diff --cached
Tip: Your commit heading should be 50 char or less explaining the reason why your commited Then you need paragraph format to explain the following
- Original problem that was address
- Specifier change that you've made
- The result of your change
- Future improvement
- Any known bug solved bug ID# ....
git commit -a -m 'changed something' //this is to make changes quickly
a. git log # Shows all of the previous commit messages in reverse order
b. git log --pretty=oneline # Shows commits on one line
c. git log --pretty=format:"%h : %an : %ar : %s"
I. %h - Abbreviated Hash
II. %an - Authors Name
III. %ar - Date Changed
IV. %s - First Line of Comment
d. git log -p -2 # Shows the last 2 commit changes
e. git log --stat # Prints abbreviated stats
f. git log --since=1.weeks # Show only changes in the last week
g. git log --since="2014-04-12" # Show changes since this date
h. git log --author="Derek Banas" # Changes made by author
i. git log --before="2014-04-13" # Changes made before this date