Let’s have a file readme.txt and such a branch structure
master
|
branch_a
|
branch_b
How this structure is organized:
-
When we are in master:
git checkout -b branch_a
echo “a” >> readme.txt
git add .
git commit -am “a” -
git checkout -b branch_b
echo “b” >> readme.txt
git add .
git commit -am “b”
Right now what we are in branch_b and we have in readme.txt:
a
b
Now, I’d like to make adjustment to readme.txt in branch_a. First, switch to branch_a:
git checkout branch_a
Then edit readme.txt like this:
a_1
Then I’d like to switch to branch_b, merge with branch_a and preserve the adjustments made in branch_a.
In other words, I’d like to run some commands so that in branch_b in readme.txt I would have:
a_1
b
Could you help me?