what happens when I copy a checked out code folder under CVS? - version-control

I am working with a CVS repository found on a remote server.
I check out the code to a local directory code_local
Then I copy code_local, into code_local_2
Do I have now two independent local copies of the repository? Can I change files, commit, update etc. on each directory independently, is if it was done form two different computers?
(this may depend on the way CVS stores information about a local copy)
Yes I do know it's not a straight forward use of CVS, just asking if it will work

Do I have now two independent local copies of the repository?
Yes you have two independent LOCAL copies.
Can I change files, commit, update etc. on each directory
independently?
No, both copies point to the same file on the same repository. so they are independent as long as you haven't committed them. when committed the last commit operation will overwrite the previous one.
in fact there is a CVS folder beside every folder of your code that keep repository information of files inside that folder. so when you copy a project or a package, the CVS folder will be copied along with, so the same repository entries will be referenced, no matter how many copies have you made.
Even if you past the copied folder to another package hierarchy, whenever you commit the files it will replace the original files in repository where it first created.
If you want to have independent copies you have to copy and place your source code (.java) files only and commit it through Eclipse for example, in this case the CVS plug-in doesn't find any existing CVS folder beside the new folder and generates a new one in the local and new entries in the repository.

Related

Why does eGit create an extra directory in the remote repo when I do the first commit/push?

Using eGit...
When I perform the initial Commit and Push from Eclipse, a new directory appears in the remote repo. Inside that directory is the root of the project directory. It makes a big mess because when someone clones it (again using eGit) the src folder is munged into a name containing then project folder name, which mucks up the package references in the class files.
eGit assumes you don't want an entire git repository for a single workspace project. Doing so would be wasteful and cumbersome for almost anything nontrivial. https://wiki.eclipse.org/EGit/User_Guide#Implications
You also didn't commit the .classpath file, which would have indicated what the source folders were.

Making changes to multiple copies of the same file in a repository

I'm new to github and have created a repository with multiple folders. Each folder has a copy of the same file (say abc.txt). I've linked my account to github desktop, so I have a matching local repository.
I constantly make changes to abc.txt in one of my local folders, but I want to push that change on to ALL copies of abc.txt in my online repository. The obvious alternative is to just copy and replace all copies of abc.txt on my local machine by the latest version, and push my entire local repository online, but surely there's a better way?

TortoiseSVN: Merge a different repository with similar structure into current WC (with local modifications)

Here's my situation: I have a checkout from a repository that has long since been moved to a different site. This working copy of mine is from an old revision of said repository, and there are local modifications as well. The author's method of moving the repository involved deleting the contents of the old repo, leaving a single text file named something along the lines of "MOVED", with instructions.
The new repository still has the same (or similar) structure. What I would like to do is "merge" (I apologize if I'm using the wrong terminology) what is in the new repository with what I have in my working copy. I'm a little hesitant about doing this since I learned that TSVN will overwrite local changes without prompting me sometimes.
How can I go about merging the new repository in my local WC?
I suggest you to Check Out your "new" repository into another folder and overwrite the files with Copy-and-Paste. As the project structure was significantly modified, after overwriting this local copy, check file by file using Diff command.
At finishing, Commit the modifications and Update your other local copy. The local changes from this local copy won't be lost. The most that can happen is some conflicts.

CVS branch actual location on server

The CVS repository in my project has a HEAD code and 8 other branches. The server location mentioned as '/local/cvs/srcjboss' contains only the projects in the HEAD branch.
Is there a physical location on the server where all the branch code can be accessed ? I need the server location for CVS to SVN migration.
If it helps, we are using a linux server
To convert a CVS history to Subversion using cvs2svn, you need filesystem-level access to the data from the central CVS repository. It is not enough to have access to a working copy where the code is checked out. It's not really clear from your question which of these you have under /local/cvs/srcjboss.
A CVS repository is recognizable from its CVSROOT subdirectory and lots of files named like your project files, but with ",v" appended, like maybe "Makefile,v" or "index.html,v" or "build.xml,v". Each of these files contains the entire history (including branches) of the corresponding file from your project, in rcsfile(5) format. The repository probably also contains "Attic" subdirectories that hold the histories of files that are not present in HEAD.
A CVS working copy, on the other hand, contains one particular version of each file (with no ",v" suffix), plus a CVS subdirectory in each of your project directory. A CVS working copy doesn't contain any of the project history.
So is your /local/cvs/srcjboss the CVS repository or is it a working copy?
If you have a working copy and are trying to find the central repository, look in one of the files named CVS/Root. It will tell you the location of the repository from which the working copy was checked out.

Where is git repository of Xcode stored? And Why different repository is created when I copy project directory?

I'm using built-in git of Xcode.
I think my project directory is just a working copy of repository.
How can I know where repository is stored?
And when I copied a project directory, a new different repository is automatically created for new project directory instead of sharing the repository of old project directory.
That is convenient but why that happend?
Git stores the repository in the top-most .git folder of your working directory. So, if your code is in /Users/js/Code/MyProject, then the repository is in /Users/js/Code/MyProject/.git/.
Git encourages every repository to contain a single "project". Although it's possible to store unrelated branches that don't share any history in a single repository, that is very nonstandard and might be confusing to other people.
It's also possible, but discouraged, to store unrelated projects as subdirectories within a single working directory. This would make it difficult to see the history of each individual project, since you'd have to inspect each individual commit to figure out which project it affected, and merges would be downright painful.