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

推荐订阅源

S
Security Affairs
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Jina AI
Jina AI
P
Palo Alto Networks Blog
GbyAI
GbyAI
大猫的无限游戏
大猫的无限游戏
A
Arctic Wolf
Hugging Face - Blog
Hugging Face - Blog
小众软件
小众软件
Y
Y Combinator Blog
T
The Blog of Author Tim Ferriss
Blog — PlanetScale
Blog — PlanetScale
S
Schneier on Security
V
Vulnerabilities – Threatpost
C
Cybersecurity and Infrastructure Security Agency CISA
雷峰网
雷峰网
T
Tenable Blog
人人都是产品经理
人人都是产品经理
T
Tor Project blog
C
Cyber Attacks, Cyber Crime and Cyber Security
AWS News Blog
AWS News Blog
Microsoft Security Blog
Microsoft Security Blog
J
Java Code Geeks
Scott Helme
Scott Helme
SecWiki News
SecWiki News
C
CERT Recently Published Vulnerability Notes
Recorded Future
Recorded Future
I
InfoQ
Security Archives - TechRepublic
Security Archives - TechRepublic
Help Net Security
Help Net Security
Cloudbric
Cloudbric
C
Check Point Blog
Engineering at Meta
Engineering at Meta
TaoSecurity Blog
TaoSecurity Blog
B
Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园_首页
N
News and Events Feed by Topic
云风的 BLOG
云风的 BLOG
MyScale Blog
MyScale Blog
腾讯CDC
量子位
Application and Cybersecurity Blog
Application and Cybersecurity Blog
K
Kaspersky official blog
Vercel News
Vercel News
F
Full Disclosure
T
Troy Hunt's Blog
Forbes - Security
Forbes - Security
S
Security @ Cisco Blogs

博客园 - 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了