How to use git locally and push to remote server

前端 未结 2 1422
-上瘾入骨i
-上瘾入骨i 2020-12-10 10:11

I want to use git to manage my development, integration test and production environments. I\'ve looked around but can\'t seem to find a simple explanation of how (eg Git -

2条回答
  •  囚心锁ツ
    2020-12-10 10:27

    Git is not (originally) meant for synchronizing working copies but repositories that is Git's commits/branches/refs/etc.

    What your want to do I would call a remote checkout. There is hundreds of other ways to do. I have two ideas: As you have setup an ssh-connection the big work is done:

    1) use git and ssh

    git push origin my_branch
    ssh user@server "(cd remote-dir-where-your-repo-is; git checkout -f my_branch;)"
    

    2) Use rsync

    rsync -av . ssh://user@server/dir --exclude=.git
    

提交回复
热议问题