youngmon/atlassian-qna huggingface dataset:
How to restore cloud repo before a "git push -f origin dev" ?
Asked by Priteesh Kissoondhery:

Our main development branch is called "dev" in this scenario.  
Accidentally did a "git push -f origin dev" which pushed my outdated local dev branch to shared repo.  

can't seem to find the hash for this change using git log to reflog.  

How can I restore the repo ?  

<br />


Answers:
author: Theodora Boudale
body: Hi [@Priteesh Kissoondhery](/t5/user/viewprofilepage/user-id/1453398),

I would suggest the following:

**1.** First, check the following documentation:

* <https://confluence.atlassian.com/bbkb/how-to-restore-a-deleted-branch-765757540.html>

Please check all the steps there, including the sections titled

* "If you don't know the 'sha' off the top of your head, you can:"
* "If your commits are not in your reflog:"

See if you can recover the branch with any of the methods described there.

**2.** If the above is not possible: are there any other users with access to this repository?

If so, I would suggest asking them if anyone has the previous version (the one before your force push) of the dev branch in their local clone. If so, they can force push it to the repo.

**3.** In case neither step 1 nor step 2 work for you, we may be able to recover a backup of the repo for you prior to the force push.

Please note that this is only possible if the force push was made during the last 7 days; we are not able to recover any content older than 7 days.

If neither step 1 nor step 2 work for you, ++and++ the force push was made during the last 7 days, then:

* You can create a ticket with the support team to ask for a backup of the repo prior to the force push (let them know when you made the force push, so they provide you with the most recent backup prior to the force push).  

  If the repo is owned by a workspace on a paid billing plan, you can create a support ticket via <https://support.atlassian.com/contact/>, in "What can we help you with?" select "Technical issues and bugs" and then Bitbucket Cloud as product. In the question "What is the impact to your business?" please make sure to select "Level 1".  

* If the repo is owned by a workspace on the free plan, you won't be able to create a support ticket yourself. Please feel free to let me know and I can create the support ticket for you.

Kind regards,  
Theodora


Tags: bitbucket-cloud

cloud
All files show as unstaged on a samba drive
Asked by Noam Shanny:

I've added a working copy of a repository cloned on a shared samba drive of a linux server. Most SourceTree functionality seems to work normally, except for that in the "File Status" tab I see all the project's files as "unstaged", although I haven't touched any of them.

Is there any way to fix / work around this?


Answers:
author: Noam Shanny
body: You mean re-clone the samba repository to a local clone and add that to SourceTree? It behaves the same.

But i found that if i do "git config core.filemode false" -- it solves the issue.


