cloud-bigdata-book icon indicating copy to clipboard operation
cloud-bigdata-book copied to clipboard

git实践

Open heidsoft opened this issue 9 years ago • 4 comments

https://github.com/xirong/my-git

heidsoft avatar Dec 22 '16 02:12 heidsoft

https://github.com/oldratlee

heidsoft avatar Dec 22 '16 02:12 heidsoft

git config --global https.proxy http://127.0.0.1:1080

git config --global https.proxy https://127.0.0.1:1080

git config --global http.proxy 'socks5://127.0.0.1:1080' 

git config --global https.proxy 'socks5://127.0.0.1:1080'

取消

git config --global --unset http.proxy

git config --global --unset https.proxy

heidsoft avatar Jun 05 '18 09:06 heidsoft

子模块处理

#!/bin/sh

set -e

git config -f .gitmodules --get-regexp '^submodule\..*\.path$' |
    while read path_key path
    do
        url_key=$(echo $path_key | sed 's/\.path/.url/')
        url=$(git config -f .gitmodules --get "$url_key")
        git submodule add $url $path
    done

https://stackoverflow.com/questions/11258737/restore-git-submodules-from-gitmodules

https://stackoverflow.com/questions/12898278/issue-with-adding-common-code-as-git-submodule-already-exists-in-the-index

https://git-scm.com/docs/git-submodule

heidsoft avatar Nov 26 '18 08:11 heidsoft

http https 保存认证信息

https方式每次都要输入密码,非常不爽

按照如下设置可只输入一次

记住密码(默认15分钟):

git config --global credential.helper cache
自己定义时间(一小时后失效):

git config credential.helper 'cache --timeout=3600'
永久存储密码:

git config --global credential.helper store

heidsoft avatar Feb 22 '19 06:02 heidsoft