Version control
The following tasks are supported by GIT. A good book and a command reference are available online.
- Creates a local repository for version control
git init
- Adds content of the given files to the staging area
git add .
git add file1 file2 file3
- Checks content status
git status
- Compares content between working directory and staging area
git diff
git diff --ignore-all-space
- Compares content between staging area and last commit
git diff --cached
git diff --staged
- Commits content from staging area
git commit
- Commits content from staging area, after adding automatically content of modified (old) files
git commit -a
- Shows an overview of the changes in the history
git log --stat --summary
- Shows complete diffs at each step of the changes in the history
git log -p
- Shows a customized output of the changes in the history
git log --pretty=format:"%h - %an, %ar : %s"
- Shows a graphical view of the changes in the history
gitk
- Clones a remote repository
git clone remote-repo cloned-repo
git clone ssh-host:remote-repo cloned-repo
- Updates and merges content from the remote repository
git pull
git pull origin master
- Updates and merges content into the remote repository
git push
git push origin master
- Shows configuration data of a local/cloned repository
git config -l
- Lists all branches of a local/cloned repository
git branch
- Lists all remotes of a local/cloned repository
git remote
- Exports a local repository into a new bare server repository
git clone --bare my_project my_project.git
- Generates info/refs and other auxiliary files in case of dumb server
git update-server-info