惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

AI
AI
TaoSecurity Blog
TaoSecurity Blog
H
Heimdal Security Blog
Help Net Security
Help Net Security
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Microsoft Azure Blog
Microsoft Azure Blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Google DeepMind News
Google DeepMind News
爱范儿
爱范儿
The Cloudflare Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
人人都是产品经理
人人都是产品经理
大猫的无限游戏
大猫的无限游戏
N
News | PayPal Newsroom
V2EX - 技术
V2EX - 技术
博客园 - 【当耐特】
D
Darknet – Hacking Tools, Hacker News & Cyber Security
S
Secure Thoughts
C
CERT Recently Published Vulnerability Notes
罗磊的独立博客
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
P
Privacy & Cybersecurity Law Blog
有赞技术团队
有赞技术团队
S
Schneier on Security
S
SegmentFault 最新的问题
Google Online Security Blog
Google Online Security Blog
H
Hacker News: Front Page
The Last Watchdog
The Last Watchdog
Schneier on Security
Schneier on Security
PCI Perspectives
PCI Perspectives
IT之家
IT之家
Project Zero
Project Zero
博客园 - 司徒正美
P
Privacy International News Feed
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Jina AI
Jina AI
Security Latest
Security Latest
Hacker News - Newest:
Hacker News - Newest: "LLM"
腾讯CDC
C
CXSECURITY Database RSS Feed - CXSecurity.com
阮一峰的网络日志
阮一峰的网络日志
C
Check Point Blog
aimingoo的专栏
aimingoo的专栏
V
Vulnerabilities – Threatpost
W
WeLiveSecurity
NISL@THU
NISL@THU
Webroot Blog
Webroot Blog
N
Netflix TechBlog - Medium
L
Lohrmann on Cybersecurity

博客园 - longbigfish

部署(https证书) https证书问题(本地) 参数更新 Ubuntu 24安装Neo4j详细教程 protect 紧急 手机 刷脏页的两种模式 python中的多线程陷阱与pytorch分布式执行机制 rpc编程示例 mpi编程 cifs远程挂载 使用脚本进入一个命令行控制台,并预设执行的命令列表 cifs挂载远程文件出现 No such device or address错误 longtable 跨越多个页面时,如何在跨页时自动断行并加上横线及去掉页眉 matplotlib中文显示-微软雅黑 latex编译过程-关于嵌入所有字体 python做图笔记 linux启动全过程 连接并同步windows下的git仓库 反向ssh
git之复合指令和submodule
longbigfish · 2023-10-25 · via 博客园 - longbigfish

1.

别名设置在路径C:\Program files\Git\etc\profile.d\aliases.sh里面

通过alias设置了一个复合指令 alias gsync='date;git pull m master;git add .;git commit -m "sync-desk"; git push m master'

修改后在git bash里面运行 source  'C:\Program files\Git\etc\profile.d\aliases.sh' 生效

2.

在git仓库中有submodule,但是不知从什么时候开始,在一台机器上gsync后,在另一台机器gsync第一次总是出现 ![rejected],第二次gsync后成功了,然后第一台机器啥都没干再次gsync会发现submodule目录会有 2 +-,同时git status发现submodule的目录显示 modified。

解决方法:

参考 https://git-scm.com/book/fa/v2/Git-Tools-Submodules

在上述第一台机器显示modified的状态下,运行

git checkout --recurse-submodules

 git submodule update --init --recursive

两条命令后,git status发现变为干净的了,之后两台随意 gsync不会有问题了

---2024.5.27, 又一次不起作用了,根据 https://stackoverflow.com/questions/58309538/what-does-upload-pack-not-our-ref-mean-when-fetching-git-refs-via-tags  解决

在发生reject 的机器上,执行 

   git submodule deinit -f dashboard (最后是submodule名字)

  git submodule summary 
  git pull --prune --recurse-submodules --force 
解决

3. 

在一台机器上 add submodule  xxx 后,会发生

(1)在仓库中创建xxx目录。

(2)在.gitmodules里面增加entry。

(3)在.git/modules中创建目录

(4)在(1)的xxx目录里运行git remote -vv可以看见子模块路径。

然后,这时候同步到中心仓库,再在另一台机器上同步过来后,上述的(3)和(4)不会生效,需要在另一台机器重新add submodule,方式

(1) 删除目录xxx,  rm -rf xxx

(2) git删除, git rm -rf xxx

(3)添加子模块,git submodule add xxxx.git

添加后拉代码

git submodule init

git submodule update

4.  "no url found for submodule path in .gitmodules"

错误添加了一个sumbodule,删除后,git update 会报这个错,是因为删除的操作没有add  看 git status 是有一个new file 记录和一个delete 记录,git add .后就干净了,就可以update了