-
Notifications
You must be signed in to change notification settings - Fork 40
git note
note: from source folder of HTML-Renderer
-
to push source from one local repo to remote repo
git push [email protected]:prepare/LayoutFarm +v1.7:master
-
to delete previous push
git push [email protected]:prepare/LayoutFarm +first_7_digit_of_commit_id^:master
-
to branch from specific commit
git checkout -b new_branch_name specific_commit_id
-
to disable fast forward merge
git config --global merge.ff false
-
To delete a local branch
git branch -d the_local_branch
from http://nvie.com/posts/a-successful-git-branching-model/
Incorporating a finished feature on develop
Finished features may be merged into the develop branch definitely add them to the upcoming release:
Switched to branch 'develop'
$ git checkout develop
merge,left 'tracking history' behind, (not 'plain' merge)
$ git merge --no-ff myfeature
delete merged branch
$ git branch -d myfeature
push
$ git push origin develop
Force sync with server
git fetch origin master
git reset --hard $FETCH_HEAD
git clean -df
where 'master' is a branch name you want to sync
force clone specific commit
git clone $URL
cd $PROJECT_NAME
git reset --hard $SHA1
Yes, it's possible to restore a deleted branch from git. Find your Commit ID: Search for a branch using git reflog
If you had the branch in your local git repo within the last 30 days, you may be able to find it in the reflog using the following:
git reflog
Search for the branch name in the reflog and note the HEAD{x} point or the commit ID. Re-create the branch from the Reflog HEAD point:
git checkout -b branch_name HEAD@{27}
Re-create the branch from the commit ID: Method 1
You can checkout the commit ID and create a branch off of that commit point:
git checkout -b branch_name <commit id>
Re-create the branch from the commit ID: Method 2
git branch <commit id>
Set Proxy
http://stackoverflow.com/questions/783811/getting-git-to-work-with-a-proxy-server
771 down vote accepted
Command to use:
git config --global http.proxy http://proxyuser:[email protected]:8080
change proxyuser to your proxy user
change proxypwd to your proxy password
change proxy.server.com to the URL of your proxy server
change 8080 to the proxy port configured on your proxy server
If you decide at any time to reset this proxy and work without proxy:
Command to use:
git config --global --unset http.proxy
Finally, to check the currently set proxy:
git config --global --get http.proxy
ubutu 14.04 , add keyserver behide proxy, add --keyserver-options http-proxy= eg...
sudo apt-key adv --keyserver-options http-proxy= --keyserver ...
submodule
see https://github.com/blog/2104-working-with-submodules