Skip to content

Instantly share code, notes, and snippets.

@higuoxing
higuoxing / delete_git_submodule.md
Created August 29, 2022 07:20 — forked from myusuf3/delete_git_submodule.md
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
@higuoxing
higuoxing / gitproxy-socat
Created January 10, 2021 10:13 — forked from sit/gitproxy-socat
A simple wrapper around socat to use as a git proxy command
#!/bin/sh
# Use socat to proxy git through an HTTP CONNECT firewall.
# Useful if you are trying to clone git:// from inside a company.
# Requires that the proxy allows CONNECT to port 9418.
#
# Save this file as gitproxy somewhere in your path (e.g., ~/bin) and then run
# chmod +x gitproxy
# git config --global core.gitproxy gitproxy
#
# More details at http://tinyurl.com/8xvpny
1、安装arcanist,clone源代码到安装目录somewhere/,arcanist依赖于libphutil,所以两个都要clone
somewhere/ git clone git://github.com/facebook/arcanist.git
somewhere/ git clone git://github.com/facebook/libphutil.git
2、配置arc,将arc加入到PATH,或在/usr/sbin里面建一个到arc的软链接
export PATH=$PATH:/somewhere/arcanist/bin/
或者:cd /usr/sbin; ln -sf /somewhere/arcanist/bin/arc
* 在系统的~/.bashrc或~/.bash_profile中加上该export语句。
* 运行命令"arc help",来检测安装是否成功。
3、配置arc的编辑器,不然会报错,提示EDITOR环境变量没配置
arc set-config editor "vim"