Using and running Tortoise svnsync in Windows via command line - windows

I have a local repository and I have just signed up to unfuddle and want to sync my local repository to the new one I have created on there.
I was told to run the following command:
svnsync init --username USERNAME http://username.unfuddle.com/svn/username-rep http://SOURCE_REPO_URL
Firstly, I assume I can remove the username stuff if the source repository doesn't require authentication?
Secondly, when I run that command my system doesn't recognize it. I assumed svnsync needed to be added somewhere in Windows so that it could be run via it's name only (think the correct term is an environment variable)?, but not only do I not know how to do that I don't know what program to add...... I cannot find any svnsync.exe or anything locate din my TortoiseSVN folder.
What do I need to do here?

When you install TortoiseSVN you are given the option to install the Subversion binaries as well:
Once you do that, you will see svnsync.exe in the installation folder:
As long as you have C:\Program Files\TortoiseSVN\bin in your PATH variable, you will be able to call svnsync.exe from the command-line:
(You can view your PATH variable thus (on Windows 7): Start -> right-click Computer -> Properties -> Advanced system settings -> Environment variables.... DO NOT overwrite whatever is there - simply append the path to TortoiseSVN if it isn't already there. More info here.)
Hope this helps.

Related

Cant clone git repository

first-time asker here. I have an issue with git, cant clone anything. If I don't specify where to clone, this will appear.
> git clone https://gitlab.corp.cz/username/project_name.git project_name
fatal: could not create work tree dir 'project_name': No such file or directory
If I first create a folder via explorer, then the error message is different.
> git clone https://gitlab.corp.cz/username/project_name.git project_name
Cloning into 'project_name'...
C:/Users/username/Documents/project/path/.git: No such file or directory
Mkdir say the same, though not sure if windows even have a mkdir. At least a month ago, it worked. Please help, even reinstalled windows, didn't help.
EDIT: It looks like it is not a git problem. I cannot create any file using nothing other than windows explorer. Checked and I have write permissions for this folder, so most likely a windows problem.
a) You must run the command in a directory where you have write permission;
b) Add git to the list of allowed applications:
1 - Select Start > Settings > Update & Security > Windows Security > Virus & threat protection.
2 - Under Virus & threat protection settings, select Manage settings.
3 - Under Controlled folder access, select Manage Controlled folder access.
4 - Switch the Controlled folder access setting to On or Off.
c) If that doesn't work, try running the terminal with the administrator.
If you are using WSL (Windows Subsystem for Linux) to execute this command in the terminal check if the linux user has permissions to create a new folder there or try doing it as root.
If you are using Powershell or the Command Prompt try running it as Administrator and check if cloning a repo will work.. if this works there is a problem with your permissions. In this case try to change your working path so if the folder you are trying to clone a repo is in "C:\Program Files" or "C:\Program Files (x86)" try cloning to another place as these paths cause problems.

how to configure cygwin Local Package Directory

I have to change my cygwin Local Package Directory, which happen to be earlier as C:\Users\username\Downloads.
Folders like http%3a%2f%2fcygwin.mirror.constant.com%2f are all in place in my new directory for Local Package Directory.
How to do that? (I cannot find, where cygwin stores the config.)
Running setup from new location tries to install all over again instead from continue using earlier packages from the internet.
The information is on /etc/setup/setup.rc
$ head setup.rc
last-cache
e:\downloads\cygwin_cache
last-mirror
http://mirrors.kernel.org/sourceware/cygwin/
net-method
Direct
last-action
Download,Install
mirrors-lst
....
Please note that setup just propose the settings based on last run but you can always change typing new values.

Postgres "psql not recognized as an internal or external command"

