3
ใช้ git submodule foreach พร้อมกับฟังก์ชั่น
การเยื้องของฉันคือการมีสคริปต์ที่อัปเดต submodules git ทั้งหมดตามสาขาที่ได้รับ หากไม่มีสาขาดังกล่าวสำหรับ submodule ระบบจะใช้ต้นแบบ นี่คือสิ่งที่ฉันมีตอนนี้: #!/bin/bash -x if [ -z $1 ]; then echo "Branch name required." exit fi function pbranch { exists=`git show-ref refs/heads/$branch` if [ -z $exists ]; then branch="master" fi git co $branch git pull origin $branch } branch=$1 git submodule foreach pbranch แต่เมื่อรันสคริปต์นี้ข้อผิดพลาดจะถูกโยน: …