Files already exist in <location> when migrating a repo.
See original GitHub issueOk, back again 😃
I was able to get copybara working using the copybara repo, and now I’m switching over to the @sonatype repo I want to migrate to a public one.
I’m running copybara copy.bara.sky --force
My copy.bara.sky looks like:
url = "git@github.com:sonatype/INTERNAL_REPO.git"
core.workflow(
name = "default",
origin = git.origin(
url = url,
ref = "master",
),
destination = git.destination(
url = "file:///tmp/foo",
fetch = "master",
push = "master",
),
destination_files = glob(["matthew/py-iq-reports/IQreport/**"], exclude = ["README_INTERNAL.txt"]),
authoring = authoring.pass_thru("Jeffry Hesse <jeffryxtron@gmail.com>"),
transformations = [
core.move("", ""),
],
)
I end up with this:
764 jeffryhesse:IQreport (master *)$ copybara copy.bara.sky --force
Copybara source mover (Version: Unknown version)
Task: Git Origin: Initializing local repo
Enter passphrase for key '/Users/jeffryhesse/.ssh/id_rsa':
WARN: Cannot find last imported revision, but proceeding because of --force flag
Task: Moving
ERROR: Files already exist in /Users/jeffryhesse/copybara/temp/workdir2564596437170999916/checkout:
I’ve truncated the filelist since it’s a lot of internal stuff, plus likely not going to give much actual detail on the issue. I’m not sure what’s quite going on here, and I’m sure I’m missing something. Any help is appreciated.
Issue Analytics
- State:
- Created 6 years ago
- Comments:12 (6 by maintainers)
Top Results From Across the Web
Target location for project " " already exists, can not move project
Goto your Git repo in the file system and paste the project folder at the location you want (may be inside another folder...
Read more >Moving a file to a new location - GitHub Docs
On your computer, move the file to a new location within the directory that was created locally on your computer when you cloned...
Read more >Remote Origin Already Exists Error: How To Fix It | CloudBees
Go to your local repository and remove the existing origin remote. Add the new online repository as the correct origin remote. Push your...
Read more >How to move a git repository with history | Atlassian Git Tutorial
1. Create a local repository in the temp-dir directory using: · 2. Go into the temp-dir directory. · 3. To see a list...
Read more >Migrating to a new Git repository | Looker - Google Cloud
Now, to bring in history and files for dev branches, you'll need to do git checkout dev_branch_name and git push origin for each...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
No problem at all 😃. We should improve the documentation.
Let me write here a short example for now:
Lets say we want to move ‘public’ folder from git.origin but we don’t want to export ‘public/SECRET.txt’
origin_files would be:
Note that we exclude public/SECRET.txt and not just SECRET.txt. This is because the include part can contain multiple folders.
Now lets say we want to move everything to the root of the destination:
Now lets say we have in the destination a README.txt file that we don’t want to delete:
Now lets say that instead we want to keep it in the ‘public’ folder in the destination. You would not include any transformations (You can skip transformations = …) and instead you would write the following destinations_files:
Or if you don’t have a README.txt inside public:
I came here by googling for that error message. My solution was to use
overwrite=True
. Just in case someone else comes here and is as impatient as me when reading the move reference: