【问题标题】:Git: bitbucket branch is not being pushedGit:bitbucket分支没有被推送
【发布时间】:2015-01-28 19:35:50
【问题描述】:

我被要求在 Bitbucket 的一个分支中推送一些东西。那里有5个分店:

  • master
  • important1/B1
  • important1/B2
  • important2/B1
  • important2/B2

我被要求将我的东西推送到important2/B2。但是,当我使用 url https://******@bitbucket.org/important/important.git 克隆存储库时,我的硬盘上只克隆了 important1/B1important1/B2,但没有克隆其他两个目录。

然后我尝试使用一些签出命令,我只能克隆important2/B2,然后我尝试推送它,它说一切都推送不再提交。但是我检查了bitbucket,我的文件不在里面。

我必须编写哪些确切的命令来克隆我的分支然后再次推送它?我的时间不多了;这就是为什么我不得不在这里问。顺便说一句,我也是 Git 和 Bitbucket 的新用户。

【问题讨论】:

  • 您可以创建一个真实的用户名,而不是恰好位于主行的字母。二、git branch -a的输出是什么?

标签: git bitbucket git-push git-clone


【解决方案1】:

有很多方法可以做到这一点,但这里有一种方法:

git clone https://******@bitbucket.org/important/important.git # if you already have a clone, just run git pull to get things up to date
git checkout -b important2/B2 --track origin/important2/B2 # will create a branch importan2/B2 locally and track the remote important2/B2 on origin (https://******@bitbucket.org/important/important.git)
# edit files
git status # check which files have been edited
git commit -m "COMIT_MESSAGE" -a # alternatively use git add per file before commit and no -a
git push origin important2/B2 # push your changes up to remote

如果最后一个命令失败,那是因为在您最后一次将它们拉入时在遥控器上进行了更改。您可以通过运行git pull --rebase 来解决此问题,然后再次推送,假设没有冲突。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-06-11
    • 2016-12-24
    • 1970-01-01
    • 2019-02-02
    • 2017-12-15
    • 2019-12-01
    • 1970-01-01
    相关资源
    最近更新 更多