Git - Temporarily merge other branches into my current branch

I have a situation. Let's say two developers are working on two different branches Aand B.

 -- master --
|            |
A     <--    B  

The industry is Baffected by changes in A. However, the changes in are not yet merged into master. I would like to start working on my function (branch B) with the changes in A, and then discard them when I finished testing. What is the recommended way?

+4
source share
2 answers

Assume that branch B is currently on hold abc1234. The most direct answer to your question:

git checkout B
git merge A
# run your tests
git reset --hard abc1234

, , . , B A? , 3- "" ?

+2

:

  • , . , git , , . : , , .

    - (, SVN ), master SVN, .

  • . , , SVN-. , (. SO , ). , , , , , - .

    , , ( master), . , .

    : , , , . .

0

All Articles