【无标题】

git在没有设置全局别名的话,将多个项目下设置相同的别名的脚本

bash 复制代码
#!/bin/bash

# List of aliases to add
aliases=(
    "co = checkout"
    "ci = commit"
    # Add more aliases here as needed
)

# Loop through each directory in the current directory
for dir in */; do
    # Enter the directory
    cd "$dir"

    # Check if it's a Git repository
    if [ -d ".git" ]; then
        # Enter the Git repository
        cd .git

        # Add aliases to the local config file
        for alias in "${aliases[@]}"; do
            git config --local alias."${alias%%=*}" "${alias#*=}"
        done

        # Go back to the parent directory
        cd ..
    fi
done
相关推荐
zzqssliu10 小时前
煤炉自动代拍系统的队列设计与超时控制机制
git·github
一支绝命钩10 小时前
FPGA工程Git常用操作手册
git
不搞学术柒柒14 小时前
Git新功能完整开发提交流程
git
午安~婉18 小时前
Git中SSH连接
前端·git·gitee
888CC++19 小时前
VS Code Git 工作树:解锁多分支并行开发新体验
git
阿虎儿19 小时前
Git exclude 功能解析
git
隔窗听雨眠20 小时前
VS Code Git工作树:多分支并行开发的完整实践方案
git
^yi21 小时前
【Linux系统编程】快速上手git仓库管理,核心三板斧
git
郝同学今天有进步吗1 天前
构建 LangGraph Code Review Agent(四):文件过滤与 AnalysisPackage 分包
git·python·ai·code review
胖大和尚2 天前
git本地实现local->remote推送
git