V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
chnyang
V2EX  ›  问与答

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

  •  
  •   chnyang · 2017-10-30 18:42:14 +08:00 · 1758 次点击
    这是一个创建于 2393 天前的主题,其中的信息可能已经有所发展或是发生改变。
    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 友解惑

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

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

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

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

    但是因为我傻傻的把.git 目录放在了部署目录里,所以 fd 的时候把我的.git 目录也删除了也就没办法 checkout 进部署目录里了。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   3163 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 04:27 · PVG 12:27 · LAX 21:27 · JFK 00:27
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.