how to start storing Eclipse project to local svn repository? (fresh install of everything) - linux

I've just installed Ubuntu, Eclipse 4.4 Luna C/C++, everything with default settings. I've created my first c++ project and want to start storing entire Eclipse workspace in svn repository (also I expect Eclipse GUI to work with repository). SVN repository itself i want to store locally (likely in Dropbox folder).
What steps should I do?
upd That's how I solved my problem:
To install subversion in Ubuntu execute sudo apt-get install subversion
In Eclipse just go to Help-Install new software. Select "all available sites" and type "Subversive" install everything
After Eclipse restart install "SVNKit" connector of the same version as svn --help
In SVN Repository Exploring perspective just click "New Repository" and follow instructions.

Don't store the entire workspace in SVN, just store the project.
Install SVN on a machine, pay attention to the svn admin tools.
svnadmin create /path/to/root/of/repo
Edit the /path/to/root/of/repo/config/svnserve.conf
Uncomment anon-access = whatever and change it to anon-access = none
Uncomment auth-access = whatever and change it to auth-access = write
Uncomment password-db = passwd
Edit the /path/to/root/of/repo/config/passwd
Add under the [users] section a line that looks like yourUserName = yourPassword
Find the instructions for your operating system to configure the program svnserve to run.
Now you should be able to checkout to other machines, you'll still need to "finish off" the respository you created. It needs tags/trunk/branches.
svn checkout svn://hostname.of.server/repo
cd repo
mkdir trunk tags branches
svn add trunk tags branches
svn commit -m "Initial repository setup"
after you get the messages the commit succeeded
cd ..
rm -rf repo
svn co svn://hostname.of.server/repo/trunk repo
(and use that as the root of your Eclipse project directory)
I highly recommend doing the last checkout in the IDE, after adding in the SVN support bundles.

Related

How to pull a new-create file from server repository by svn?

I've already install subversion in my centos server.
I created a new file named "test" in server's repository.How can I pull this file to my local repository?
What I've done:
I typed svn add test ,then svn commit test in command line,and then I updated in my PC's repository,but nothing happened.
I am a newbie.Thanks in advance!
Finally.I know how the svn work.
I should create a svn repository in centos first, then add and commit that file to that repository ,and then checkout on PC.

Make a node project directory and SVN repository

I have a node app running on production server ~/nodeapp
I am trying to turn /username/nodeapp to an SVN repos
Since this is running on live server!! here are the steps I took
Create a repo
svnadmin create ~/nodeapp.svn
Set permission
vi ~/nodeapp.svn/conf/svnserve.conf
and add the following:
anon-access = none
auth-access = write
password-db = passwd
Import ~/nodeapp into the ~/nodeapp.svn
svn import ~/nodeapp file:///home/nodeapp.svn
Finally Rename Folders
mv ~/nodeapp ~/nodeapp.bak
mv ~/nodeapp.svn ~/nodeapp
nodeapp should now be under version control.. however pages are not loading
when I
cd ~/nodeapp && node app.js
What am I doing wrong. Why is node under SVN Repo not working
Subversion repositories are nothing like git repositories, which it looks like you're trying to emulate here. You cannot run your Node app directly out of the Subversion repository.
Instead, you need to have your repository elsewhere (on the filesystem or on a Subversion server elsewhere). Commit your code to the repository and check out a working copy to ~/nodeapp for your application to run.
You really need to read the Subversion manual, and pay special attention to the "Version Control the Subversion Way" section. Also, the FAQ entry about running a website with the code managed by Subversion may be helpful

What is wrong with my git 1.8.4.2-1?

I have an old Synology DS-106j server where I tried to install git using ipkg command. The installation went smoothly, but git failed to work correctly. I am currently learning how to use git, so I don't know if it is a bug from git with the version I am using or something else is wrong.
What I did was create a new local repository with a specified name, add a new file, commit it, and got an error:
NAS_SERVER> git init Test
Initialized empty Git repository in /root/Test/.git/
NAS_SERVER> ls
Packages.gz git_1.8.4.2-1_powerpc.ipk
Test
NAS_SERVER> cd Test
NAS_SERVER> git status
# On branch master
#
# Initial commit
#
nothing to commit (create/copy files and use "git add" to track)
NAS_SERVER> touch Test.cs
NAS_SERVER> ls
Test.cs
NAS_SERVER> git add *
NAS_SERVER> git status
# On branch master
#
# Initial commit
#
# Changes to be committed:
# (use "git rm --cached <file>..." to unstage)
#
# new file: Test.cs
#
NAS_SERVER> git commit -m "Test"
fatal: 57e2b8c52efba71d84c56bf6f37581686b9061a3 is not a valid object
I thought...maybe I did something wrong, so I used git on Windows OS and try a push. Still an error. Transfer the whole repository to the server and check the status. It seems fine. Try a commit. Still the same result. What worse is that I can't update git version without having to compile it, which I don't even know how to do so. Any suggestion to what might be wrong?
If your goal is to push into a git repo located on the synology disk(s) for backup purposes I'd recommend a different approach which would avoid having to install a rather old git version on the synology box itself (which could lead to problems if/when using a newer git version on the windows machine).
Export a samba share from synology, mount it on windows and use the windows git to create the backup repo (maybe even a bare repo, eventually group shared if you plan to share work with other people). Then push from your working repo into this backup repo - all on the windows box. In this scenario the synology box doesn't need git installed, it just serves files (i.e. its original job).
I'm using such setup but with a linux machine instead of a windows one and with the bare repo on the synology disks exported via NFS instead of Samba.

