youngmon/atlassian-qna huggingface dataset:
How to add a tracked branch?
Asked by larrysms:

I have two remote branches named master and dev. When I go to pull from my remote dev branch to my local working copy, I get an alert saying, "Confirm Pull From Non-Tracked Branch - Are you sure you want to pull from a non-tracked branch?" Evidently, I am only tracking the master branch. How do I add dev to be tracked?


Answers:
author: Seth
body: If you double click the dev branch in the left panel, it should check out that branch and set it up as tracked.

comments: author: Bal?zs Szakm?ry
body: Right-click the one under the Remotes/Origin node, not the one under Branches (if you have it there).


author: Bal?zs Szakm?ry
body: correction: double-click, not right-click
SourceTree subtree with embedded git
Asked by Jochen H?berle:

I am running SourceTree 2.0.4 on Mac OS X Yosemite (10.10). The embedded Git 2.2.1 is active, nevertheless the Add Subtree command fails with:

git: 'subtree' is not a git command. See 'git --help'.

The help mentions possible problems only with system git and the linked resource <http://engineeredweb.com/blog/how-to-install-git-subtree/> does not fit my system. I neither installed Git from homebrew nor with the official installer. I guess my git was installed as part of the Xcode developer tools.

Nevertheless I am looking for a way to get Subtree working inside SourceTree with the embedded git Version. How can I do this?


Answers:
author: Micah Koffron
body: This happened to me as well, immediately after updating from 2.0.3 to 2.0.4 where the release notes indicate updating to a new version of embedded git.
How can I updated my password for the remote repository?
Asked by Carl R?ih?:

My password in the remote has changed and now I'm not able to push or pull anything from it. Previously Sourcetree asked for the new password in these situations, but not any more. My version is 1.6.12.0.

How can I make Sourcetree update the HTTPS password which it has stored somewhere for me?


Answers:
author: Bal?zs Szakm?ry
body: You can change the stored passwords in Tools\\Options\\Authentication.

comments: author: Carl R?ih?
body: Thank you. Actually I tried it but there are no usernames visible. Maybe I should raise a support ticket for this, maybe a new bug has been introduced.


author: Bal?zs Szakm?ry
body: That should mean that SourceTree has not saved any credentials. Do you perhaps get a well-hidden username/password window when you pull?


author: Seth
body: Based on the version number mentioned, I assume you are on Windows. Balazs's answer is good for you, but I believe Mac users who find this question will discover that SourceTree uses Mac's Keychain, and may have to open that interface to modify credentials.

comments: author: Carl R?ih?
body: You are correct. I'm on Windows.
How do I merge new Sourcetree install with existing local files & bitbucket?
Asked by mwsasser:

I recently had to rebuild my workstation. The backups of my htdocs are fine and they match the files on bitbucket. How do I mesh the two back together? What are the steps?

Sorry if I am not using the correct terminology.


Answers:
author: Seth
body: In the Sourcetree "Add Repository" dialog, use the "Add Working Copy" tab. That will add an existing local repository to SourceTree.

If that doesn't work, make sure that your htdocs backup includes a .git folder. If it does not, then you only backed up your working copy, not your whole repo, and you'll need to re-clone from bitbucket.


author: mwsasser
body: Thanks Seth. I had problems with this in the past, apparently it was because the .git folder was missing. Apparently I got lucky this time.
SourceTree hangs when pushing unless I re-add my ssh key
Asked by taji34:

Every time I close and re-open SourceTree it hangs when I try to push commits, this being all the farther it gets:

```
git -c diff.mnemonicprefix=false -c core.quotepath=false push -v --tags origin master:masterPushing to git@taji34:taji34/Troncraft.git
```

The only thing that fixes the problem is re-adding my ssh key, then everything works until the next time I close it. I'm using OpenSSH, is this a known problem and/or does it have a solution? If not I can live with it, it's just a tad bit annoying.


Answers:
author: Mark Gibson
body: I've been experience this (or a similar) problem, SourceTree hangs at this same point, although the push is successful. I never experience a problem doing a regular git push from a shell though.

I'll keep you updated if I discover anything more.

Doh, i've just realised this question is over a year old, did you find a solution?


