I would like to convert a remote Perforce repository into a Mercurial repository on Linux.
So I have installed Python and Mercurial on a Linux box.
Then I test few hg (Mercurial's drive program) commands. All are working fine.
Now without creating any hg repository on the Linux box I want to run hg convert on Linux, so that a Mercurial repository (of a Perforce repository) will be created on it.
But when I tried the "hg convert" command it was not working. I know "convert" extension needs to be configured in the .hgrc file. But I don't have any hg repositories here.
Is there any any place on Linux where
I can create hgrc file with convert
extension so that hg convert command will be
accessible for me?
or
Should I first create a hg init
hgrepo on Linux and then edit .hg/hgrc file with
proper configurations and then perform
hg convert //perforce repo/.. /root/hgrepo on hgrepo?
What can I do to resolve this issue?
Place your .hgrc in your home directory, see the manual: hgrc
Related
I have a Windows PC and on the same PC I have a Lubuntu VM inside the VMWare player.
I share my Windows folders so I can see them from the Lubunutu VM.
My problem is when I clone a Git repo on Windows (using Tortoise Git) and then try to access it from Lubuntu (using Git from command line) all files appear modified although I have not changed them.
I know that reason for this is that Windows and Linux handle the new lines differently.
My question is how can I configure my Git installations on Windows and on Lubuntu so I do not have this problem?
Update:
As suggested (by Craig Estey) this does not seem to be CRLF problem. I tried cloning a repo in my Linux VM on the shared directory and got following error:
fatal: 'origin' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.`
I have no problem cloning the same repo on the VM's local drive.
Any idea what could be the reason?
Note: The main reason I want to do this is to keep my VM's drive size small and use shared drive as much as possible. My VM's local drive is on SSD drive and shared drive is on much larger HDD.
Suppose you put a repository into a Windows Shared folder.
And mount(Mount shared folder on Ubuntu) that shared folder on Ubuntu, so you can clone that repository. (Talking about you can not clone, it must be another problem. I tested it, good for me.)
When you cd to that repository in that mount, you see all files are modified on Ubuntu, then it should be the EOL problem.
On Windows the autocrlf is true by default(assume you are using Git for Windows).
When you clone a repository on Windows, the files will be checkout with CRLF EOL.
But, On Ubuntu the autocrlf is false by default. Using git in that repository which is mount on Ubuntu, git expects the EOL is LF. But, the EOL is still CRLF. That's why git treats all file as modified on Ubuntu.
To fix this problem, make sure both OS to use the same autocrlf value, or using .gitattributes to control the EOL.
For example, using false value:
On windows,
Delete all files in working tree of that repository.
(Note: if you have local changes, commit them first.)
Run git config core.autocrlf false for that repository only. Or
Right click in that repository, click TortoiseGit -> Setting
In Settings dialog, go Git node, select local and un-check the AutoCrlf
Apply the change
Perform git reset hard to get all files back with correct EOLs.
Open TortoiseGit Log Message dialog
Right click on current branch and perform Reset "<current branch name>" to this
Choose "Hard" option
On Ubuntu, you should not see all files modified.
For using .gitattributes:
* -crlf
I am extremely new to SVN, I am using SVN on Mac OS terminal. I have a file on my laptop that I want to transfer to my repository on my remote server.
This is what I have done:
I have checked out the repository. It says "checked out revision *".
I have used cd until the folder that I want to insert the file. So at this point I have a path like: (...../src/soln$) so I want to insert the file in the 'soln' folder.
When I try:
svn add ('...../lo.java') (the path to my file on my computer) it says:
('....../src/soln/') is not a working copy
svn import ...../lo.java it brought something weird to the screen
Please help me figure out what I am doing wrong or not doing.
The error indicates that the parent is not yet in svn. Try to svn add each folder above lo.java.
As an example if the repo root is at /path/to/my/repo and your file is in /path/to/my/repo/src/soln/lo.java then you'll not only want to svn add lo.java from inside the soln directory, but you'll also want to svn add /path/to/my/repo/src and then svn add /path/to/my/repo/src/soln before you can perform the svn add lo.java
I'm wanting to automate a local server to pull github repositories and then add copyrights to the code files, if they aren't already there, then commit and push them back. I have the copyright executable running on the linux centOS server, but I can't get a way to tell my program to run or not. Webhooks don't work since its a local server, not web-facing, any ideas?
My first thought is that you could write a script to do this. The easiest would be to use a shell script or a python script.
The script could do the following.
Open every directory
for each directory
for each file in the directory
if not contains copyright
add copyright to top of file
git commit -m "add copyright"
git push
I use Windows 7 and also I use TortoiseSVN to keep track of my code, now I want to migrate my repository to a cloud-service and the requirement is create a *.dump file, but I can't find a way to create it. Some forums say to use "svnadmin" but I can't find it also.
My question is how can I create a *.dump file with TortoiseSVN?
TortoiseSVN ships the svnadmin utility with it. It is a command line utillity. So you will have to create a dump of your repository in the command line.
To create a dump of your repository, use
svnadmin dump C:\SVN\MyProject > C:\tmp\MyProject.dump
where C:\SVN\MyProject is the path to your SVN repo and C:\tmp\MyProject.dump is the path to the dump file, which will be created.
To import your previously made dump file into a new repository, use
svnadmin load C:\SVN\MyProject < C:\tmp\MyProject.dump
where C:\SVN\MyProject is the path to your new SVN repo and C:\tmp\MyProject.dump is the path to the dump file, which should be imported.
Subversion 1.7 now has the svnrdump command line utility.
svnrdump dump https://host/repo > repo.dump
Note that this always creates a dump with deltas, which might not be what you want.
TortoiseSVN is a svn client. It cannot take a dump of your repository. You need a tool like svnadmin on the server hosting your SVN repository to take a dump. You need access to the server and its filesystem.
Also see here for migrating a repository
svnadmin is part of the SVN server, so you should have a direct admin access to your repository server.
The first thing you need to do is follow this tutorial to get some idea about how to use TortoiseSVN on the local machine.
http://www.thinkplexx.com/learn/howto/scm/svn/how-to-create-and-use-local-svn-subversion-repository-on-windows-or-linux-simple-and-fast-step-by-step
once you have done with above tutorial and committed your files to the repository, execute below command.
svnadmin dump TortoiseRepository > dumpfile
If your TortoiseSVN repository is not called 'TortoiseRepository' just change the name above to whatever you have called it. If the dump works you should see lots of '*Dumped revision' messages. The 'dumpfile' now contains an entire export of your TortoiseSVN repository and all the revisions, comments etc.
I'm trying to switch from a windows environment to Linux. I'm primarily PHP developer, but I do know quite a bit about other languages such as CSS, XHTML and Javascript. I need a way of editing my files locally because I work in a git repository and need to commit my saves. On windows I used Aptana and PDT. I'd save my files, upload via Aptana, then commit my work with git.
I need to get a work flow going on my Linux machine now. If you know a better way to do this let me know, however my real question is, is there a plugin that allows gedit to upload files instead of working remotely?
git was designed for distributed development and works well as a mechanism for deploying code to a web server.
On your Linux PC, git clone your git repository url. Edit and commit locally and then git push the changes to the git repository. Then, if you have shell access on the server, use git pull to copy the changes to your server.
To ftp sync, you could set up a branch, ftpbranch, that corresponds to what is on the server, and then each time you want to sync ftpbranch with master:
filestoput=`git diff --name-only master ftpbranch`
Now upload the files:
for f in $filestoput; do curl --ftp-create-dirs -T $f ftp://serverurl
Now update ftpbranch indicating these files have been copied to the server:
git checkout ftpbranch; git merge master; git checkout master
When using linux, you can mount the ftp server to a local folder, then opening and save file from that folder will automatically download and upload the file to ftp server.
If you use ubuntu, just click on Places > Connect To Server.... Choose FTP in Service Type dropdown, fill in the required info, then don't forget to bookmark it.
After this, you can open the file directly in any text editor, not just gedit. I would recoment geany for serious programming editor, because it have a lot of neat feature, almost same with Notepad++ in Windows.
But, since you already using git, why not just use git push to get the update and git pull to upload the update? I have long since uploading manually to my server. Git do all the work for me, synchronizing it between servers. Any particular reason why you still need ftp?