当前位置: 首页> 财经> 金融 > git自定义命令使用

git自定义命令使用

时间:2025/7/10 22:22:51来源:https://blog.csdn.net/george012/article/details/141273939 浏览次数:0次

1.Linux~/.bashrc内容

function custom_git {# 在 Windows 或 Unix 平台上设置 GIT_SSH_COMMANDexport GIT_SSH_COMMAND="ssh -i $custom_ssh"git "$@"
}# 设置 custom_ssh路径 
export custom_ssh="$HOME/.ssh/id_custom_sshkey"

2.Windows~/.bashrc内容

# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; thentest -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"alias ls='ls --color=auto'#alias dir='dir --color=auto'#alias vdir='vdir --color=auto'alias grep='grep --color=auto'alias fgrep='fgrep --color=auto'alias egrep='egrep --color=auto'
fi# some more ls aliases
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.if [ -f ~/.bash_aliases ]; then. ~/.bash_aliases
fifunction custom_git {# 在 Windows 或 Unix 平台上设置 GIT_SSH_COMMANDexport GIT_SSH_COMMAND="ssh -i $custom_ssh"git "$@"
}# 设置 custom_ssh 路径
export custom_ssh="$HOME/.ssh/custom_sshKey"

3.使用

custom_git status
关键字:git自定义命令使用

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

责任编辑: