git 先创建本地仓库,再关联远程

之前都是先在GitHub或者bitbucket上创建repo,然后在本地直接git clone下来。

如果一定需要先在本地创建好文件夹,然后再关联远程仓库。

是这样:

1在远程创建仓库这步不变。

2 在本地文件夹里,git init,  (创建.git文件夹)

3 git remote add origin [email protected]:XXX/YYY.git

就可以了。

猜你喜欢

转载自www.cnblogs.com/xuanmanstein/p/9177865.html
今日推荐