Migrate repos between instances of Gitlab

Due to my old installation of Gitlab being too difficult to upgrade (Thread on TKL support forums: http://www.turnkeylinux.org/forum/support/20120913/upgrading-gitlab ), I have downloaded the current TKL Gitlab distro, and followed Gitlabs standard upgrade path so that I now have a fully upgraded Gitlab 6.1 installation running with TKLBAM and all that good stuff. So far so good.
But, it turns out that our old version of gitlab does not give HTTP urls to repos, so that means that I can't use the "Import existing repository" function in Gitlab 6.1
I know that i can simply copy the old Git repositories from the old VM to the new one, but how can I make these repositories visible in Gitlab on the new VM?
I recently migrated from gitolite to gitlab and the official rake task gitlab:import:repos worked for me. I am using gitlab 6.1.0 (82f3446). Here is what I did:
rsync bare repos from gitolite to repositories/{group}/. Make sure to replace {repository} with the name of the gitolite repo, and change the hostname of your gitlab server.
rsync -rth --progress repositories/{repository}.git \
git#gitlab-server:/home/git/repositories/{group}/
Here, {group} is the name of the user group you want the repository to be added to. If you don't have any specific group, choose root as the group name.
Fix permissions – only necessary when the rsync user is not git:
sudo chown -R git:git repositories/{group}/
cd ~/gitlab
Run the rake task to import all new repositories:
bundle exec rake gitlab:import:repos RAILS_ENV=production
Now if you login as Administrator you will find the new project added.
For more information, refer to the "Import bare repositories into GitLab project instance" under http://{your-gitlab-server}/help/raketasks.
In your case, you can login to your old TKL system and rsync all bare repos to the new instance, followed by an import.
One option would be to:
Clone the old repo from gitlab onto a dev machine.
Create a blank repo on the new gitlab.
Add the new repo as a remote on the dev machine.
Push everything back to the new repo.
Remove the old repo from remote repos list.
To create a remote called newRepo, do: git remote add newRepo gitlab.localhost.com:User/newRepo.git (replace the url on the end with the one for your repo)
I did it practically the following way after reading ChrisA answer, which gave me a little headache about how to do it practically. The example copies a repo from github to gitlab, to make source and destination a little bit clearer.
Clone the old repo from github onto a dev machine (which creates a bare repo):
$ git clone --mirror git#github.com:me/myrepo.git
Create a blank repo on the new gitlab.
Add the new repo as a remote on the dev machine.
$ cd myrepo.git
$ git remote add newRepo git#gitlab.com:me/myrepo.git
Push everything back to the new repo.
$ git push --mirror newRepo
That's it.
This way it copied all branches and tags to the new destination.
You can now remove the cloned bare repo from your dev machine.
If your Gitlab is >= 8.9, then you can use export/import to migrate repos.
Since GitLab 13.8 (January 2021), you now have:
Migrate Groups directly between instances
A faster and easier way to migrate your GitLab Groups is on the way.
Group Migration is a new feature that lets you copy a GitLab Group from one instance to another directly, without having to export and import any files.
In this release, we migrate only the Group object with basic fields.
We plan to follow up with more and more fields and related objects until all relevant data in a Group is migrated in this easy-to-use fashion.
See Documentation and Epic.

How to copy files in an svn repo to another folder on the server

Running a centos 6 server with svn repos stored on it. To deploy updates, I'd like to copy from the relevant directory within the svn repo to the appropriate /var/www website directory. Is there a simple way to do this?
Use the svn export command to do that. The subversion red book explains in detail how to do that.
When the relevant svn repo is stored under /export/svn/repo, and the part of the repository you want to copy from is /trunk/my_project/news, the whole command will be:
svn export file:///export/svn/repo/trunk/my_project/news /var/www/news

Resources