I just created the created git branch structure as follows:

Generated from:
git init echo "Hello World" > file1.txt git add file1.txt git commit -m "Hello world" git checkout -b A echo "This is from A branch" > file2.txt git add file2.txt git commit -m "from A branch" git checkout -b B echo "This is from B branch" >> file2.txt git commit -a -m "from B branch"
Now I clone this structure and synchronize the master , A and B branches:
git clone /path-to-source/ git checkout -b master remotes/origin/master git checkout -b A remotes/origin/A
and the cloned repository reflects the original hierarchy:

Now I go back to the original folder and add something to master and rebase A and B:
cd /path-to-source/ git checkout master echo "more files" > file3.txt git add file3.txt git commit -m "Improved master" git checkout A git rebase master git checkout B git rebase A

The problem occurs when I return to the cloned repository and try to keep this structure. If I only pull the master branch, I get the following:

I can go to each branch and update:
git checkout A git pull
but I get tree branches like this:

The question is how to keep a clean repository clone? I want to get this (manipulated graphics) in a cloned repository:

Bonus If possible, I would like to find a way to keep the commits in branches A or B as well, like this:

generated from these commands in the source repository:
git checkout A echo "something" > other.txt git add other.txt git commit -m "Other A commit" git checkout B git rebase A
NOTE 1 If this helps, the cloned repository NEVER completes NOTE 2 . You can assume that only 1 user is sent to the original repository