1. Install macport at http://www.macports.org/install.php
sudo port selfupdate
sudo port install git-core
For default, it will be installed in
/opt/local/bin/git
Note:
Xcode package include git also, its path is:
/usr/bin/git
GUI for git
http://www.sourcetreeapp.com/
or on AppleStore
http://itunes.apple.com/us/app/sourcetree/id411678673
[w/o macport]
Download the installer for OSX
http://code.google.com/p/git-osx-installer/
Initialize the current directory:
git init
Add the current directory to tracking repository
git add .
Commit all the file under the current directory with message 'XXX'
git commit -a -m 'XXX'
Modify the commit message
git commit --amend -m 'new message'
Name the last commit file as 'ver1.0' (branch)
git tag ver1.0
Show all file whose version is 'ver1.0'
git show ver1.0[:[spec file]]
Show the message
git show HEAD
show last message
git show HEAD^
Checkout (restore) all the files to commit 'ver1.0'
git reset ver1.0
Checkout (restore) to last commit
git reset HEAD^
Work with a remote repository
http://spencerimp.blogspot.tw/2013/10/git-how-to-use-git-on-bitbucket.html
You can use option -h to know detail about the command
reference
http://tkg.im.ncue.edu.tw/?p=755
No comments:
Post a Comment