Git更改原点后提交分支

时间:2018-07-16 07:06:41

标签: git github

我的克隆cef存储库为:

def getRecomendationForUser (userId: Int) : scala.collection.mutable.Map[String,String] = { val candidates = sc.parallelize(items.toSeq) val recommendations = bestModel.get .predict(candidates.map((userId, _))) .collect() .sortBy(- _.rating) .take(10) val tempIds = new ArrayBuffer[String]() recommendations.foreach { r => tempIds += r.product.toString } return tempIds } var recomResults = scala.collection.mutable.Map[Int, scala.collection.mutable.Map[String,String]]() for (item <- userNeedRec) { val recForUser = getRecomendationForUser(item._1, item._2) if(recForUser.size > 0) { recomResults += (item._1 -> recForUser) } }

它也有几个分支,可以通过运行

进行检查
git clone https://bitbucket.org/chromiumembedded/cef.git

现在,我想通过将远程URL更改为以下方式将此仓库提交到我自己的git仓库中:

> git branch -a
* (HEAD detached at origin/3202)
  master
  remotes/origin/3202
  remotes/origin/3239

但是我在仓库中只看到master分支。在下拉列表中看不到分支>git remote set-url origin git@github.com:g-jha/cef.git >git remote -v origin git@github.com:g-jha/cef.git (fetch) origin git@github.com:g-jha/cef.git (push) > git push -u origin master > git push -u origin origin/3202 enter image description here

1 个答案:

答案 0 :(得分:1)

以下链接对我有帮助: https://github.com/aiidateam/aiida_core/wiki/How-to-migrate-from-BitBucket-to-GitHub

我只需要克隆并使用--mirror选项推送仓库。

>git clone --mirror https://bitbucket.org/chromiumembedded/cef.git
>cd cef.git
>git remote set-url --push origin git@github.com:g-jha/cef.git
>git remote -v
origin  https://bitbucket.org/chromiumembedded/cef.git (fetch)
origin  git@github.com:g-jha/cef.git (push)

>git push --mirror