Git merge develops into functional branches "Already in the know", while it is not

I checked a functional branch from development called branch-x . After some time, other people pushed changes into the developing branch.

I want to combine these changes with my branch-x . However, if I do

 git merge develop 

it says "Already relevant" and does not allow me to merge.

git diff develop shows that there are differences between branch-x and development.

How do I merge into branch-x ?

+42
source share
3 answers

You must first pull changes from the develop branch, and then merge them with your branch:

 git checkout develop git pull git checkout branch-x git rebase develop 

Or when on branch-x :

 git fetch && git rebase origin/develop 

I have an alias that saves me a lot of time. Add to ~/.gitconfig :

 [alias] fr = "!f() { git fetch && git rebase origin/"$1"; }; f" 

Now all you have to do is:

 git fr develop 
+80
source

My repo originally said, "Already in the know."

 MINGW64 (feature/Issue_123) $ git merge develop 

Output:

 Already up to date. 

But the code is not updated & it shows some differences in some files.

 MINGW64 (feature/Issue_123) $ git diff develop 

Output:

 diff --git a/src/main/database/sql/additional/pkg_etl.sql b/src/main/database/sql/additional/pkg_etl.sql index ba2a257..1c219bb 100644 --- a/src/main/database/sql/additional/pkg_etl.sql +++ b/src/main/database/sql/additional/pkg_etl.sql 

However, merging corrects this.

 MINGW64 (feature/Issue_123) $ git merge origin/develop 

Output:

 Updating c7c0ac9..09959e3 Fast-forward 3 files changed, 157 insertions(+), 92 deletions(-) 

I confirmed this again with the diff .

 MINGW64 (feature/Issue_123) $ git diff develop 

No code differences now!

+4
source
 git fetch && git merge origin/develop 
0
source

Source: https://habr.com/ru/post/1234516/


All Articles