author: taji34
body: Only my account is allowed to push to that repository. But I'm not having issues there, since I am able to push, it just seems that OpenSSH forgets that my SSH keys exist or something, so I have to re-add them everytime.


author: Bal?zs Szakm?ry
body: Do you have Tools\\Options\\Automatically start SSH agent... switched on? If not, it probably hangs because OpenSSH in not running when you push.

comments: author: taji34
body: Yes it is checked, but it's greyed out, so I don't think that is an option for OpenSSH.


author: Bal?zs Szakm?ry
body: Could you check if OpenSSH is actually running when you push?


author: taji34
body: Is there an easy way to check that?


author: Bal?zs Szakm?ry
body: Task Manager?


author: Bal?zs Szakm?ry
body: The push address seems to have a password in it.


Tags: ssh
SourceTree with a BitBucket Account that is on Multiple Teams
Asked by Shawn Carr:

I have the latest SourceTree installed on Windows and on Bitbucket my account is now on multiple teams. Now when I go to Clone a repository and select Hosted Repositories I only see one Team's repositories. I see no way to switch teams or to list all the different teams' repositories.

Am I missing something?

Thanks


Answers:
author: Shawn Carr
body: On the Mac version I do not have this issue as I see all 50+ repositories where as on the PC version I see only 2.


author: Shawn Carr
body: User Credentials.


author: Seth
body: In SourceTree, did you log in with your user credentials or your team credentials?


Tags: bitbucket-cloud

cloud
SourceTree: bulk git pull from repo browser
Asked by Lio Eters:

I have a library of shared repos used in several projects, and I often need to perform git pull on some/all of them to make sure each project has an updated library.

In the Repository Browser view, I can see which ones have new commits and am able to select multiple repos. Upon right-click, there is an option for "Custom Actions" which seems like a good place for bulk git pull on all selected repos. However, I couldn't find a way to add such a custom action. Could you point me in the right direction to achieve this?

If it's not possible from the Repo Browser, what would you recommend as a solution to git pull multiple repos all at once, rather than one by one?


Answers:
author: Seth
body: <https://answers.atlassian.com/questions/310308>

comments: author: Lio Eters
body: Thank you for the response. The link doesn't provide any solution unfortunately, only that it's not recommended to bulk git pull. I need a workable solution still, since it's not really practical to git pull 4\~5 repos one at a time for each project.Submodules could solve this, although this feature has brought other issues for me in the past. Subtree might work well to update all shared repos for each project.I did find a way to add a Custom Action, and I remember seeing a bash script that goes through a directory, finds all repos and performs git pull. If I find a solution, I'll post back here for other people in a similar situation.


author: Daniel Willitzer
body: @Lio Eters By chance did you find that script at all?


author: Lio Eters
body: @Daniel Willitzer This is what I'm using currently, a line in \~/.bash_profile:alias git-update='for dir in ./\*; do (if test -d "$dir/.git"; then echo "Updating $dir.." \&\& cd "$dir" \&\& git pull; fi); done'It runs git pull on all folders with a git repo, under the current working directory.


author: thijssen
body: [@Lio Eters](/t5/user/viewprofilepage/user-id/1089431) Thank you, I'm new to git and this helps me alot.


Tags: bulk-edit

git

pull-request
directory 'plugin' is not scanned.
Asked by Andi Pani:

There is a directory 'plugin' in a project, but it is not scanned by sourcetree.

If it ist named different eg 'pplugin' it is scanned.

'plugin' is not mentioned in global or project gitignorefile.

thanks,

andy


Answers:
author: Andi Pani
body: Oh I'm sorry, there was a second .ignore file somewhere deep in the tree.

thanks, Andi
external diff how to configure
Asked by Ni Xin:

Hi,

I'm going to use my own customized diff tool.

I have already integrated my customized diff tool with Git bash. In my .gitconfig file, I have:

\[diff\] external = \<my diff\>

And my customized diff tool can be used as normal git command from git bash:

**git diff --cached $FILENAME**

It works fine.

So with SourceTree, I go to Tools -\> Options -\> Diff, and in the External Diff section, I select "Custom" as External Diff Tool, and Diff Command as: **git diff --cached** , Arguments as: **$LOCAL**

But this doesn't work with the external diff button.

