SVN. Copy files and folders between repository folders - eclipse

I have a working copy which structure is similiar to this:
wc-root
-folder1
--trunk
---somefolder
-folder2
--trunk
How I can copy somefolder to folder2/trunk with all it's contents but without .svn files? Is it possible with SVN means? I tried to merge but failed.
I use eclipse with subclipse plugin.
UPDATE
I work with more complicated folder structure. Example:
-folder1
--trunk
---somefolder1
----file1
----file2
---somefolder2
----file3
-folder2
--trunk
Currently if I want to copy file1 and file3 to folder2 I had to create somefolder1 and somefolder2 under folder2/trunk and then make export to particullarly those folders.
What if I have >40 files in > 20 directories?

Export
Use the 'Export' function to extract the files without the .svn files.
You can export directly into the correct location. On your next commit, Tortoise will recognise the new folder and allow you to add it to the repos.

Related

Why doesn't this ignore my files recursively?

In my project's root directory there are directories like 'tools':
tools/evaluate/test/
tools/evaluate2
Under test, there are some .py and .csv files. I want to ignore all files except .py, so in my .gitignore, I have this entry:
!tools/**/*.py
I want to recursively ignore all non-python files under tools. What's wrong with that?
if the files you are trying to ignore have been already committed, you need to remove them from the staging area as well, that's done by:
git rm --cached !tools/**/*.py
check the status:
git status
add the files you want to delete to .gitignore i assume manually, i don't know of an automatic way, then finally:
git add .gitignore
git commit -m "Remove unused files"
Two parts are needed here:
# Recursively ignore everything in tools that has an extension:
**/tools/**/*.*
# Except .py files recursively in tools:
!tools/**/*.py

.gitignore not ignoring a folder within a directory

It seems a straightforward one, but having researched multiple ways to do it, I can't gitignore a folder within a directory.
I have a root directory which contains all of my code in it. Because it has some back-end NodeJS stuff in it, it has a 'node_modules' folder which contains hundreds of files. As a result, when I try to upload the entire parent folder, GitHub says there's too many files to upload and tells me to reduce the number I'm uploading.
The crucial part is though, the folder has to be uploaded as a whole, as it itself is within a GitHub repository with other files with different folders in.
That means when I go onto my repository, I need this folder's files to display within the folder, and not separately within the repository. I need all of the files to be within this folder, within the parent repository, excluding the node_modules folder.
For example ->
Parent repository -> Child Directory (what I'm uploading) -> Individual files
I've tried to add the node_modules folder to my gitignore through the following methods:
Adding: node_modules/ to my gitignore file
Writing: echo node_modules >> .gitignore through my terminal
Adding a separate gitignore file within my node_modules file with a * in it
None of them have worked and I can't find any other solutions. For reference I'm using a Mac.
Does anyone have any idea what I'm doing wrong, or how it'd be best to do it?
By default, you do not need to include the node_modules folder in your repositories because the package.json file contains all of your project's dependency information. This means that anyone who clones your repository can run npm install and have the entire node_modules folder without problems.
To solve this you can create your own .gitignore file, creating a new file at the root of your project and renaming it to .gitignore (writing exactly that way). Then you can open it with any text editor and add */node_modules to one of the lines.
This will likely solve your problem.

How to make subfolders repository in Github

I've been using this folder structure where I would have one main .git folder and then have subfolders inside which doesn't have .git folder.
So as example :
Main Folder
Subfolder
Subfolder
Subfolder
Now what I want to do is, I would like to extract some of those subfolders and make them separate repositories with their histories. Which means subfolders will become a main folder as a repository. Any idea how?
The official documentation use git filter-branch.
But that or BFG are obsolete.
Use the new tool git filter-repo (directly in your regular local repository, although a backup is always a good idea before those kind of filtering)
Use a path shorcut:
git filter-repo --subdirectory-filter Subfolder1
Only look at history that touches the given subdirectory and treat that directory as the project root.
Equivalent to using --path / --path-rename /:

How to get the files only from a bzr repository?

I meant, I don't need all the ".bzr" folders under each directory (I may have hundreds of nested ".bzr" folders); I want to check out those actual files only. Thanks!
Are you really sure you have hundreds of nested ".bzr" folders? There should be only ONE .bzr folder per project, right at the top level directory of the project, no additional .bzr folders in subdirectories. (You might be mixing it up with Subversion?)
It seems that maybe you want to get all the project files without any .bzr folders or Bazaar files. If that's the case, cd to your project and run any of these commands:
bzr export /tmp/project-as-dir # export files into a directory
bzr export /tmp/project.tar # export files into a tar file
bzr export /tmp/project.tar.gz # export files into a tar.gz file
Simply remove the folders, e.g. using find -type d -name .bzr -exec rm -rf {} +
Note that you won't be able to use bzr in that copy anymore (i.e. you can't commit stuff etc.).

Change root directory of repo in Mercurial

I'm working on an Android game with the folder structure:
\bin
\data (contains game graphics)
\libs (libgdx engine jars)
\src
----\com
--------\brand
------------\game
(*.class files)
Foolishly, I created a mercurial repository (hg init) in the \src directory. Thus, if I update any of the graphics (small file sizes), they aren't added to the repo when I commit. My question is: how can I change the root of the repo to include the \data directory as well as the \src directory, but without including the \libs directory as that includes 10-20mb jars?
There are two ways to do this.
1) Start a new repo. It's quick and easy but you'll lose your history.
2) Use hg rename. This is effectively a move command.
Rename the src directory to be something meaningful and then do this.
hg rename MyProject/com MyProject/src/com
Copy all the files/folders into the MyProject/ directory.
Mark bin and libs as ignorable and
Add everything else.
hg commit
If you don't want to just do an hg rename, you can do it with the convert extension (which comes by default with Mercurial, you just need to enable it in your .hgrc).
Run it with the --filemap parameter and a filemap file that has something like:
rename com src/com
You will end up with a new repository with all of your history, but with your com directory moved into src/com. You can then copy you bin, data and libs folders in there, run hg addremove and you should be all good to go.
Warning: the new repo is completely different than the old one -- changeset IDs and such will be different, so anybody you worked with in the past will have to get on the new repo.