Pragmatic Version Control Using GitJump to: Navigation, search
- git config--global user.name "Travis Swicegood"
- git config--global user.email "[Email protected]"
- git config--global--list
- git config--global color.ui "Auto"
- CD MySite && git init
- Git commit-m "Add in Hello World HTML"//SHA1 Hash
- Git branch rb_1.0 master//Create Branch
- git checkout rb_1.0//?? Doesn't seem to go to another directory?? I personally doubt the efficiency of doing this (however, maybe Linux ext3 file links are easier to handle?). )
- Git tag 1.0 rb_1.0//tag: Mark a special point in time ...
- Rebase: Merging changes on the branch to the mainline
- git checkout Master
- git rebase rb_1.0//Try to replay all changes ...
- git branch-d rb_1.0//once merged into the main line, you can remove the branch
- However, how do I recover from a branch after it has been deleted? Available from Tag:git Branch rb_1.0.1 1.0 This is just to fix a specific state of the patch released
- git log--pretty=oneline
- Git Archive--format=tar--prefix=mysite-1.0/1.0 | gzip > mysite-1.0.tar.gz
- git clone git://github.com/tswicegood/mysite.git mysite-remote//Remote Repository
- Git add-i//interactive mode?
- git add-p//export patch file (this is like, other svn, Hg have not seen so convenient)
- Show difference (1) What's in the Your working tree, (2) What's staged and ready to being committed, and (3) What's in your Repository:git diff |--cached| HEAD
- Add. *.swp to the. Gitignore ...
- Branching rename: Git branch-m old New
- One of the hardest parts of branches is figuring in to create a branch. It's an art, isn't a science
- Experimental changes
- New Features
- BUG fixes
- Checkout-b (Create new branch while checkout)
- Merging: (Note that you will need to submit after merge!) )
- Straight Merge: Merge 2 branches: Execute git Merge branch on the main line
- Squashed commits: Compress multiple commits on a branch, converting to a single commit on another (? ), git merge--squash branch
- Cherry-picking: Send a commit on one branch directly to another branch (this is cool, mecurial doesn't support ~ ~) git Cherry-pick 321d76f (the commit number on the branch)
- -N option: to does the merge but stop before creating a commit
- git reset--hard head^
- View history: Git log (can append additional parameters specified range, slightly)
- Track changes in a specific file: Git blame-l 12,13 hello.html//Note: can 12,+2 or 13,-2 description (Micro syntax ~ ~)
- revert: Rewriting history ... Break one commits into multiple commits??
- git fetch: Keep up-to-date with remote repositories
- Git branch-r
- git push
- git diff: See the changes between the 2 versions (shown as a differential commit, this feature MERCURIAL/HG is not available, SVN can make comparisons), and git log will show the history of all commits
- Beyond the Basics (slightly):
- Git gc:compacting your repository history
- Git archive:exporting your repository
- git rebase:rebasing a branch ' s history against its parent
- Using the Reflog to fix your repository
- Bisecting your repository to find the change introduced a bug
Pragmatic Version Control Using Git (note)