youngmon/atlassian-qna huggingface dataset:
Error 128 after removing local branch (bug?)
Asked by tonka:

Hy,

I'm new to git (used svn before). I play around with git for a while (command-line) and now i want to switch to Source Tree. This app is really nice. But now i have a little problem with it.

I clone my test-git-repo from github. It is an simple repo with some text-files with a few lines in it. I made a local branch (mybranch). Make two commits. I've changed the same line in the master-branch (to cause a merge conflict - because i want to test this scenario). When i merge (or merge with rebase checked) i get my conflict and i fixed it with the interal tools from source tree. After this step i want to remove the branch (mybranch). I checkout the master and make a right click onto 'mybranch' and click 'delete mybranch'. In the popup window i will not check the 'force remove' checkbox and then i press remove. After this the Source tree starts printing the error message "'git log' failed with code 128:'fatal:bad revison 'mybranch'' " every time i do something in source tree. I can only fix that if i close the actual repo-window and start the same repo from the start-window of source tree where i can add/select my repo.

Did i do something wrong? or is this a bug?

This error is reproduceable.

My setup:

OS: Mac OS X Mavericks  
Source Tree: V1.8.1  
Git: Embedded version (1.8.4.2)

Thanks in advance

Tonka


Answers:
author: mikepfl
body: Same problem here Sept 2015.

Version 2.0.5.2 (2.0.5.2)


Tags: bug

error
How to remove a file from a commit using amend in SourceTree?
Asked by Jonas Bang Christensen:

Use case:

I have committed a commit with 3 files in it. Now I want to amend that commit with only 2 of the 3 files in it, i.e. I want to remove 1 file from the commit.

Solution in Git GUI:

In "git gui", when selecting "Amend last commit", all the content of the commit gets listed in "Staged Changes" window, thus enabling the user to unstage files / lines before committing the new commit.

Problem in SourceTree:

When selecting "Amend latest commit" it does not list the content from the latest commit in the "Staged Changes" window, thus it is not possible to remove files / lines from the commit, only to add new files / lines to the commit.

Or am I missing some option?

Br,  
Jonas


Answers:
author: Seth
body: If you want to undo part of the previous commit by amending, you should revert those changes in your working copy, and commit using the "amend last commit" option.

comments: author: Jonas Bang Christensen
body: Seth, the commit amend workflow in SourceTree would then be:

1) Reverse commit  
2) Reset soft  
3) Commit amend (where you unstage the unwanted file)

The commit amend workflow in "git gui" is:

1) Commit amend (where you unstage the unwanted file)

The simple reason is that in "git gui" all content from latest commit is listed in "Staged Changes" window, SourceTree does not list those.

This has 2 negative impacts (in my mind):

1) When you do a commit amend in SourceTree (even if you are just adding stuff, not removing anything) you can not see the full list of changes which you are about to commit, only what you have added/changed on top of your commit. You basically don't know what you are committing, (unless you "reverse" and "reset" each time before a commit amend).  
2) If you want to remove a file or change from a commit by amending it, you have to do a "reverse" and "reset" first. Or, click "Terminal" and fire up "git gui" ...

But yes, you have answered my question (though I already knew how to do this, was just puzzled about the fact that it was such a cumbersome process in SurceTree when I'm used to an easy one-step process in "git gui").

Just my 2 cent ... and hoping to see this native Git feature added to the SourceTree backlog ;o)  

Br,  
Jonas


author: Seth
body: You don't need to reverse the old commit. If you view the previous commit, you can reverse just specific chunks. These reversions are written to your working copy, not automatically committed.

In terms of the first negative impact, I'd rather see just what I'm changing from the previous commit, rather than a compliation of changes from both my working copy and the commit that's being amended. I guess that just comes down to personal preference.
How to search in commit descriptions
Asked by Mathieu Rivest:

Can sourcetree be used to search in commit descriptions in a branch (or multiple branches..)?

Seems strange that I can't seem to find such a useful feature.


