Git 2:创建仓库(bitbucket)

Git 2:创建仓库(bitbucket),第1张

To get started you will need to run these commands in your terminal.

若是使用了--global选项,那么更改的配置文件就是位于你用户主目录下的,以后所有的项目都会慕容使用该配置的用户信息

若要在特定项目中使用其他name/email,只要去掉 --global选项重新配置即可,新的设定保存在当前项目的.git/config文件里

若出现相同的变量名,则来自不同的配置文件(/etc/gitconfig 和~/.gitconfig)

If you already have code ready to be pushed to this repository then run this in your terminal.

示例

If your code is already tracked by Git then set this repository as your "origin" to push to.

If you want to simply clone this empty repository then run this command in your terminal.

示例:把bitbucket生成的git仓库 克隆到本地

OK,现在bitbucket和android studio上都已经创建好了仓库!

显示如下就表示成功了

现在在bitbucket上就可以看到我们的项目源码了,哈哈,上传成功!

例如我有下面两个仓库:

git@bitbucket.net:fancive/project.gitgit@github.com:fancive/curl.git12

在项目路径下打开Git Bash

添加一个remote,这里是origin,也可以是别的名字

$ git remote add origin git@bitbucket.net:fancive/project.git$ git remote set-url --add origin git@github.com:fancive/curl.git123

如果有多个,按照上面这一个命令进行添加.

提交的时候输入:

git push origin --all1

这样就会一次提交到多个库了,上面命令输出如下:


欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/bake/7834247.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2023-04-10
下一篇2023-04-10

发表评论

登录后才能评论

评论列表(0条)

    保存