Markovtsev Vadim
Web Programming @ MIPT, 2015-2016
What are the drawbacks?
What are the drawbacks?
What are the drawbacks?
What are the drawbacks?
What are the drawbacks?
What are the drawbacks?
What are the drawbacks?
What are the drawbacks?
What are the drawbacks?
What are the drawbacks?
What are the drawbacks?
What are the drawbacks?
sudo apt-get install git
brew install git
git init
to initialize an empty repogit clone
to fetch an existing oneExamples:
git init .
git clone git@github.com:vmarkovtsev/mipt_web_2015.git mipt
Internal files are stored inside .git
directory in the repo's root
git status
- show what's going ongit log
- show what happened before on the current branchgit reflog
- show the last N repository statesgit add [-p]
- adds untracked and modified files to staging areagit add
- mark conflict as resolvedgit diff
- show the difference between HEAD and modified (but not staged!)git diff --staged
- show the difference between HEAD and stagedgit reset [-p]
- remove the file from staging to modified or untrackedgit checkout -f
- restore deleted file, revert changesgit rm
- removes the file from Git and from the file systemgit rm --cached
- removes the file from Git but leaves it in the file systemgit mv
- move filegit commit [-m]
- make the commit from stagedgit commit --amend
- meld staged into the previous commit (HEAD)git rebase -i HEAD^^^
- change last 3 commits sequentiallygit remote -v
- view external repositoriesgit remote add
- add external repositorygit remote rm
- remove external repositorygit fetch
- synchronize remote branches with local mirrorsgit pull --rebase
- take off local commits, apply remote's and finally return localgit pull
- merge local branch with remote counterpartgit push <remote name> <branch name>
- update remote branchgit branch
- set new branch to point to HEAD, but do not switch to itgit checkout -b
- set new branch to point to HEAD, and switch to itgit checkout
- switch to existing branchgit branch -d/-D
- delete branch (local)git push <remote name> :<name>
- delete branch (remote)git merge [--squash]
- merge with other branchgit rebase
- rebase against other branchgit cherry-pick
- take commit(s), duplicating historygit mergetool
- resolve conflictsgit stash
- take the snapshot of modified and staged, then do git reset --hard
git stash pop
- recover the modified and stagedgit stash list
- view LIFOgit tag
- mark HEAD with a labelgit pull --tags
- fetch tags, toogit push --tags
- push with tagsgit format-patch <commit>
- create patch files from
each commit after <commit>git diff
git apply
- apply patchgit submodule add <where> <path>
- register new submodulegit submodule update --init [--recursive]
- pulls all submodules
and detaches HEADs of eachgit fsck
- check internal integritygit gc
- garbage collect objects