Answers:
author: Seth
body: At the bottom of the interface is a search tab (File Status, Log / History, Search). It does search commit messages, but I don't think it can be restricted to a particular branch.

comments: author: Seth
body: You can also search file changes or authors using the dropdown to the right of the search box, but that doesn't sound particularly helpful.


author: Shlomo Konwisser
body: Meanwhile, the search view button moved to the top left corner of the UI where you can switch between

* File Status (check-mark symbol)
* Log (clock symbol)
* Search (magnifying glass symbol)

Select Search, "Commit Message" next to the "Search:" label and enter your search String left of it, and hit Enter.

comments: author: shiroamada
body: Thank for the update, the Magnifying glass symbol just not catch my eye attention. I am looking for it. Thanks for your update!


author: Trevin Wisaksana
body: For Mac users, you can also use the "Command + 3" shortcut


author: Bash Xu
body: ???? 2016-08-15 ??3.55.52.png  
[](https://community.atlassian.com/t5/Sourcetree-questions/How-to-search-in-commit-descriptions/qaq-p/42188?attachment-id=5708){#link_116bbc1fccf212}  
[](/tnckb94959/attachments/tnckb94959/sourcetree-questions/1244/1/%E5%B1%8F%E5%B9%95%E5%BF%AB%E7%85%A7%202016-08-15%20%E4%B8%8B%E5%8D%883.55.52.png){#display_116bbc1fccf212_0}


author: eonyanov2014
body: I using SourceTree 3.3.8 and can't find Searching by commit SHA. Where is it?


author: rejem
body: Just for the record - searching anything "in a branch" is not possible due to the principle of branches. Branch is only a pointer to a single commit, which is considered to be "the last commit of the branch", and commits itself do not "belong to a branch" anyhow else.

Therefore, git cannot determine "which branch was which" before merge commits.
error: RPC failed; result=18, HTTP code = 200
Asked by nTahri:

Hello,

I've tried unsuccefully to fixe this error serval times, can anybady help me with this please. Thank you

=============================================================================================

= git -c diff.mnemonicprefix=false -c core.quotepath=false -c credential.helper=sourcetree = = =

= clone = <https://githost.gi.polymtl.ca/git/inf2990-13>/Users/nabilonY/inf2990-13 =

= error: RPC failed; result=18, HTTP code = 200 =

= fatal: The remote end hung up unexpectedly =

= fatal: protocol error: bad pack header =

= Cloning into '/Users/nabilonY/inf2990-13'... =

= Completed with errors, see above =

=============================================================================================


Answers:
author: nTahri
body: The only way that I found to resolve this problem is to use terminal for cloninf repository and dorg and drap the directory to sourcetree window


author: Ashley Wilson
body: I'm getting the same error, clone works from terminal but errors when using the GUI.

```
fatal: The remote end hung up unexpectedlyfatal: protocol error: bad pack headererror: RPC failed; result=18, HTTP code = 200
```


author: nTahri
body: If i use the same command in the Terminal there is not problem but by using sourceTree I got the error above

git -c diff.mnemonicprefix=false -c core.quotepath=false -c credential.helper=sourcetree clone <https://githost.gi.polymtl.ca/git/inf2990-13>/Users/nabilonY/inf2990-13
How can I use SourceTree from the command line to browse the differences between two commits
Asked by Alan Laird:

Hi,

I would like to do something like this:

open -a SourceTree puppetlabs-apache 8340107...97b5594ffd3b7fec169f807d3dee07cb094982a5

Thanks!

Alan


Answers:
author: Seth
body: If you want to use the command line, you should just use the git client. SourceTree is just a UI wrapper to a git command line client anyway.

git diff 8340107 97b5594ffd3b7fec169f807d3dee07cb094982a5

<https://www.kernel.org/pub/software/scm/git/docs/git-diff.html>

comments: author: HocoH
body: " SourceTree is just a UI wrapper to a git command line client anyway" : yep you made my day


author: Rebecca Keller
body: Disagree big time. Contrast gitextensions which provides a number of command-line entry points to it's gui. I can bring up it's merge tool, invoke graphical blame, log of a specific file, etc, all from command line. ditto TortoiseGit.

I'm overwhelmingly primarily a commandline dev but I don't want to view a blame via commandline, but it's usually easier for me to specify a path on the commandline

looks like sourcetree.exe /? provides some help, and there's a few commands status, log, filelog, commit, but it's pretty bare compared to gitextensions or tortoise


author: Alan Laird
body: Hi Seth,

I don't understand your question. I'm trying to determine if I can invoke sourcetree from the command line and browse the changes between two commits. I do this currently with git on the command line but it's really tedious when you have an active project with a lot of committers.

A good example of this is when you are browsing down commits and you see a file diff and you would like to step sideways through changes on that file with log display.

Alan


author: Marnen Laibow-Koser
body: GitX has a feature like this: you can do

```
gitx --diff &lt;arguments to git diff&gt;
```

and see the diff nicely formatted. SourceTree should have a similar command.

comments: author: Seth
body: As far as I know, SourceTree is exclusively GUI. The only commands it provides are alternate ways to launch the GUI.


author: Marnen Laibow-Koser
body: I should have been clearer. The GitX command above opens the diff \*in the GUI\*, and I would expect any similar SourceTree command to so likewise.


author: Alan Laird
body: I'd like be able to browse an active project between releases to see changes and the commit logs for each change. 'git diff branch..branch' is very file oriented. I will do a 'git diff --name-status branch1..branch1' sometimes.

I do this as well...

git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)\<%an\>%Creset' --abbrev-commit"

git lg -p branch1..branch2 and it's pretty good looking but it's not very usable on large numbers of changes.

comments: author: Seth
body: So what differences would you expect in a SourceTree diff?
SourceTree can't see current file contents
Asked by Peter Mauger:

I ran an initial commit of all of my code on 29th January. I've been working on the code on and off and wanted to check in the changes. When I go into my repository in SourceTree all of the files show up in Files in the working tree with + symbols indicating that they are new files. Selecting any of them shows the entire contents of the file from when I checked the files in in January. I've checked the bitbucket website and the files were definitely correctly checked in on the intial checkin. When I try and commit there are no files showing up because SourceTree has decided that nothing has changed.

I haven't used source control a great deal and have run into significant problems with it in the past (including wiping out 2 months worth of work on one occasion) so I don't know how to proceed.


Answers:
author: Seth
body: You should be able to re-copy the directory with your latest changes into the git-controlled working copy without any issue. Just make sure that the directory where you made your changes does NOT have a hidden .git directory, as that would overwrite your repository, not just your working copy.


author: Peter Mauger
body: Egads! It turns out SourceTree decided to duplicate the entire project into an (almost) identical file path. Hence there were no changes to the files because I wasn't 'working' on the files... This is going to get messy...

comments: author: KieranA
body: SourceTree has no capability to do this unless you manually clone within SourceTree itself. There's no copy functionality, and clones are only done through the clone dialog unless you pull down a subtree/submodule (which is also a manual operation)

Source: SourceTree developer (me) ;)


