GitHub branch always one commit behind master

Trevör

I have a GitHub project with a master branch and a dev branch, when I merged from dev to master, I see that the merge commit seems to cause the dev branch to be considered one commit behind master.

Is this something common with such a workflow? Or did I do something wrong? I tried merging back from master to dev, but it became worse (one commit behind + one commit in front). Also tried a rebase merge from master to dev but dev stayed one commit behind.

What's the solution to this?

Thank you

EDIT with commit history from dev: enter image description here

And master: enter image description here

RomainValeri

Updated answer

Ok, you've proceeded with pull requests, but the overall principle is the same : yes when you merge into master for the first time, your source branch (develop) becomes in the process effectively one commit behind, like I described in the first version below. You can be reassured that it's typical in this kind of workflow, and it won't keep you from merging down the line, they're just a fast-forward away.


(Below, first version of the answer, wrongly assuming local merge operations)

When you're at the point you describe after the first merge, with master having one more commit, it's the merge commit, as you correctly guessed.

At this point all you need to do if you want the two branches to be perfectly synchronized (although at this point they're already similar in terms of files) is to merge master back into develop, it will be a simple fast-forward where develop gets the last commit.

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

分類Dev

github. How would one merge all changes from the master branch into another branch?

分類Dev

move branch from master commit to previous master commit

分類Dev

Github | fetch commit that not belong to branch

分類Dev

How to transfer a commit from master to another branch?

分類Dev

git copy one commit to new branch

分類Dev

Git: Squash feature branch and merge commit, rebase on master

分類Dev

Git Move Not-Pushed Commit from temp to master branch

分類Dev

Git Move Not-Pushed Commit from temp to master branch

分類Dev

How to run a GitHub Action from a branch other than master?

分類Dev

In GitHub how can I grant an app permissions to commit to a branch with protections?

分類Dev

React-Redux: State always one input behind

分類Dev

Extremely simple git/Github use case of merging simple 1 commit branch causes branch deletion failure

分類Dev

git status --short: missing "Your branch is ahead of 'origin/master' by 1 commit"

分類Dev

Refresh repo on a ubuntu server when master branch on GitHub is updated. How can I do this?

分類Dev

git abandon master branch

分類Dev

git master branch is crazy

分類Dev

Reasons not to commit to master

分類Dev

When I console.log a user's radio button selection, what logs is always one behind

分類Dev

Merge a branch from another branch in master

分類Dev

How do I add commits to a pull request someone sent me, if github tells me "Add more commits by pushing to the master branch on..."?

分類Dev

Git merge master into feature branch

分類Dev

Master and branch showing the same changes

分類Dev

how to reset develop branch to master

分類Dev

Prevent pushing to master on GitHub?

分類Dev

Prevent pushing to master on GitHub?

分類Dev

Create empty branch on GitHub

分類Dev

upload files to a branch in github

分類Dev

Local Branch deleted in github

分類Dev

Commit with wrong username to github

Related 関連記事

  1. 1

    github. How would one merge all changes from the master branch into another branch?

  2. 2

    move branch from master commit to previous master commit

  3. 3

    Github | fetch commit that not belong to branch

  4. 4

    How to transfer a commit from master to another branch?

  5. 5

    git copy one commit to new branch

  6. 6

    Git: Squash feature branch and merge commit, rebase on master

  7. 7

    Git Move Not-Pushed Commit from temp to master branch

  8. 8

    Git Move Not-Pushed Commit from temp to master branch

  9. 9

    How to run a GitHub Action from a branch other than master?

  10. 10

    In GitHub how can I grant an app permissions to commit to a branch with protections?

  11. 11

    React-Redux: State always one input behind

  12. 12

    Extremely simple git/Github use case of merging simple 1 commit branch causes branch deletion failure

  13. 13

    git status --short: missing "Your branch is ahead of 'origin/master' by 1 commit"

  14. 14

    Refresh repo on a ubuntu server when master branch on GitHub is updated. How can I do this?

  15. 15

    git abandon master branch

  16. 16

    git master branch is crazy

  17. 17

    Reasons not to commit to master

  18. 18

    When I console.log a user's radio button selection, what logs is always one behind

  19. 19

    Merge a branch from another branch in master

  20. 20

    How do I add commits to a pull request someone sent me, if github tells me "Add more commits by pushing to the master branch on..."?

  21. 21

    Git merge master into feature branch

  22. 22

    Master and branch showing the same changes

  23. 23

    how to reset develop branch to master

  24. 24

    Prevent pushing to master on GitHub?

  25. 25

    Prevent pushing to master on GitHub?

  26. 26

    Create empty branch on GitHub

  27. 27

    upload files to a branch in github

  28. 28

    Local Branch deleted in github

  29. 29

    Commit with wrong username to github

ホットタグ

アーカイブ