3

According to this post I want to see into the SmartGit git client the ramifications for the new branches. Bellow, I will explain in detail the steps I do and what SmartGit displays and what I expect to be displayed:

Steps:

s1) create a local git repository by cloning the remote one:

git clone https:/myusername:mypassword@remoteRepoAddress/repo3

s2) cd to repo3 git local repository that I just created and then add a text in a new file:

echo "aaa" >> file1

s3) add the file to be commited:

git add .

s4) commit the changes:

git commit -m "commit1"

s5) add another row to the file1 and commit changes

echo "bbb" >> file1
git add .
git commit -m "commit2"

s6) push changes to the remote repository:

git push origin master

Now, the SmartGit displays a single line, for the master branch, ant the two commits:

enter image description here

s7) Create another branch "newBranch1":

git checkout -b newBranch1

s8) then I make one commit on this branch:

echo "row1" >> file2
git add .
git commit -m "commit1_newBranch1"

Now, the SmartGit displays:

enter image description here

According to "Figure 20" in the post mentioned at the beginning, it is ok: the commit has advanced with one node against the last commit on the master branch. s9) Then I switch back to the master branch and from the last commit point on master I create another branch "newBranch2"; I add a new file "file3" with the text "row1", then I commit changes:

git checkout master
git checkout -b newBranch2
echo "row1" >> file3
git add .
git commit -m "commit1_newBranch2"

Now the SmartGit displays:

enter image description here

and I expect to see a tree like in "Figure 21" in the post mentioned above. Or as bellow:

 newBranch2 o   o newBranch1  
             \ /  
              o master's head
              |
              o
              |

Am I misunderstanding how the git an/or SmartGit works? If so, please guide me with concrete answers. Thansk in advance

Community
  • 1
  • 1
Nelly Junior
  • 556
  • 2
  • 10
  • 30

2 Answers2

5

It seems to me you're misunderstanding how the SmartGit log views work.

You're seeing a history of newBranch2 because that's where HEAD is (and a history of HEAD is the default log in most git clients). I think specifically you're looking at the "Journal" tab in the default view, yes?

What you want is a log showing the history of all refs. If you click the log button in the upper-right, it will bring up a window that starts out showing the same "history of HEAD", but with a checkbox tree to the left where you can select what else you want to see. Mark the "local branches" checkbox and you should see what you're after. You'll note that you can also select specific branches, remote branch refs (by remote or by individual ref), tags (specific tags or all tags), and dangling commits (which it calls 'recyclable commits').

Mark Adelsberger
  • 42,148
  • 4
  • 35
  • 52
  • 1
    Not sure how much the interface has changed in the 2 years since you answered this, but as of today I'm not seeing a "log" button anywhere in SmartGit. Is it still possible to see a view of all branches in SmartGit? That's the default view for a similar product called Source Tree (which isn't available on Linux). – soapergem Nov 05 '19 at 20:52
  • @soapergem - Unfortunately I haven't looked at SmartGit in a VERY long time (essentially since writing this answer). In general I don't use a GUI for git. If the product docs (and/or support) don't provide a suitable explanation of how to show logs, you might consider asking a new question (though I'm honestly not sure whether SO is the best forum for it). Sorry to not be able to clarify this – Mark Adelsberger Nov 05 '19 at 22:38
-1

You got the way git and SmartGit work. But, I think you misunderstanding the way Smartgit show graph. You can use the command below to show the original git graph:

git log --graph --decorate --oneline --all

I think you should use Gitkraken: It will be better than Smartgit on Ubuntu: https://www.gitkraken.com/

Hope it will be useful!!!

An Huy
  • 432
  • 3
  • 7
  • @ An Huy: the command you posted does show a graph, but I want to see it in SmartGit. SmartGit is not my choice , I have to use it. Do you think that in gitkraken the graph is diplayed as expected? Thank you for trying to help. – Nelly Junior Jun 21 '17 at 11:14
  • Indeed, it seem that GitKraken shows the branches in a forked graph. However, I would like to make it possible in SmartGit. – Nelly Junior Jun 21 '17 at 11:48
  • 2
    Of course it does (as almost every Git GUI client), just check @mark-adelberger's answer – mstrap Jun 21 '17 at 13:36
  • @Mark Adelsberger: Thank you! – Nelly Junior Jun 21 '17 at 14:06