How To Use Git
How to use git ??? (Continious Updating)
-
Create new Branch
git checkout -b
[ default to master]</code> Git commit -m ""
Git push --set-upstream
</code> -
Clone specific branch from remote repository
git clone -b my-branch repository_url
With Git 1.7.10 and later, add –single-branch to prevent fetching of all branches. Example, with OpenCV 2.4 branch:
git clone -b opencv-2.4 --single-branch
</code> -
Restore a deleted local repository file
- Get revision number
git rev-list -n 1 HEAD --
</code> - Restore to the above revision number
git checkout
-- </code> -
Delete a local branch
git branch -d branch_name
- Force pull remote and overwrite local branch
git fetch --all
git reset --hard origin/branch_name
-
discard local change by overwrite with local repository
git checkout --
</code> -
Force pull remote and overwrite local file
git fetch
git checkout origin/master