git clone from local to remote

前端 未结 6 2028
慢半拍i
慢半拍i 2020-12-23 12:03

We\'re in the process of migrating from Mercurial to Git for our workflow and I have two minor issues.

First, is it possible to \"clone\" a local repository directly

6条回答
  •  囚心锁ツ
    2020-12-23 12:38

    Easiest git equivalent to hg clone . ssh://account@server/www is:

    rsync -avz . ssh://account@server/www/reponame
    

    In fact, I have added this line to ~/.bash_aliases to mirror any directory anywhere:

    alias mirror="rsync -avz . ssh://account@server`pwd` --delete"
    

    It could prove dangerous if you happen to be in a special directory like /dev or /bin. Be careful.

提交回复
热议问题