I can still call the cmd from Terminal and it works fine, but it won't work with the external diff button.

Can anyone help me on this?

Many thanks


Answers:
author: Bal?zs Szakm?ry
body: You need to configure **\<my diff\>** as the external diff tool, not **git diff --cached**.
How to display external diff result in panel
Asked by Ni Xin:

Hi

I'm trying to use an external diff, and I wish to display the diff result in the panel of SourceTree.

Currently when I simply trigger my external diff, nothing would happen, SourceTree couldn't capture the result. But if I change my config and make the external diff to output result to a local file in my pc, it will work.

How can I make SourceTree to display external diff result in its panel?

Thanks


Answers:
author: Bal?zs Szakm?ry
body: The external diff option will always open the diffing application, it does not display the results inside SourceTree.
How to resolve merge conflicts?
Asked by Rolf Marsh:

I had a branch that I needed to split into two (main branch: 3.2.0, new branch: 3.1.2 which was created by using "checkout". I made my changes to the new branch and now I want to merge 3.2.0 into 3.1.2. So I did a merge and now I have 3 files with "conflicts":

Screen Shot 2015-01-04 at 1.31.14 PM.png

So, I look at each file on the right of SourceTree and I see this:

Screen Shot 2015-01-04 at 1.32.31 PM.png

What do I do with this? What I would like to do is put this file(s) into an editor where I can make the changes. I don't understand why the other 20 files made it through without any "conflicts" and these three did not... or do I have more of a mess than is showing?

I think your app SourceTree is a god-send... don't know what I would do without it, but I think I really don't understand Git that well to be able to do this on my own. Thank you for your understanding.

Regards,

Rolf  
Prager, Phone Apps  
[](https://community.atlassian.com/t5/Sourcetree-questions/How-to-resolve-merge-conflicts/qaq-p/380987?attachment-id=9464){#link_117472ae54d099}  
[](/tnckb94959/attachments/tnckb94959/sourcetree-questions/40037/1/Screen%20Shot%202015-01-04%20at%201.31.14%20PM.png){#display_117472ae54d099_0}  
[](https://community.atlassian.com/t5/Sourcetree-questions/How-to-resolve-merge-conflicts/qaq-p/380987?attachment-id=9465){#link_117472ae54d099_0}  
[](/tnckb94959/attachments/tnckb94959/sourcetree-questions/40037/2/Screen%20Shot%202015-01-04%20at%201.32.31%20PM.png){#display_117472ae54d099_2}


Answers:
author: Bal?zs Szakm?ry
body: First of all, please do some reading in order to understand what a merge conflict is. Afterwards, you need to do the following:

1. Install a diff tool that can do 3-way merges, for example [KDiff3](http://sourceforge.net/projects/kdiff3/files/kdiff3/).
2. Configure this to be your external diff/merge tool in SourceTree (in Tools/Options/Diff).
3. In the place where you took the 1st screenshot, right-click on a file, Resolve Conflicts\\Launch External Merge Tool
4. Repeat the previous step for each conflicted file.
5. Commit (and push) your changes.

comments: author: Rolf Marsh
body: Balazs: boy, that (KDiff3) is one hell of a tool... thank you so much... I appreciate it.


author: murraycollingwood
body: A) I have tried reading the documentation on a merge conflict - it is terrible documentation with lots of explanations but no examples. Doesn't really work for a visual learner.

B) Step 2 - there is no Tools/Options/Diff. There is a Preferences option with a Diff tab, but there are no instructions about what to type in the command areas!

C) The "Resolve conflicts" option is not appearing anymore.

This may have been a good answer 4 years ago - it's not really helpful now.


Tags: conflict

git

merge
SourceTree crashs / slow
Asked by Martin_Lichtblau:

**SourceTree is slow, freaky slow!**   
Some people already asked in this and other forums but no real solution was found.   

So what is causing this problem? High CPU \& RAM usage after clicking on a commit with \~1000 files.  
SourceTree.PNG  

[](https://community.atlassian.com/t5/Sourcetree-questions/SourceTree-crashs-slow/qaq-p/348468?attachment-id=2099){#link_117472db581983}  
[](/tnckb94959/attachments/tnckb94959/sourcetree-questions/10409/1/SourceTree.PNG){#display_117472db581983_0}


Answers:
author: Seth
body: There is a bug report here. You can watch it for updates, and you can comment if you have NEW and HELPFUL information to add.

<https://jira.atlassian.com/browse/SRCTREEWIN-2093>
A specific file in a project shows changes when there are none (russian language file.)
Asked by Sean Cox:

Repo here: <https://github.com/4o66/KSP-Mod-Admin-aOS/tree/dev>

File path: KSP-Mod-Admin-aOS\\KSPModAdmin\\Languages\\KSPMA.rus.lang

This file is a translation file for localization. It always shows changes, for all lines deleted (highlighted in red.) There are no changes to file. External diff using WinDiff shows files are exactly the same.

I have tried deleting the repo from sourcetree, and local disk, followed by a re-fork on github, and re-download of the fork. Without touching any files, this file still shows changes.

Help?


Answers:
author: Sean Cox
body: So the end result: shenanigans with CR/LF Windows vs. Linux.

After toggling the core.autocrlf setting and committing to fix the line ending issue, this has ceased to be an issue.


author: Sean Cox
body: Screenshot:

Screen Shot 01-05-15 at 10.52 AM.PNG

Checked my WinMerge settings (misspoke earlier when I said WinDiff.) and the Whitespace is NOT being ignored. (setting is Compare whitespace, no ignores are checked.)

Also doublechecked using Notepad++, there are no non-printing characters present in the file other than the CR/LF and the end of each line (except the last line.)  
[](https://community.atlassian.com/t5/Sourcetree-questions/A-specific-file-in-a-project-shows-changes-when-there-are-none/qaq-p/42104?attachment-id=12633){#link_116ab6e70a9917}  
[](/tnckb94959/attachments/tnckb94959/sourcetree-questions/1228/1/Screen%20Shot%2001-05-15%20at%2010.52%20AM.PNG){#display_116ab6e70a9917_0}


author: Seth
body: This probably isn't the case, considering that you've re-cloned the repository, but whitespace changes and file permission changes can both appear like empty diffs (if you have WinDiff configured to ignore whitespace as well). Can you post a screenshot of the diff panel in SourceTree?

comments: author: Bal?zs Szakm?ry
body: Please see other possible causes here: <https://answers.atlassian.com/questions/11968620>
Identical Files marks as modified
Asked by Viktor Iwan:

Hello,

i update my script. And source tree detect the files as modified, even though the file is identical (i confirmed it by using win merge)

Any idea what might caused this ?


Answers:
author: Seth
body: Whitespace changes? Both SourceTree and WinMerge may be configured to ignore whitespace.

comments: author: Bal?zs Szakm?ry
body: It can also be line endings (win/unix) or some other non-printable characters.


author: Viktor Iwan
body: Any idea on how to detect this ?


author: Viktor Iwan
body: i looked on WinMerge's Options, Whitespace are not being ignored... probably the problem is on SourceTree


author: Viktor Iwan
body: It's "Show whitespace"


author: KieranA
body: Your git config's core.filemode may be set to true meaning that a change in the files' permissions would result in a modified file. Less plausible since it requires more explicit intervention, but still possible.


author: Seth
body: On the right side is a gear icon. If you click it, either "Ignore Whitespace" or "Show Whitespace" will be checked. Which is it?


author: Viktor Iwan
body: See the below image,

Files are on "Unstage files", no differences whatsoever. Winmerge confirms it as identical

identical.jpg  
[](https://community.atlassian.com/t5/Sourcetree-questions/Identical-Files-marks-as-modified/qaq-p/241023?attachment-id=2282){#link_116ab6f82bf5da}  
[](/tnckb94959/attachments/tnckb94959/sourcetree-questions/7038/1/identical.jpg){#display_116ab6f82bf5da_0}
What does "Initialising repository for git-flow" is SourceTree do?
Asked by Konstantin:

When I press "Git Flow" button for the first time SourceTree is asking me to initialise repository for git-flow.

I am trying to understand two things:

1. Why uncommited changes are preventing SourceTree from initialising repo for Git Flow?
2. Why other users have to initialise repository for Git Flow again when they clone it?

So what is exactly happening when I initialising repository for git-flow?


Answers:
author: Seth
body: Gitflow is a local utility that provides shortcuts for common operations associated with one common git workflow (named "git-flow").

Before you can use gitflow, you need to "initialize" it, which basically requires you to configure the plugin. As far as I remember, the only thing you need to specify is what you want to use as the prefix for each of the types of branches gitflow supports.

Many gitflow operations involve switching branches, and git won't typically let you switch branches if you have uncommitted changes (there are some exceptions), so that is probably why gitflow won't let you init while you have uncommitted changes.

comments: author: Konstantin
body: My point is if initialising SourceTree's GitFlow has nothing to do with repository it should not care about the state of my working copy.

I was wondering if it does something else other than setting up branch prefixes.


author: Seth
body: For that you'd have to ask the developer of gitflow, which isn't SourceTree/Atlassian.<http://nvie.com/posts/a-successful-git-branching-model/><https://github.com/nvie/gitflow>


Tags: git-flow
Delete a commit
Asked by Viktor Iwan:

Hello,

I'm fairly new to git, at the moment i'm working with sourcetree. i just do a commit and then i found out there are few mis-typo on several files. so i make another commit for 'super' minor adjustment. I would like to know if i can 'delete' my previous commit ? how to do that ?

Thanks


Answers:
author: Seth
body: Git is great for being able to rewrite the commit history. However, you should not modify commits that have been pushed to a remote unless you are an expert with git.

Assuming the commit in question has NOT been pushed, when you make the second commit (to fix the first), open the commit options and select "Amend latest commit".

If you need to make modifications to your history farther back then the latest commit, you can do a mixed reset (right click the commit you want to go back to), and then re-commit the files/chunks you need. There is also an interactive rebase feature that would be worth researching that might be safer, but I haven't used it.


Tags: bitbucket-server

github
I cant push my changes because of something I might have done
Asked by David Scott:

Hello, I'm trying to push some changes but I keep getting this message: 'Updates were rejected because the tip of your current branch is behind. hint: its remote counterpart. Integrate the remote changes (e.g.hint: 'git pull ...') before pushing again.'

The problem is that I don't want to pull any changes before pushing as that version contains a bug I'm trying to avoid.

This issue could be due to me doing something in Sourcetree when trying to go back to a previous commit that left me with this purple line/branch: <https://dl.dropboxusercontent.com/u/8176796/Screen%20Shot%202015-01-01%20at%2011.45.40.png>

Many thanks

David


Answers:
author: Seth
body: If you are ok with losing the buggy commit completely, you can "force" the push (<http://stackoverflow.com/questions/5509543/how-do-i-properly-force-a-git-push>).

If anyone else has also cloned the repo, their git client will git very confused the next time they fetch/pull. If that is your situation, you might consider doing the pull/merge, then "reversing" the buggy commit (basically creates a new commit that does the opposite of the changes in the commit that is being reversed).

comments: author: David Scott
body: Hello Seth, I work alone so I don't think those issues would be a problem but I couldn't seem to find any 'force' option after I clicked on Push?


author: Bal?zs Szakm?ry
body: There is no force push option in SourceTree. You have to do this from the command line or another Git client (e.g. Git Extensions).


author: Seth
body: Balazs is right, my bad. I updated my answer with a link on how to do this from the command line.


author: David Scott
body: Thanks guys, it took a while but it worked in the end :)


author: Josh Winkelstein
body: In 3.1.3, the SourceTree I am most familiar with, there is a "Force Push" checkbox available on the screen after you click "Push" on the tool bar. Before using it you do have to enable it by going Tools/Options/Git tab and check "Enable Force Push".


author: Manoj Baghel
body: Hi David,

If you are facing this issues and there are multiple files in your local branch which needs to be pulled first into your MASTER branch, then you must run '$ git pull --all' first.

Then, check the status by running "$ git status" on top of it, and if you see any modified files, then you need to 'add' and 'commit' those files first.

Once its done, you can then PUSH the changes to your MASTER branch and this will sync-up your MASTER branch with your local branch.

Hope this helps...!!


author: David Scott
body: Hi Sorry I missed this, yes please thats exactly what I'm looking for :)


author: Seth
body: Are you wanting to force the buggy commit in the remote to be lost?