git push 到自己的云服务器求助,折腾几小时了

2017-10-30 18:42:14 +08:00
 chnyang
Counting objects: 273, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (248/248), done.
Writing objects: 100% (273/273), 319.36 KiB | 0 bytes/s, done.
Total 273 (delta 70), reused 0 (delta 0)
To 116.196.76.104:/home/kitkat/htdocs/tp/tp.git
 * [new branch]      master -> master

第一次成功 push

Counting objects: 7, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (5/5), done.
Writing objects: 100% (7/7), 510 bytes | 0 bytes/s, done.
Total 7 (delta 3), reused 0 (delta 0)
remote: Removing HEAD
remote: Removing branches/
remote: Removing config
remote: Removing description
remote: Removing hooks/
remote: Removing info/
remote: Removing objects/
remote: Removing refs/
remote: Skipping repository tp/
remote: fatal: Not a git repository: '.'
fatal: Not a git repository: '.'
To 116.196.76.104:/home/kitkat/htdocs/tp/tp.git
   81a2929..4e9c1ca  master -> master

第二次 push

我想把我的本地代码 push 到我的服务器上,push 完之后就自动删除了,一脸懵比

已使用 google、bing 搜索,可能因为关键词搜不对,找不到答案,

求 V 友解惑

1797 次点击
所在节点    问与答
5 条回复
chnyang
2017-10-30 18:43:49 +08:00
我是想使用 git 作自动部署,但是 push 自动删除折腾了我几个小时了,求大佬帮帮忙
olOwOlo
2017-10-30 18:58:01 +08:00
关键词:裸仓库 本地仓库
chnyang
2017-10-30 19:07:57 +08:00
@olOwOlo 非常感谢大佬,问题已解决。
ericgui
2017-10-31 15:07:05 +08:00
@chnyang 你补充进来吧,下次遇到问题可以搜到你的解决方案,参考一下
chnyang
2017-10-31 15:45:26 +08:00
@ericgui 这个跟 git 没关系,是我逗比了

之所以会自动删除都是因为我写了自动部署把 repos.git 目录放在了我的部署目录里了,

为了自动部署 我用了朋友给我的 bash 命令,

每次 push 之后收到 post 会自动 fd 部署目录并 checkout 最新的提交进去,

但是因为我傻傻的把.git 目录放在了部署目录里,所以 fd 的时候把我的.git 目录也删除了也就没办法 checkout 进部署目录里了。

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/402029

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX