Source tree is not launching External merge tool when I choose to resolve conflict using external merge tool - atlassian-sourcetree

Source tree is not launching external merge tool for few files with extension .java . Source tree is showing conflicts in few files. When I select resolve conflict -> Launch external merge tool, it just shows a popup for less then one second and dismiss. Instead of opening the tool it generates and shows 4 backup files below conflicted file in source tree. I have checked .gitconfig too and it shows correct path there mapped to opendiff which opens FileMerge by default in Mac.

This may happen due to Sourcetree couldn't fine '.gitconfig' file location. Even if you keep 'Allow Sourcetree to modify your global Git config files' check box ticked. it may not be updated.
Try adding, HOME in your system environment variables to the path of your '.gitconfig' file location. For e.g. HOME C:\Users\XXX

I figured it out. I am trying this on mac and having Xcode. It was not showing anything under command line tools. I installed command line tools and mapped under Xcode. Also changed the diff to FileMerge in Sourcetree preferences. And now i am getting my External merge tool launched.

In Xcode go to preferences >> locations >> Command line tools >> choose one xcode

Related

Recover lost settings + extensions and more?

I was playing around with my VSCode Settings Sync, and accidentally replaced my settings.json file with another one from a fresh install, as a consequence, I lost my entire settings.json configuration.
Is there a way to recover the lost settings.json file?
I checked my backups, however, it seems that I one cannot go back into the /Users/mf/Library/Application Support/Code/User/Sync folder.
Yes you can get them back.
They are saved on the hard-drive if your settings are set to their default values.
The universal method (works the same for all systems) is to hit the [F1] key, then type the command below into the input, until you see the option. When you do see the option click on it to open the directory.
Settings Sync: Open Backups Folder
The other option you have is to view the data in VSCode using the following VSCode command from your quick input using the [F1] key followed by the same instructions for the command above.
Settings Sync: Show Synced Data
There should be several saved versions of your settings, unless you have changed your configuration for settings sync in the settings menu, or in your user/workspace settings.json file.
Personally I like to just open backup folders and pullout what I need. If you are like me, and you use Ubuntu then the path below is the path used by VSCode to store backed-up keybindings & Settings.json instances. You can pullout what ever you need from that directory.
~/.config/Code/User/settings.json
If you need to restore the backed up files, you can visit this link, it demonstrates how to return to a previous editor configuration:
RESTORE PREVIOUS VS CODE CONFIGURATION:
https://code.visualstudio.com/docs/editor/settings-sync#_restoring-data

How to change folder that opened by default in VSCode?

I have small problem with VSCode folder, that opened by default.
Problem description: I start new instance of VSCode (trough File->New Window), and then if I choose File->Open Folder it opens dialog with my Windows user folder as starting point (C:\Users\MyUser)
Question: How can I change that folder in settings (if it possible)? So by default it will show as start point for example D:\development\ ?
At the time I write this answer, this is not possible. There are two problems on Windows, and one problem on Mac and Linux:
VS Code does not provide a default path to the file dialog 1. It does remember the last folder that you opened a file in, but that path cannot be used as a default because it is overwritten constantly.
On Windows only, Electron ignores the default path when creating a file dialog if the default path is a directory 2.
An extension also cannot solve this, because extensions are not allowed to modify the File menu 3.
I think the best option at this point is to pin a folder to the Quick Access area in Windows Explorer, as suggested in a comment, or to put an actual shortcut in the user profile folder.
Workspaces and File > Open Recent may also be helpful if you often open the same folders.
Your main problem is that you are unable to open your specific folder in VScode.
To solve that you can simply open the terminal/cmd in that specific window by just typing cmd in your search bar or just by pressing shift+right-click in that folder.
Now your cmd is open and you just have to type "code ." in the cmd and press enter to open the current folder in your VSCode.
In case that code . doesn't work for you then you have to add the Vscode in the environment variables of your windows.
Visual Studio doesn't provide a specific feature to open a specific path. But there is a solution to your problem. You are saying that you want D:\develpment as a default when you open VS Code. You can go to that specific directory or create shortcut to desktop then click right click on that folder and then click on open with code. If you didnot see open with code then reinstall your VS code and check on open with code when you are reinstalling VS Code.
make a shortcut on the desktop for vscode and then modify it and add the folder after the .exe command. This will default open that folder when you double click on it.
Visual Studio Code can be installed in two ways - User setup and System setup. I strongly believe you have User setup installed in your PC. Try re-installing it System-wide. That should probably fix your problem.
For more information: https://code.visualstudio.com/docs/setup/windows#_user-setup-versus-system-setup
PS: A lot more information is needed, you can share a screenshot of the window and elaborate more on it.

