【问题标题】:merged changes isn't considered as a change in the branch that i merged intomerged changes isn\'t considered as a change in the branch that i merged into
【发布时间】:2022-12-01 15:04:28
【问题描述】:

i have a simple question, if i have a branch called a then i checked out another branch from that one, called b, i made some changes in b, commited, then pushed it, and merged b back into a.

now a gets the changes locally on my machine but not in the github website, and a doesn't consider the changes that i've merged as a change in branch a so i can't manually commit then push to a so that it reflects on the github site. how to solve that ?

i tried to change the merged file then push manually, but why would i need to change the file after the merge if i already made all the changes before merging.

【问题讨论】:

  • did you not push after the merge?
  • i didn't push into branch a but i would do it if i can, that's the problem after i merge b into a, a has no changes to commit and push so i have to make further unnecessary edits in it if i want to push.
  • a has no changes to commit but it still has new commits that haven't been pushed yet (the ones you merged). git status should say something likeahead of 'origin/a' by X commits.

标签: git github git-merge


【解决方案1】:

and merged b back into a.

If you merged it online through PR (Pull Request), then you would need to refresh a locally.

If you merge it locally, then it depends on how b was merge to a, especially if "a has no changes to commit and push".

git switch a
git merge b
git push

【讨论】:

    猜你喜欢
    • 2019-10-09
    • 2022-12-27
    • 2013-02-13
    • 1970-01-01
    • 2018-11-07
    • 2022-12-28
    • 2022-11-20
    • 2013-10-18
    • 1970-01-01
    相关资源
    最近更新 更多