For Postgres, I keep getting this error multiple times even though I have already set the location of the bin folder to the path variable in Windows 8. Is there something else I'm missing?
(I can't post pictures since I don't have enough reputation)
Just an update because I was trying it on Windows 10 you do need to set the path to the following:
;C:\Program Files\PostgreSQL\14\bin ;C:\Program Files\PostgreSQL\9.5\lib
PS : 14 is the current version, check whatever version you are on.
You can do that either through the CMD by using set PATH [the path]
or from my
computer => properties => advanced system settings=> Environment
Variables => System Variables
Then search for path.
Important: don't replace the PATHs that are already there just add one beside them as follows ;C:\Program Files\PostgreSQL\9.5\bin ;C:\Program Files\PostgreSQL\9.5\lib
Please note: On windows 10, if you follow this: computer => properties => advanced system settings=> Environment Variables => System Variables> select PATH, you actually get the option to add new row. Click Edit, add the /bin and /lib folder locations and save changes.
Then close your command prompt if it's open and then start it again
try psql --version
If it gives you an answer then you are good to go if not try echo %PATH% and see if the path you set was added or not and if it's added is it added correctly or not.
Important note:
Replace 9.5 with your current version number. As of 2021, that is 13.
For 2022 is 14.
Windows 10
It could be that your server doesn't start automatically on windows 10 and you need to start it yourself after setting your Postgresql path using the following command in cmd:
pg_ctl -D "C:\Program Files\PostgreSQL\11.4\data" start
You need to be inside "C:\Program Files\PostgreSQL\11.4\bin" directory to execute the above command.
EX:
You still need to be inside the bin directory to work with psql
Enter this path in your System environment variable.
C:\Program Files\PostgreSQL\[YOUR PG VERSION]\bin
In this case i'm using version 10. If you check the postgres folder you are going to see your current versions.
In my own case i used the following on separate lines:
C:\Program Files\PostgreSQL\10\bin
C:\Program Files\PostgreSQL\10\lib
You can follow the following steps below.
C:\Program Files\PostgreSQL\yourversion
I had your issue and got it working again (on windows 7).
My setup had actually worked at first. I installed postgres and then set up the system PATH variables with C:\Program Files\PostgreSQL\9.6\bin; C:\Program Files\PostgreSQL\9.6\lib. The psql keyword in the command line gave no errors.
I deleted the PATH variables above one at a time to test if they were both really needed. Psql continued to work after I deleted the lib path, but stopped working after I deleted the bin path. When I returned bin, it still didn't work, and the same with lib. I closed and reopened the command line between tries, and checked the path. The problem lingered even though the path was identical to how it had been when working. I re-pasted it.
I uninstalled and reinstalled postgres. The problem lingered. It finally worked after I deleted the spaces between the "; C:..." in the paths and re-saved.
Not sure if it was really the spaces that were the culprit. Maybe the environment variables just needed to be altered and refreshed after the install.
I'm also still not sure if both lib and bin paths are needed since there seems to be some kind of lingering memory for old path configurations. I don't want to test it again though.
If you tried all the answers and still spinning your heads, don't forget to change the version with your one which you downloaded.
For example, don't simply copy paste
;C:\Program Files\PostgreSQL\9.5\bin ;C:\Program Files\PostgreSQL\9.5\lib
More clearly,
;C:\Program Files\PostgreSQL\[Your Version]\bin ;C:\Program Files\PostgreSQL\[Your Version]\lib
I was spinning my heads. Hope this helps.
Make sure that the path actually leads to the executables. I'm using version 11 and it did not work until this was set as the path:
C:\Program Files\PostgreSQL\11\bin\bin
Maybe this is how version 11 is structured or I somehow botched the installation but I haven't had a problem since.
Even if it is a little bit late, i solved the PATH problem by removing every space.
;C:\Program Files\PostgreSQL\<installed version>\bin;C:\Program Files\PostgreSQL\<installed version>\lib
works for me now.
Simple solution that hasn't been mentioned on this question: restart your computer after you declare the path variable.
I always have to restart - the path never updates until I do. And when I do restart, the path always is updated.
Find your binaries file where it is saved. get the path in terminal mine is
C:\Users\LENOVO\Documents\postgresql-9.5.21-1-windows-x64-binaries (1)\pgsql\bin
then find your local user data path, it is in mostly
C:\usr\local\pgsql\data
now all we have to hit the following command in the binary terminal path:
C:\Users\LENOVO\Documents\postgresql-9.5.21-1-windows-x64-binaries (1)\pgsql\bin>pg_ctl -D "C:\usr\local\pgsql\data" start
done!
Always better to install a previous version or in the installation make sure you specify the '/data' in a separate directory folder "C:\data"
For Windows 10 and 11 users, here are the steps:
Go to Edit environment variables for your account (search for it on the start menu)
It will open the System Properties form — click the Environment Variables
Under the User variables for <username> (or you can add it in system variables), find the path variables and click edit, and add the path to your Postgres bin file address (in my case it's C:\Program Files\PostgreSQL\15\bin).
And save it and re-open the terminal.

Apache Maven installation in windows 8

I followed steps mentioned in this link http://maven.apache.org/download.cgi
Whenever I type mvn --version in cmd.
I got 'mvn' is not recognized as an internal or external command, operable program or batch file.
But when I opened cmd with "Run as a administrator" it worked.
OS: windows 8
How can I run mvn for any user on windows 8.
Try setting the environment variable M2 as System variable instead of User variable.
I used Rapid Environment Editor, started as an Administrator, and put these variables into my System path, and this problem went away.
For some reason, when I added the the JDK, JRE, and Maven bin folders to my Path through the Windows utility, it didn't work. Rapid Environment Editor told me that the variables were not valid or I did not have access to them. Windows 8 seems to be really picky about administrator rights and I guess they didn't think that through very well.
Just be sure to start Rapid Environment Editor as an administrator, and re-open your command windows when you save your changes.
I had to move the installation directory of Maven into C:\Users*your_username*, so that Maven no longer required admin permissions. The PATH variables started working after that.
Set the MAVEN/M2 and MAVEN_HOME/M2_HOME variables in the environment variables in windows 8, this will solve the problem.
I'm using chinese version so that i'm not sure what's these word in english version.
click right button on "My computer"
click last item on list
click "Advanced system setting" at left side
"Evironment Variable"
append maven's bin directory into system's environment variables path
after all, try linux
The simplest way is:
Add maven directory to the path in systems variable.
don't add anything in user variable and no need to add any variable.
faced the same problem; The bins or files from path for M2_home and Java_home need to be found in a directory where the user has full control permission. Change the security permission settings of the user through the administrator by right click on the order, go to properties->security tab and check the Full control box for "authenticated user" and "user".

SVN+SSH and Sourceforge

I'm new to both Sourceforge and SVN (SilkSVN on Windows).
I managed to check out a project using
svn co --username=zeroth123 svn://zeroth123#svn.code.sf.net/p/stddecimal/code/trunk stddecimal-code
However, every time I try and use ssh (so I can check in for example) it fails with
> svn co --username=zeroth123 svn+ssh://zeroth123#svn.code.sf.net/p/stddecimal/code/trunk stddecimal-code
svn: E720087: Unable to connect to a repository at URL 'svn+ssh://zeroth123#svn.code.sf.net/p/stddecimal/code/trunk'
svn: E720087: Can't create tunnel: The parameter is incorrect.
I've set SVN_SSH to point to my fully qualified plink.exe and it makes no difference. I also tried changing it to junk.exe and didn't get anything different, so I don't think we're even looking at SVN_SSH, which exhausts all of the advice I've been able to find on the Sourceforge and other forums.
For the record I am the project administrator and therefore have write permissions (or at least think I do!)
Any ideas?
`%SVN_SSH% needs to be set correctly and an SSH key needs to be registered with Sourceforge.
Note that new Sourceforge projects are version 2.0 by default, while 99% of the Sourceforge documentation is for version 1.0 and appears outdated.
These instructions assume you have SVN and the PuTTY tools installed, and that you can successfully access your project using a non-secure protocol, eg the read-only svn checkout svn://USER#svn.code.sf.net/p/PROJECT/code/trunk PROJECT-code style command should work.
These instructions explain how to do the same with svn checkout svn+ssh://... which is needed for write access to Sourceforge.
Set %SVN_SSH% to the fully qualified path of your SSH client. E.g. setx SVN_SSH "C:/Program Files (x86)/PuTTY/plink.exe"
svn expects forward slashes or double back-slashes in the path
You may have to reopen a cmd window
Test by typing %SVN_SSH% at the prompt and confirm you get your ssh programs help screen (or whatever behaviour you expect from executing with no arguments)
(Optional?) Cache the server RSA key. Open PuTTY, login to svn.code.sf.net (or whatever the server of your project is). A prompt will appear asking if you if you want to cache the server RSA key - click Yes.
You might not need to do this, if not when you use SVN to connect ot your project for the first time you will be asked the same question. Type y.
However, I did this because I thought the interactive prompt could be part of the problem.
Create a public / private key and register the public key with Sourceforge.
On creating a key, more info herefor example.
If you use PuTTY, use PuTTYgen to create the key, and make sure the private key is loaded in pageant. Ironically Launchpad has excellent instructions.
The public key can be registered on Sourceforge by navigating to Home > Account > Services and clicking Edit SSH Keys for Shell/CVS.
Now a checkout using svn+ssh protocol should work!
I followed the instructions here and it worked. Its a quicker method that doesn't require uploading keys etc.
Download plink.exe from http://the.earth.li/~sgtatham/putty/latest/x86/plink.exe
Place the plink.exe in your windows installation directory (%windir%)
Open the following file using Notepad %APPDATA%\Subversion\config
Add or Replace the following line in the [tunnels] section (replace login and pwd with your sourceforge login and password)
ssh = c:\\windows\\plink.exe -batch -l <LOGIN> -pw <PWD>
(note the double backslash)
Save and close the file
For me the issue was that Tortoise was initially installed on the D drive. I uninstalled it and reinstalled it on C without changing the related settings. The solution was to copy the TortoiseSVN folder from C drive to its original location in D drive.
For anybody (like me) working with Tortoise SVN who has it working for Tortoise SVN but needs command line access for easier bulk analysis... and doesn't want to go through the faff of registering an SSH key.
Copy the value you are using in Tortoise - Settings - Network - SSH Client (mine has username, password arguments)
Edit the command line configs ssh line in %APPDATA%\Subversion\config as per the answer above to use the line you copied from Tortoise
That way, you can use the Tortoise Plink.exe with arguments for username and password.

Resources