git指定用户名或token下载,从指定分支拉取代码并上传到指定分支
指定用户名下载 密码中如果有某些符号如'>',我们需给他编码'%3E'
git clone https://username:password@github.com/xxx.git
指定token下载 附带代理(生成token时一定要保存,否则以后看不到的)
git clone https://token@github.com/xxx.git --config "http.proxy=http://xxx.com:91x"
从指定分支拉取代码
git clone -b 分支名 https://token@github.com/xxx.git
推送到指定分支
git pull origin 分支名 git push origin 分支名
设置代理
有些内网下载代码时需要设置代理,否则拉取代码会报错
bash-4.2# git config --global https.proxy 'http://xxx.com:91x' bash-4.2# git config --global http.proxy 'http://xxx.com:91x'
编码解码:
>>> import urllib
>>> urllib.parse.quote(">")
'%3E'
>>> urllib.parse.quote("<")
'%3C'
>>> urllib.parse.unquote("%3E")
'>'
>>> urllib.parse.unquote("%3C")
'<'
>>>
浙公网安备 33010602011771号