author: Seth
body: This has been [asked](https://answers.atlassian.com/questions/278907/error-code-128-shows-unknown-network-drive) [many](https://answers.atlassian.com/questions/266964/git-is-failing-to-stage-or-commit-with-sourcetree-in-a-windows-network-environment) [times](https://answers.atlassian.com/questions/314285/network-performance) [before](https://answers.atlassian.com/questions/275021/fatal-unable-to-write-new-index-file).

To summarize, you should use that server as a remote, not as network-mounted "local" drive.
what do the numbers represent under the repo in the Sourcetree working pane there is a "-" and "?" beside them??
Asked by darrell:

what do the numbers represent under the repo in the Sourcetree working pane there is a "-" and "?" beside them??

image2015-10-23 11:48:48.png  
[](https://community.atlassian.com/t5/Sourcetree-questions/what-do-the-numbers-represent-under-the-repo-in-the-Sourcetree/qaq-p/16004?attachment-id=3432){#link_1173a7fa17a298}  
[](/tnckb94959/attachments/tnckb94959/sourcetree-questions/445/1/image2015-10-23%2011%3A48%3A48.png){#display_1173a7fa17a298_0}


Answers:
author: sreekumar_menon
body: Blue question mark usually means untracked files and the minus icon means the file has been deleted.

Disclaimer -I have a mac version and never used the windows version of sourcetree.

comments: author: Seth
body: Yeah, that's accurate. To be slightly more descriptive, the "-" means you've deleted files, but have not committed the deletions.
OS X Wants to move SourceTree to Trash
Asked by SteffeyDev:

After downloading a fresh copy of SourceTree, and moving it to my applications folder, I get the error:

"SourceTree" will damage your computer. You should move it to the Trash.

Followed by the options to "Cancel" or "Move to Trash". This message has the gatekeeper logo next to it.

In the console, I get the error:

com.apple.xpc.launchd\[1\]: (com.apple.xpc.launchd.oneshot.0x10000073.SourceTree\[8402\]) Service exited due to signal: Killed: 9

Any idea what this is about? I am running El Capitan, though SourceTree works on another El Capitan system I have, so I don't think that is the problem. Gatekeeper is set to open apps from the Mac App Store and Identified Developers, though I already added the exception for SourceTree so I don't believe that would cause this either.

Thank you for your time


Answers:
author: sreekumar_menon
body: I think it is the gatekeeper .

<https://www.yourkit.com/download/mountain_lion.html>


Tags: install

mac
How do I pickaxe search?
Asked by Jan Hudecek:

Is it possible to search commit diffs (git log -S"\<regex\>") in SourceTree app on Windows?


Answers:
author: Seth
body: If you go to the Search tab at the bottom of the interface, and select "File Changes" from the dropdown to the right of the search box, you might get what you expect. I don't know if regular expressions are supported.
Sourcetree Clone creates read only directory
Asked by Luke H:

I am using source tree to connect to a gitlab server, and when the clone starts, it creates the .git folder, but that folder is read-only, so the clone / download gets stuck. If I right click on the folder and untick 'read only' it grabs around 200mb, before locking the folder again.


Answers:
author: Seth
body: Ok. Glad you got it working.


author: Luke H
body: On to a local drive. I moved over to smartgit now, as it was a bit easier getting it to work with gitlab.


author: Seth
body: Are you cloning onto a local drive, or some sort of network-attached storage?
Sourcetree terminal executable path
Asked by sergiu_pantiru:

Hello,

I've updated system git to 2.6.2 and I would like Sourcetree terminal to look exactly like the git-bash.exe window.

Is it possible to specify to Sourcetree which executable to run when the Terminal button is pressed?

Thank you,

Sergiu.


Answers:
author: Johannes Kilian
body: There is already a feature request asking for full support of git 2.x.x:

<https://jira.atlassian.com/browse/SRCTREEWIN-3646>

You might like to upvote this request

see also: <https://answers.atlassian.com/questions/31669331>


author: sergiu_pantiru
body: Thanks for the info, i up-voted the request and I hope it will be done soon :smile:

comments: author: Johannes Kilian
body: Me too ... ;-)
SourceTree on Windows is not prompting for password when connecting to git repository.
Asked by Andrew Fillebrown:

I have several private repositories on my own server that I connect to from Windows machines with password authentication. Today, I cannot connect to them because SourceTree is not showing the Username/Password dialog anymore. I can connect when using the system git from the command line and when using the git bash that pops up when pressing the "Terminal" button in SourceTree, so I know everything is fine on my git server. I can also connect from OSX machines using SourceTree, but they use SSH authentication instead of password authentication.  

I ran Askpass.exe separately and it shows the dialog correctly and returns the password, but it doesn't show when it should in SourceTree.

I downgraded SourceTree to 1.6.14 but it doesn't show the password dialog now, either.

I also tried setting up an SSH key with SourceTree's Putty, but that didn't work, either.

Any ideas?


Answers:
author: Libor Nenad?l
body: Have same issue on Win 7 \& SourceTree 1.8.3. It does not ask for password and fails immediately with "FATAL ERROR: Server unexpectedly closed network connection". Git from command line works and asks for password. Removal of credentials did not help.

comments: author: Akul Bhatnagar
body: The only thing that worked for me was navigating to C:\\Users\\%USERNAME%\\AppData\\Local\\Atlassian\\SourceTree and removing the passwd file.


author: tyrambo
body: Thanks! This is the only thing that worked for me....apparently this is a two-year old bug


author: emylee
body: Bug is still very much alive. You saved me after an hour of googling and reinstalling. Jeff Andrew, there was nothing in \`Tools \> Options \> Authentication\` except my Atlassian login, not my ssh login for my private server. This stinks!


author: olexandrbohuslavskyi
body: After almost 4 years [@Akul Bhatnagar](/t5/user/viewprofilepage/user-id/541253) 's solution still works


author: ddennis_dk
body: Tools \> Options \> Authentication

I had to delete the account and re-enter username password. Before it worked. Simply updating password did not work


author: Jeff Thomas
body: Hi Andrew,

You may want to try clearing the credentials out of SourceTree if they are cached there. This can be done under Tools > Options > Authentication
SourceTree: can't finish feature branches (win10)
Asked by Michael G?tze:

I'm trying to finish my feature branches (GoogleAccountAccess, EmergencyContact). I've already merged them but I can't finish them. If I select a feature branch and click on the GitFlow button, the dialog to create a new branch appears instead of the finish branch dialog.

Probably this is caused by a mistake of myself, naming the feature branch with an uppercase letter "Feature". I don't know how to fix this problem! Thanks in advance for your help!

Here my .git config:

```
[core]    repositoryformatversion = 0    filemode = false    bare = false    logallrefupdates = true    symlinks = false    ignorecase = true    hideDotFiles = dotGitOnly[remote "origin"]    url = git@bitbucket.org:johannesschobel/bloodsugar-app.git    fetch = +refs/heads/*:refs/remotes/origin/*[branch "master"]    remote = origin    merge = refs/heads/master[branch "develop"]    remote = origin    merge = refs/heads/develop[branch "Feature/GoogleAccountAcces"]    remote = origin    merge = refs/heads/Feature/GoogleAccountAcces[branch "Feature/EmergencyContact"]    remote = origin    merge = refs/heads/Feature/GoogleAccountAcces
```


Answers:
author: Seth
body: When you say "selected", do you mean you have the feature branch highlighted in the branch list or commit list, or do you have it checked out? I believe Git Flow bases its actions on which branch you have checked out.


author: Jake L
body: You can rename the branches to lowercase, or alternatively select "other action..." under GitFlow.

comments: author: Daniel Girard Bolduc
body: Thx a lot :) This was exactly my problem My branch name was containing "(" and ")"
When will SourceTree for Windows update the internal GIT version to 2.XX
Asked by Enrico Welder:

Stable GIT for Windows 2.XX is out for several months. But the SourceTree internal GIT version is still 1.95.

Will it be udpated soon? Is there a specific reason it is kept on 1.95?


Answers:
author: Jeff Thomas
body: We're looking to add support for Git 2.5 at the moment and the work is being tracked at <https://jira.atlassian.com/browse/SRCTREEWIN-3646>

Watch the issue to find out when the internal version of Git will be updated.
How do I undo a change that was committed locally and pushed to the server?
Asked by Richard Wooley:

I performed a manual merge recently. The merge was committed and pushed to the server, but now we've found a major problem with it. (The problem file is the storyboard and manually undo-ing the changes will not be trivial.)

Is there a simple way to undo the change on the server and then pull the clean code back to my machine?


Answers:
author: Seth
body: The safest way to do this is to right-click the bad commit, and choose "reverse commit". This will create a new commit that performs the opposite changes compared to the one you selected to reverse.

Commit the reversed changes (if SourceTree doesn't commit automatically), and push to the remote.

Git also allows you to re-write the history to remove that commit from the branch entirely, but this is generally considered bad practice because it can cause problems for the local repositories of other team members.
Fatal Error when cloning repo
Asked by Ralph Cossio:

When I am cloning a repo for the first time, I get 2 different fatal errors:

1. The remote end hung up unexpectedly
2. Warning: Templates not found in C:\\.........git-core\\templates
   1. The remote end hung up unexpectedly

Attached are some images demonstrating the error during the cloning repo process

thanks

Capture.jpgCapture2.PNG  
[](https://community.atlassian.com/t5/Sourcetree-questions/Fatal-Error-when-cloning-repo/qaq-p/412196?attachment-id=6071){#link_1169ecbdb775cc}  
[](/tnckb94959/attachments/tnckb94959/sourcetree-questions/12322/1/Capture.jpg){#display_1169ecbdb775cc_0}  
[](https://community.atlassian.com/t5/Sourcetree-questions/Fatal-Error-when-cloning-repo/qaq-p/412196?attachment-id=6072){#link_1169ecbdb775cc_0}  
[](/tnckb94959/attachments/tnckb94959/sourcetree-questions/12322/2/Capture2.PNG){#display_1169ecbdb775cc_2}


Answers:
author: Seth
body: If you or someone on your team has access to the git server you are cloning from, you should check it for errors. "The remote end hung up unexpectedly" typically means the server you are cloning from has an issue.
source tree delete branch graph
Asked by Per Eghall:

Hi folks,

I have an additional branch (new_branch) that has forked from master branch, that exists in both remote origin and in my local repository. The new_branch is deleted from origin and from my local repository, however, the branch is still displayed in SourceTree graph! Is there a way to remove it from the graph?

Best regards,

Per


Answers:
author: Johannes Kilian
body: Deleting a branch within git is simply removing the symbolic name of the branch. The commits on the branch still exists, even after deleting the branch. Therefore you can still see the branch within SourceTree (but the branch has no name anymore - since the symbolic name was deleted by you ...)

That's one of the main features of a VCS: preserving commits ....

If you want to remove the commits from your repository, you need other git methods (see: <http://stackoverflow.com/questions/1338728/delete-commits-from-a-branch-in-git>)

comments: author: Johannes Kilian
body: Be aware: Deleting commits (generally: modifiying commit history) on the remote repository is considered a bad practice (<https://developer.atlassian.com/blog/2015/04/force-with-lease/>) - nevertheless you still have to use it sometimes. You should be aware of the consequences - and ponder ...


author: Tim Crall
body: The commits should only continue to show up on the graph if the branch was merged into another branch before deletion. A screenshot might help illustrate exactly what's being asked about here.
Is it possible to default "include messages from commits..." to ticked?
Asked by David_Mills:

In the SourceTree "Merge" window there are several options at the bottom. The first of these is always ticked and the rest are not. Is it possible to set some of the others to be ticked by default?

Without this our production releases show no tickets.


Answers:
author: David_Mills
body: Anyone???


author: shulif
body: I have the same question!


author: David_Mills
body: Please?
Source Tree, revision mode
Asked by Jcamilorada:

Hi Guys

Maybe this is a silly request or question, but something that I usually do before commit and create a pr is review my own changes. The source three default changes view is to optimized to perform this task (no full screen, not side to side view with both files). Will be great a revision mode that enable to review local changes efficiently.


Answers:
author: windwagon
body: You might find an external diff viewer better suited to your needs. I use DiffMerge, but there are many others.


author: Seth
body: This is a Q\&A site for users. Feature requests are more appropriate at jira.atlassian.com.Please post a link to your feature request here as an answer so that other users looking for the same thing can find and vote up your feature request.
SourceTree License for Teaching
Asked by IT Procurement:

Hey

While SourceTree is free, we need a license for teaching installed in a lab within our university.

We need to use it for less than a month.

Would anyone know if it's still free and also how to download and install on multiple computers???

Thanks in advance


Answers:
author: Seth
body: SourceTree is free for all use cases. There are resources available about how to distribute a single license. More information in a previous question:

<https://answers.atlassian.com/questions/13411258>


author: minnsey
body: Hi,

Yes, we are open to arrangements like yours. Please raise a support ticket here <https://support.atlassian.com/projects/STSP> and we can discuss it directly.

Please post a link to the ticket back here to make it easier for me to find :smile:

Regards
SourceTree Terminal does not recognise git after git upgrade
Asked by James Clancy:

After upgrading git from version 1.9 which worked fine with SourceTree, to the current version of git 2.6.1, and opening the Git Bash Terminal from the link in the SourceTree toolbar, the terminal does not recognise any git commands. Typining "git status" gives the response...

sh: git: command not found.

I have tried uninstalling SourceTree, uninstalling git, re-installing git and then re-installing SourceTree to no avail. Same behaviour. Git Flow has also stopped working.

I opted for gitbash to be the main terminal editor which apparently does not need to change the PATH environment variable - but even so it still cannot see git as if git is not on its path. Also SourceTree Options for git are set to use System Git. The UI displays my branches OK and UI actions seem to work. It's just that the Terminal is broken.

Any help appreciated.


Answers:
author: Todd Aspeotis
body: When installing Git for Windows, [opt to allow it to modify your `PATH`](https://jira.atlassian.com/browse/SRCTREEWIN-3646?focusedCommentId=801995&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-801995). (The second of three options, *not* the one to add Git and \*nix tools.)


author: Seth
body: "I opted for gitbash to be the main terminal editor" - How were you given this option? Are you confident that the Terminal button is actually launching gitbash?
How to open/view file from previous commit.
Asked by banjobum:

I know this is simple for anyone who's been using ST for a while. And I know the answer must be very simple. But I've just spent an hour clicking around and not getting anywhere. An earlier answer to a similar question says to hit \<space\> or right click then hit \<Quick-Look\>. Yet it doesn't even tell you what page to be on and what state that page must be in to do these steps. Besides, I'm a top down kind of person. I don't just want instructions for which buttons to push. I want to understand what I'm doing and why.

I greatly appreciate the thousands of hours of effort that has certainly gone into Source Tree and Bitbucket. The few commands that I can confidently use are very helpful. But it is frustrating not really understanding the overall nature of the software, the elements that make it up and how to relate to those elements as a user - nor can a find any resources here that explain this in a straightforward way. Most help seems to be aimed at those who thoroughly understand Source-Tree and Bitbucket and who want to do more advanced things with it.

BTW, I'd gladly volunteer some time to produce help docs for rank beginners like me once I can get past this level myself.


Answers:
author: Tim Crall
body: To open/view a file from a previous commit, you first have to "check out" that commit.

There are multiple ways to do this in SourceTree, but the easiest is to double click on the commit in the graph (in the Log View).

If you are checking out a past commit, you should see a warning message telling you that you have a detached HEAD. This just means that your HEAD pointer is not pointing at the tip of a branch, so you won't be able to commit any changes you make unless you create a new branch. If you're just wanting to review the old code, this is fine.

Once you've checked out the previous commit, you should see that commit is now bold and has the HEAD tag pointing at it. Your working directory has now been changed to reflect that version of the code. You can now browse the contents of your files either through SourceTree (click View-\>File Status View and then select 'All files') or externally using any utility of your choices (because the actual files in the working directory have been set to the historical version).
Repositories keep flagging as "moved or deleted"
Asked by Owen Melbourne:

We've recently imaged 5 identical OSX Yasomite macbooks with sourcetree on them.

They're all showing identical symptoms that it seems randomly after a period of time or restarting, the bookmark manager displays every repo as missing and you need to relink it.

The folders are not moving and nothings changing, and once you relink it, it works again for a period of time.

Might be worth noting that the users are not admins or in the sudoers file.

Any thoughts?


Answers:
author: Seth
body: Well, that sounds like a good place for them to be.Are these macbooks each being used by multiple users? If so, maybe SourceTree isn't storing bookmarks in a user-specific way (and has problems when trying to load repos from another user's Sites/ directory).If these are single user machines, you may need to submit a bug report to jira.atlassian.com, because that doesn't sound like any sort of user or configuration error.


author: Owen Melbourne
body: They're just located within /Users/\<username\>/Sites on the main OS hdd


author: Seth
body: Are the folders on a local hard drive, or some sort of network storage?
windows 7 64bits ,Sourcetree openssh putty GIT PULL not working?
Asked by XiaoPeng Li:

git -c diff.mnemonicprefix=false -c core.quotepath=false fetch origin  
The server's host key is not cached in the registry. You  
have no guarantee that the server is the computer you

think it is.  
The server's rsa2 key fingerprint is:  
ssh-rsa 2048 xxxxxxxxxxxxxxxxxxxxxxxxxx  
If you trust this host, enter "y" to add the key to  
PuTTY's cache and carry on connecting.  
If you want to carry on connecting just once, without  
adding the key to the cache, enter "n".  
If you do not trust this host, press Return to abandon the  
connection.


Answers:
author: Seth
body: If you are confident you are connecting to the correct host, you need to intiate an SSH connection to that server from PuTTY directly, and PuTTY will give you the option to trust the fingerprint.

comments: author: Farzad Jalali
body: any chance you can provide a step by step guide please.


author: finenad
body:     "C:\Program Files (x86)\Atlassian\SourceTree\tools\putty\plink.exe" -ssh user@github.com


author: Rob Pawlikowski
body: Tried. Failed. How do you indicate the host?


author: Seth
body: In Henrik's comment, the host is github.com. If you are connecting to a different host, that is where it goes.