author: Peter Mauger
body: I THINK that what happened was:

When I was creating the repository I tried to connect it directly to my original source code root folder

SourceTree told me it couldn't clone to a non-empty folder

I cloned to a slightly differently named folder and then copied the files across to check them in (leaving it uploading for quite a while)

When I returned to my code a few days later I COMPLETELY forgot to work in the new working folder and continued working in the original folder (which wasn't being tracked by SourceTree)

What I can't understand is why I couldn't nominate a non-empty folder as my working folder when my bitbucket repository had no files in it at all? I can understand there would be a problem if there was existing code in the repository but surely I should be able to say 'here you go empty repository, this is my working folder I've been using up until I decided to put the code under source control'???
change language to english
Asked by Wang Haojie:

I just install sourcetree in win7 system, but found current version's language is chinese. How could I change the language to english?


Answers:
author: KieranA
body: Hey there,

Tools \> Options \> General tab. There's a "Misc" section with a "Language" drop-down.

![](../../upfiles/Screen_Shot_2014-02-20_at_09.34.34_am.png)

![](../../upfiles/language.png)

Hope that helps


author: J?r?me
body: ![file1.png](https://community.atlassian.com/t5/image/serverpage/image-id/104069iDA22C1AAC2907C41/image-size/large?v=v2&px=999 "file1.png")![file2.png](https://community.atlassian.com/t5/image/serverpage/image-id/104070iCC7AB8645A2970F5/image-size/large?v=v2&px=999 "file2.png")


author: Maguelonne Beaud de Brive
body: after that I closed and open SourceTree again and it worked! thanks


Tags: windows
Squash Commits in SourceTree for Windows
Asked by Andrew Weiss:

Does the current version of SourceTree for Windows (1.4.1.0) have the ability to squash commits as in the Mac version?

Thanks


Answers:
author: KieranA
body: Hey Andrew,

If you're referring to interactive rebase, this is scheduled for 1.5.0 so it'll be in there.

Hope that helps
Windows SourceTree Terminal Button now plain DOS console
Asked by oompaloompadiapers:

I've installed the embeddable git with SourceTree on Windows.

I used to click "Terminal" to get a nice \*NIX like prompt with git available on the command line (as described [here](/questions/145087/change-terminal-that-is-launched-on-windows-version) -- ignore the question; just showing someone else has seen the bash command line, and I'm not crazy).

Now I just get a plain jane system32 DOS console window when I click "Terminal".

I haven't reinstalled SourceTree or anything wack that might understandably cause this. I've onlyupdated when requested, and just tried "Update Embedded Git" in the Options, just to see if that'd help.

Thanks.


Answers:
author: Porter Bassett
body: I encountered the same problem today.

Yesterday, it was opening git bash. But today, it's opening cmd.exe

It turns out that SourceTree opens cmd.exe for hg repositories, and git bash for git repositories.


author: Daniel Jarman
body: I just had this happen in the past few days.
Is Sourcetree compatible with Gitblit as a repository?
Asked by Gary Maxwell:

Is it possible to interface Sourcetree with a GitBlit repository ?


Answers:
author: Seth
body: Can a standard command-line git client interface with a GitBlit repo? If so, then SourceTree shouldn't have any problem, and shouldn't cause any problems for GitBlit.

comments: author: Pablo Beltran
body: I've used the git command line against Gitblit without any problem.


author: Seth
body: Then SourceTree should work fine. Let us know if you have any specific problems.
SourceTree push refspec is not taken into account
Asked by Lewis Diamond:

I have configured my remote's push refspec for remote 'user' to push to refs/users/myusername/heads/\* such that \`git push user\` sends my modification to my userspace on my gerrit server.

It all works well from the command line, but SourceTree doesn't let me use the default push refspec. It always overrides the target branch with a value, doesn't let me push without a defined target branch and makes it increadibly hard for me to actually find out what it actually does.

A solution is obviously a custom button but SourceTree should really honor the push refspec config.


Answers:
author: Seth
body: Sounds like a feature request. You'll get more attention here: [jira.atlassian.com](http://jira.atlassian.com)


Tags: windows
SourceTree username authentication grayed out
Asked by Nathan Morley:

Hello, I was attempted to pull from a repository when it authenticated me to log in using my github username and password. After entering what I thought was my github username and password, it failed to authenticate, then I noticed that I was using the wrong username. It would have been convenient and also quick to simply change my username right there, but apparantly it is not so. How do I change my SourceTree github authentication?


Answers:
author: Mark Johnston
body: Try Tools-\>Options-\>Authentication tab. That's how I was able to solve this problem.

comments: author: Ricardo Muniz
body: This solved my issue! Thanks a lot!


author: radical.ignorant
body: That's most straight forward solution, but... didn't work for me.


author: Ashley Bartlett
body: My old username that was greyed out wasn't displaying in the 'saved passwords' list so I couldn't remove it or edit it. Therefore, I found the following to work:

Reset the global settings by running:  
git config --global user.name "NewUserName"  
After that, restart SourceTree to check if it works.

Source: <https://answers.atlassian.com/questions/206806>

I then managed to remove my old username from the 'saved passwords' list.

comments: author: radical.ignorant
body: It helped remove record in tools -\> options -\> authentication, but didn't solve the problem. Still when trying to push to github it's passing old username and while I can type in correct password I can not change invalid username :(


author: Dave Rushton
body: I am having the same issue on a new PC . THe version I have had for many years on my desktop works great


Tags: authentication

github

user
Help improve by sending... what?
Asked by Martijn Saly:

When I just started SourceTree (latest version) for the first time, it asks a question:

"Help improve SourceTree by sending"

With a checkmark next to it.

Ehm, sending what?


Answers:
author: KieranA
body: Hi Martijn,

Are you saying that the text is cut off? If so, have you got a screenshot of this so we can take a look?

Thanks in advance

comments: author: Martijn Saly
body: Apparently so. If after the word "sending" there's supposed to be more, then yes, it is cut off. I'll post a screenshot shortly, as I don't have access to the computer it's installed on right now.

In the mean time, can you explain how to make that "help improve" window to show up again? I assume it only shows on the very first start...


author: Jamie Echlin
body: This is covered in excuciating detail here: [https://confluence.atlassian.com/display/SOURCETREEKB/Analytics+-+What%27s+Recorded](https://confluence.atlassian.com/display/SOURCETREEKB/Analytics+-+What%2527s+Recorded)
How do I fetch a tracked remote branch that is not checked out from the GUI.
Asked by Richard Smith:

Basically, how do I issue this command from the GUI:

git fetch \<remote\> \<rbranch\>:\<lbranch\>

I would like to be able to right click on a local branch that is tracking a remote branch and click "fetch".

Am I missing something obvious?


Answers:
author: Richard Smith
body: So then, there is no GUI equivalent to:

git fetch origin FLASHID_Branch:FLASHID_Branch


author: Seth
body: For me, if I hit the fetch button at the top, it updates information from remotes for all of my branches. Are you specifically wanting to exclude some branches from the fetch?

comments: author: Richard Smith
body: For these changes I don't really need to exclude some branches. I could see needing that in the future.

Also, the fetch button on the top doesn't work for me. The command completes. The full output says "Completed successfully" but afterwards it still shows that I am 1 commit behind, both in the indicator next to the local branch name and the history graph display.

I ended up launching the git terminal and typing in the command and the fetch works fine. That's what led me to the question "can I specifically fetch one branches changes from the GUI".


author: Seth
body: Ahh. That's not a fetch, that's a pull. And you do need to check out the branch to pull in remote changes.


author: Seth
body: To be more detailed here, the SourceTree behind/ahead status is comparing local branches to remote branches. The fetch will make a local copy of the remote branch, but does not modify the local branch.


author: Richard Smith
body: Sorry, I missed the last part of your question. I have a local repo with two local branches that are tracking to remote branches. When the branch that I do not have checked out shows an available commit on the remote branch, I'd like to be able to right click on the local branch and fetch the changes:

![](../../upfiles/LogMeIn_Client.png)

I should also note that I am using the Windows version.


author: Richard Smith
body: When I click fetch on a menu that pops up when I right click on a local branch, I'd like the GUI to issue the command I included in the first post. The application has all the information needed when the local branch is tracking a remote.


author: Richard Smith
body: When I click fetch on a menu that pops up when I right click on a local branch, I'd like the GUI to issue the command I included in the first post. The application has all the information needed when the local branch is tracking a remote.

<br />


author: Seth
body: What do you want to happen when you click fetch?

In other words, what are you expecting to change in the UI following a fetch command?