Visual Studio Code source control not showing changes

Visual Studio Code source control panel is empty when I click on it. Nothing to expand and nothing to click on.
Things I've tried:
Uninstalled/Reinstalled Git
Uninstall/Reinstalled VS Code
Removed extensions folder
Open your project with cmd.
> cd your-folder-location
> code . -n
It worked for me
Dude, just lost an hour because my SCM in VSCode randomly stopped showing anything today. I restarted everything, tried git init, everything on the forums. Made sure Git built in extension is enabled, mine was already enabled so I was totally lost.
All I had to do was disable and then reenable the built in Git extension. and it fixed it.
Go to Extensions.
Filter by "built in".
Click the gear icon by Git, and click disable.
Then click it again, and click enable.
Here is a screenshot reference
In my case, somehow, the Source Control Repositories option, available under the 3 dots ... on the SOURCE CONTROL tab, was no longer selected.
All I had to do was press the ... and select Source Control Repositories, then select the correct repo, and all the changes were again listed.
I had a similar issue. It seems vs code has two source control extensions. When I clicked View -> SCM it opened an extension with changes displaying.
source control extension 1
source control extension 2
I had this problem 2-3 times for the last 2 years (OS -> Linux Mint). The changes on any file didn't appear to the source control nor have they been marked on the line I've edited. When manually go to "Source control" and click on the refresh button they appear but the lines that I had change didn't light up (there were no visual marking on the files after editing them). This happened when I switched to a different branch while the workspace was open to the 2 monitors at the same time. Or when working on several projects (opened 2-3 or more VS Code instances). The scariest thing was that it didn't work not only for one repository(project) but for all of them. I've read alot on the subject and tried everything that I found and think of. There is some issue with git path mapping or something.
The thing that I tried:
reload VS Code
restarting VS Code
disable all extensions
enable/disable all git related options in (file -> preferences -> settings)
deleting (folders and files) and cloning the repository
updating git
removing and installing git
restarting PC (don't judge me I was desperate)
But the only solution that worked for me was:
open VS Code (if open, don't close it)
go to the directory where you keep your repositories (not from VS Code but from you file explorer).
go one folder above it (if you are in .../{{some folder}}/{{you repos}}, go to ../{{some folder}})
then open you repositories containing folder (/{{you repos}}) by right click -> open with VS Code
wait until everything loads. The Source Control will mark alot of changes, don't worry about it.
then close VS Code (all windows (instances), because it will open a new instance)
after that go to the directory where you keep your repositories again and right click and open with VS code the repository of you choice. Now at this point the Source control will start working properly.
What worked for me was going to my "code" folder where I keep all my repos, right-clicking on the folder containing the repo I want and opening that folder with VS Code.
The VS Code window for this specific repo was closed. I did have another window for a different repo open. As soon as the window opened, the changes showed up in source control and I was able to commit, push and everything else like normal.
I faced this problem when I opened a repo in a directory inside symlink.
My solution: just open this directory in original destination without any symlinks
I had this problem in a repository not as a problem from config but because I had a coverage folder with thousands of files not tracked and it seemed to slow the process of checking that out too much.
So I added that folder to .gitignore and it started working again.
Restating my Vscode And Giving time to load properly Solved my Problem
I had the same problem. What I did was:
Open another folder with File -> Open Folder...
Close the VSC
Open VSC
Open the original folder with File -> Open Folder...
After this I saw that the source control started loading and my changes came back.
Hope this works for you.
I couldn't see any changes in while trying git status. I opened changed files in text editor and they were not changed either. That lead me to conclusion that changes can't be seen by the system (and therefore by git).
The Autosave option was disabled, simply saving the changes helped.
That was my beginning with VSC, in Pycharm never had such problem.
I had this problem, because I was changing files one folder down from where I opened Visual Studio Code.
Solution- open Visual Studio Code without a location, File/Open Folder - open the folder I am directly working out of.
Unstaged changes now show in the direct folder I'm working in. Unstage changes previously auto-staged by Visual Studio Code when working on a nested project directory to see them (open a Terminal and run git reset).
I encountered the same issue, and I fixed that by removing the files.watcherExclude property in settings.json file.
Because the value of files.watcherExclude became { "**/**/*": true } somehow.
// settings.json
// remove or comment next line
// files.watcherExclude: { "**/**/*": true }
For me, the files were in WSL (Windows subsystem for linux) but I was not opening the folder as such.
in the bottom left, click the green >< symbol, then click "reopen folder in WSL"
VSC remote mode image
presto.
Go to View -> Terminal
cd to root folder, and run git status and see if you have any errors
I had a unsafe repository fatat error, as my repo was on a network drive. Did as suggested by git to add an exception and it fixed the issue.
close vscode
moved local Code config folder as backup (~/.config/Code/)
reopen vscode (this will still show problem)
close and reopen vscode (this will show db re-write issue but it will re-create config folder.)
this solved my problem. this reset many of my settings but It can be checked from config backup.
In setting check Git: Autorefresh
I experience this problem when I right click a folder and open it up with VS code. Instead now I start VS code from the start menu and after that I use File -> Open Folder option.
I experienced this issue with VSCode V1.70.1, all I did is just closing VSCode completely and open a new instance and I could find git changes appears simultaneously as expected.
If running into this issue on a Mac, make sure you are running your instance of Visual Studio Code from your Applications folder and not your Downloads folder. I managed to fire up an instance from the wrong folder and this prevented my Source Control from being able to properly load git info and also caused Visual Studio updates to fail. More on the issue can be found here.
Here is another possible solution for Linux users:
In my case, it was only not showing lines changed with the file open. Source control tab was showing fine.
I have a symlink from /var/www to /mnt/{hdd-uuid}/www. When I created my workspace, it was using the path /var/www/project-folder, instead of the full path, and this was giving me the error.
I opened my .code-workpsace file in another text editor and changed the references in the JSON from ../../../../var/www/project-folder to /mnt/{hdd-uuid}/www/project-folder, then reopen VS Code. Close all file tabs open and, when you open again a modified file it will show the lines changed.
It is possible that you need to trust the repo again.
Try opening project or folder which contains git files. Later try opening your wanted folder. This sorted the issue for me.
Double-check git is actually installed on your system. I just did a fresh install of Windows 11 the other day, and although one of the development tools I installed thereafter downloaded and supposedly installed git in Windows, actually, it never installed it. Fail!
I fixed this issue by toggled-on the AutoSave feature in VSCode via File > AutoSave. I noticed that the badge on the github does not show up until the file is actually saved first.
What worked for me was that I was forgetting to save, so just enabled autosave option.
File > Auto Save (check)
Open Visual Studio code -> View -> Appearance -> Show activity bar

Open the same directory twice

On command line, I could open a directory like:
code .
Now, I want two of the identical diretory opened and displayed in another window.
(It's not spliting the editor)
Then, I tried again.
code .
Nothing happened.
There's still one directory opened.
How to achieve such a task?
You can do this with the following ways:
1- Manually open a new window (ctrlshiftn) and go to:
File > Add folder to Workspace. Then just select the folder.
2- Open the command panel (ctrlshiftp) enter dupl and hit enter that will duplicate the current workspace in a new window
*dupl is just a filter for the complete command that is: Workspaces: Duplicate Workspace in New Window thanks to dipnlink comment
Source: https://code.visualstudio.com/docs/editor/multi-root-workspaces
*Done in windows (10), vscode (1.35.1)
In the latest version, it is actually much simpler.
In a window of the project you want to duplicate, open the command panel (Command + Shift + P in Mac or Ctrl + Shift + P in Ubuntu), then type dupl (and select Workspaces: Duplicate As Workspace in New Window), this will duplicate your workspace in a new window. Now you can have 2 windows of the same project at the same time.
click
file > duplicate workspace
Click Add workspace folder... and open the same folder. Works for me, other solution doesn't work, just jump focus to another window.
As far as I know, the accepted answer is not correct as C14L indicates.
It can be done by opening a different folder that includes the folder you're working in. So say we have /project and /project/src and /project/build, you're probably interested in having src open in two instances of VSCode, which you can achieve by opening /project and /project/src.
In addition to accepted answer, here's the trick if you want to open same project in two different windows but showing two different git branches:
Copy the project folder and open that folder!
If you want two windows in two different git branches then this simple trick works. I don't know of any other solutions.
The accepted answer works, but I don't really like the fact that the folder is opened into an unnamed workspace, and upon closing window, we will be prompted to save that workspace. I am expecting more like Sublime Text like behavior.
Luckily there is VSCodium, VSCode's twin/clone without telemetry to Microsoft. So I ended up opening the folder once in either VSCode or VSCodium, then a second time in the other. This so far worked quite well for me.
I wanted to do this for working in two branches side by side and then I realized it was not possible because you cannot have two active branches in exact same git repo folder.
So, if you are looking to do the same, you should instead just make a copy of a folder and switch to another branch there. Options described in other answers will not work for this scenario due to fundamental way git works.

Open multiple Eclipse workspaces on the Mac

How can I open multiple Eclipse workspaces at the same time on the Mac?
On other platforms, I can just launch extra Eclipse instances, but the Mac will not let me open the same application twice. Is there a better way than keeping two copies of Eclipse?
This seems to be the supported native method in OS X:
cd /Applications/eclipse/
open -n Eclipse.app
Be sure to specify the ".app" version (directory); in OS X Mountain Lion erroneously using the symbolic link such as open -n eclipse, might get one GateKeeper stopping access:
"eclipse" can't be opened because it is from an unidentified developer.
Your security preferences allow installation of only apps from the Mac App Store and identified developers.
Even removing the extended attribute com.apple.quarantine does not fix that. Instead, simply using the ".app" version will rely on your previous consent, or prompt you once:
"Eclipse" is an application downloaded from the Internet. Are you sure you want to open it?
By far the best solution is the OSX Eclipse Launcher presented in http://torkild.resheim.no/2012/08/opening-multiple-eclipse-instances-on.html It can be downloaded in the Marketplace http://marketplace.eclipse.org/content/osx-eclipse-launcher#.UGWfRRjCaHk
I use it everyday and like it very much! To demonstrate the simplicity of usage just take a look at the following image:
EDIT: Milhous's answer seems to be the officially supported way to do this as of 10.5. Earlier version of OS X and even 10.5 and up should still work using the following instructions though.
Open the command line (Terminal)
Navigate to your Eclipse installation folder, for instance:
cd /Applications/eclipse/
cd /Developer/Eclipse/Eclipse.app/Contents/MacOS/eclipse
cd /Applications/eclipse/Eclipse.app/Contents/MacOS/eclipse
cd /Users/<usernamehere>/eclipse/jee-neon/Eclipse.app/Contents/MacOS
Launch Eclipse: ./eclipse &
This last command will launch eclipse and immediately background the process.
Rinse and repeat to open as many unique instances of Eclipse as you want.
Warning
You might have to change the Tomcat server ports in order to run your project in different/multiple Tomcat instances, see Tomcat Server Error - Port 8080 already in use
To make this you need to navigate to the Eclipse.app directory and use the following command:
open -n Eclipse.app
Actually a much better (GUI) solution is to copy the Eclipse.app to e.g. Eclipse2.app and you'll have two Eclipse icons in Dock as well as Eclipse2 in Spotlight. Repeat as necessary.
If the question is how to easily use Eclipse with multiple different workspaces, then you have to use a kludge because shortcuts in OS X do not provide a mechanism for passing command line arguments, for example the "--data" argument that Eclipse takes to specify the workspace. While there may be different reasons to create a duplicate copy of your Eclipse install, doing it for this purpose is, IMNSHO, lame (now you have to maintain multiple eclipse configurations, plugins, etc?).
In any case, here is a workaround. Create the following script in the (single) Eclipse directory (the directory that contains Eclipse.app), and give it a ".command" suffix (e.g. eclipse-workspace2.command) so that you can create an alias from it:
#!/bin/sh
# open, as suggested by Milhous
open -n $(dirname $0)/Eclipse.app --args -data /path/to/your/other/workspace
Now create an alias to that file on your desktop or wherever you want it.
You will probably have to repeat this process for each different workspace, but at least it will use the same Eclipse installation.
2018 Update since many answers are no longer valid
OS X Heigh Sierra (10.13) with Eclipse Oxygen
Go to wherever your Eclipse is installed. Right-click -> Show Package Contents -> Contents -> MacOS -> Double-click the executable called eclipse
A terminal window will open and a new instance of eclipse will start.
Note that if you close the terminal window, the new Eclipse instance will be closed also.
To make your life easier, you can drag the executable to your dock for easy access
Instead of copying Eclipse.app around, create an automator that runs the shell script above.
Run automator, create Application.
choose Utilities->Run shell script, and add in the above script (need full path to eclipse)
Then you can drag this to your Dock as a normal app.
Repeat for other workspaces.
You can even simply change the icon - https://discussions.apple.com/message/699288?messageID=699288&#699288
One another way is just to duplicate only the "Eclipse.app" file instead of making multiple copies of entire eclipse directory. Right-Click on the "Eclipse.app" file and click the duplicate option to create a duplicate.
If you're like me, you probably have terminal running most of the time as well.
You could just create an alias in /Users//.bash_profile like this
alias eclipse='open -n path_to_eclipse.app'
then all you have to do is just open the terminal and type eclipse.
Based on a previous answer that helped me, but different directory:
cd /Applications/Eclipse.app/Contents/MacOS
./eclipse &
Thanks
You can create an AppleScript file to open Eclipse with a given workspace. You can even save the AppleScript file as an Application, which is equivalent to creating an alias with arguments in Windows OS.
Open Script Editor and type the following:
do shell script "open '/path/to/your/Eclipse/installation' -n --args -data /path/to/your/workspace"
For instance:
do shell script "open '/Applications/Eclipse.app' -n --args -data /MyWorkspaces/Personal"
Press the Run button to check it's working.
This script can be saved as such, but I prefer to save it as an Application. That way I can customize the icon by copying the *.icns icon from the original Eclipse.app bundle to the script application bundle.
To open an App folder, use the "see contents" contextual menu option. It should look like this:
Where "main.scpt" is the AppleScript file and "applet.icns" is the icon from the original Eclipse bundle.
Launch terminal and run open -n /Applications/Eclipse.app for a new instance.
I found this solution a while back, can't remember where but it still seems to work well for me.
Create a copy of Eclipse.app for each workspace you want to work in (for this example ProjectB.app), then open ProjectB.app/Contents/MacOS/eclipse.ini and add these two lines at the beginning of the file:
-data
/Users/eric/Workspaces/projectb
... substituting where your workspace is located. When you launch ProjectB.app it will automatically start with that workspace instead of prompting for a location, and you should be able to run it at the same time as other Eclipse instances with no problem.
In Terminal simply paste below line and hit enter ..
/Applications/Eclipse.app/Contents/MacOS/eclipse ; exit;
If you want to open multiple workspaces and you are not a terminal guy, just locate the Unix executable file in your eclipse folder and click it.
The path to the said file is
Eclipse(folder) -> eclipse(right click) -> Show package
Contents -> Contents -> MacOs -> eclipse(unix executable file)
Clicking on this executable will open a separate instance of eclipse.
A more convenient way:
Create an executable script as mentioned above:
#!/bin/sh
cd /Applications/Adobe\ Flash\ Builder\ 4.6
open -n Adobe\ Flash\ Builder\ 4.6.app
In you current instance of Flashbuilder or Eclipse, add a new external tool configuration. This is the button next to the debug/run/profile buttons on your toolbar. In that dialog, click on "Program" and add a new one. Give it the name you want and in the "Location" field, put the path to the script from step 1:
/Users/username/bin/flashbuilder
You can stop at step 2, but I prefer adding a custom icon to the toolbar. I use a the Quick Launch plugin to do that:
http://sourceforge.net/projects/quicklaunch/files/
After adding the plugin, go to "Run"->"Organize Quick Lauches" and add the external tool config from step 2. Then you can configure the icon for it.
After you save that, you'll see the icon in your toolbar. Now you can just click it every time you want a new Flashbuilder/Eclipse instance.
You can run multiple instances of Eclipse by creating a pseudonym for Eclipse application in it's folder and using it for running new Eclipse instance
Lets try downloading this in your eclipse on Mac you will be able to open multiple eclipse at a time Link
Name : macOS Eclipse Launcher
Steps :
Go to eclipse Market place.
Search for "macOS Eclipse Launcher" and install.
It will restart .
Now under file menu check for open option > there you will find other projects to open also at same time .
Window -> New Window
This opens a new window and you can then open another project in it. You can use this as a workaround hopefully.
It actually allows you to work in same workspace.