git - 无法获取本地 Git 更改以推送到远程分支
问题描述
我有一个链接到 Azure Repos 的本地 Git 存储库。我有一个 Master、Development 和几个功能分支。我想将所有更改推送到开发分支,然后将其合并到 Master。
问题是我的 git 状态不断从“......最新......”变为“你的分支领先......”。如果我使用 git pull/git push,我的 git status 说一切都很好,但是如果我等待几分钟,git status 说我的分支又在前面了。我不确定我弄坏了什么。
$ git status
On branch development
Your branch is up to date with 'origin/development'.
nothing to commit, working tree clean
$ git status
On branch development
Your branch is ahead of 'origin/development' by 14 commits.
(use "git push" to publish your local commits)
nothing to commit, working tree clean
$ git branch -avv
KJG---Initialize-expComputer 921b26b [origin/KJG---Initialize-expComputer] Updated output object
KJG--Write-expLog cb0db50 [origin/KJG--Write-expLog] added test-function
KJG-Continue-expComputer 07a6edd [origin/KJG-Continue-expComputer] save
NewFeature--Get-expADSite 4c6d991 [origin/NewFeature--Get-expADSite] platyps update
* development c38a0c5 [origin/development: ahead 14] !Deploy 4.1.4
master 2e01d04 [origin/master: ahead 7] Merge branch 'master' of https://<The Azure Repo Path>
remotes/origin/ARBranch 7b4f849 removed mandatory bluebeam parameter from init-expComp
remotes/origin/Development 6e7b779 !Deploy 4.1.2
remotes/origin/KJG---Initialize-expComputer 921b26b Updated output object
remotes/origin/KJG--Write-expLog cb0db50 added test-function
remotes/origin/KJG-Continue-expComputer 07a6edd save
remotes/origin/Master c33f046 Merge branch 'development' into Master
remotes/origin/NewFeature--Get-expADSite 4c6d991 platyps update
remotes/origin/NewFeature-expPing 2751a6d updated help
解决方案
您是否尝试过诸如
git push origin development:development
确保将本地development
分支推送到的明确方法origin/development
?
编辑(2020 年 4 月 2 日):请参阅下面关于使用development
和Development
作为您的两个分支名称的评论
推荐阅读
- java - Java GUI,从一个类转换到另一个类
- ansible - Ansible - 如何检查列表中的所有元素是否相同?
- javascript - 尝试使用 NodeJS 从 SQLite DB 获取数据
- oracle - 递归 WITH 查询在 oracle 中如何工作?什么时候进入循环?
- sas - 转换 SAS DATE 并在 PROC SQL 中使用
- visual-studio-code - VSCode多次复制粘贴?
- jasperserver - Jasper 服务器...仪表板在哪里?
- javascript - 使用 toJson 和不使用它进行测试
- ios - iOS Safari 在底部不需要的空白处粘滞输入
- python - 如何在二维列表中同时打印每一行和每一列?