Alternatives to cloning repository - atlassian-sourcetree

My team works with Bitbucket > Sourcetree. We are having problems cloning the repository, possibly due to size and network, but some others have the repositories from past. Can they zip and send it to us? What other solutions/options are there?

Related

Speeding Up git clone in Jenkins by downloading archive

My Jenkins pipelines use the GitHub SCM module, which checks out my repo using git clone.
Recently though, I've been seeing frequent build failures due to intermittent network performance issues, leading to git clone timing out.
One solution would be if I could pull the repo down as a zipped archive instead, this would drastically reduce the download time.
My questions are:
a) Is this advisable (compared to using git clone)?
b) How would I do this to get the same effect as git clone
c) is it possible to do this using the Git SCM plugin or similar plugin?
Thanks in advance for any advice!
If is a network problem you should fix the network problem.
But, if you can't maybe the solution is increase git clone timeout.
Again, the best solution is fix the network.

Import contribution to github from bitbucket

I just got a new job recently, and all repos of their projects are on BitBucket.
I used to use a lot GitHub, so I was wondering if there is a way to sync contribution between the two.
I have already tried https://github.com/jrm2k6/contwidgetor. It seems like a way to do it but didn't work for me somehow, and there is only limited support of it.
You can use Contributions Importer for GitHub
It copies all commits from source git repositories to a mock git repository. Each copied commit will report the same commit date, but the original code is not copied, neither the commit message.
The mock code is generated using the same language of the original source repository.
For example, I have a mock repository on my profile that reports all the activities of all my private repositories.
You can at least manually mirror any Git BitBucket repo from BitBucket to GitHub:
git clone --mirror http://user#bitbucket/user/repo.git
git remote add github http://user#github.com/user/repo.git
git push --mirror github
(Create an empty repo on GitHub side first)
Then, on demand, you can go into your local clone, do a fetch, and then a git push --mirror github again to sync new commits.
I was in the same situations, so I just whipped a node script together. I think it's more simple (implementation wise) than the solution posted by mir88.
The program then makes a shadow repository on GitHub. Each Bitbucket repository is represented by a file, and each Bitbucket commit is reflected by the Bitbucket commit hash.
The Bitbucket hashes are added backwards in time so the match the point in time when the original commit was made on Bitbucket.
Should be easy to change to your exact needs.
Feel free to check it out: Bitbucket 2 GitHub Activity Sync.

Migrate repository from GitHub Enterprise to GitHub [duplicate]

We have a few repositories and forks on a trial version of Github Enterprise. I want to evaluate how to migrate from Github enterprise to Github.com (into a paid for organization, say)
The only resource I found was how to perform the migration in the opposite direction
https://help.github.com/enterprise/2.0/admin/articles/moving-a-repository-from-github-com-to-github-enterprise/
I have contacted github.com asking the same questions as below and I am waiting for their response.
How do we migrate a repository from github Enterprise to github.com? (fairly certain that a git clone --bare and a git push --mirror will do the job)
If I migrate forks as well, how do we make sure that the relationship between the original and forks is maintained?
How do I migrate the webhooks and services we configured for our repositories?
How do I transfer the Pull requests/Issues? (article I linked to above says we need to use the Github API, I am OK with this solution)
Can we migrate teams and users? (guessing, probably not)
Note that we have the backups of the enterprise instance performed using the backup tools provided by github (I think it is called ghe-backup)
Thanks
You should be able to use the steps in the linked document in the reverse order as well:
Create an empty repository at github.com
Create a clone of the enterprise repository on your local.
Add github.com as a remote reference on your local clone.
Push all references to the github.com repository.
http://www.alexhadik.com/blog/2016/5/26/migrating-github-repositories-with-gitmover appears to offer a solution: GitMover is "a simple Python script that takes Git repos on any type of GitHub installation, and copies issues, labels and milestones from one to the other. It's the perfect tool to help automate the open-sourcing of an internal project."

Export mercurial local repo to GitHub/Bitbucket

I have a local mercurial repo on my desk, and I want to upload it to bitbucket, or github, so it can be viewed on the web.
So far I am stucked at the import phase, both GitHub or Bitbucket request that I provide an URL for my repo (i'd have prefer a simple path on my disk, to the repo).
I've started a local server but then the address:
http://localhost:8000/Myrepo/
failed to be acceded.
I know about the tortoiseHg Hg-Git plugin and I tried to make a push git://... but it failed too.
So my first question is: how to I put my mercurial repo on the web so it can be imported ?
My second question is: what's the point of having a bitbucket / github account if I have to set an online, public, mercurial server on the web to push to them ?
What I would like is to continue to work locally, then push to bitbucket / github, without having to set up a mercurial server.
Thanks
Problem: You have an existing local (mercurial or git) repo and want to transfer it to bitbucket
Short answer:
Create a new empty(!) repository in bitbucket
Copy the bitbucket URL of the new empty repo
Push your existing old repo to the address of the new bitbucket repo
Now the bitbucket repo is overwritten with the history of your existing (old) repo.
I just tested it and it worked perfectly :-)
The detailed answer to your Problem is explained here:
https://confluence.atlassian.com/bitbucket/push-versioned-code-to-an-empty-repository-877177145.html

From github to bitbucket

Imagine situation like this:
You have a working repo in bitbucket - you were pulling revisions from another bitbucket repo in Windows 7 through TortioseHG.
Now the second project has moved to Github system and you can not pull from it anymore.
So my question is like this:
How can i somehow create new repo in bitbucket where I will pulling changes from github and from this repo i can easily pull in Tortiose HG to my working repo?
I do not want to use Github etc, so please do not advice it to me etc just help me with my question. Thank you.
The ideal solution consiste to keep local Mercurial repo, and work only with this local repo to the existing bitbucket Mercurial remote repo.
With a plugin like Hg-Git, you can at least push to and pull from a Git server repository from Mercurial, allowing you to pull from the GitHub repo to your local Mercurial repo.
From that local (Mercurial) repo, you can then work as usual with the bitbucket remote repo.
The OP adds:
It didn't work for me so i tried to transfer git repo to hg repo and from this repo pull to my working repo with changes - but it says that: abort: repository is unrelated - but I merged a lot from it. Any help here?
That makes senses, if both repos have been developed separately, you cannot push/pull 2 (mercurial) repos one into another.
This is confirmed at the bottom of the page "Understanding Mercurial", and detailed in the blog post: "What Mercurial Can't Do: Subtree Repos".
The more practical solution would be to make one extra repository (a "parent one") with your two repos declared in it as nested repository.
It would keep both repos independent, allowing to push back to the GitHub repo from your second mercurial repo.
If you don't have to push back to GitHub, but really want to have one repo in which you merge common files, then you can look in "Merge tip from an unrelated repository with Mercurial", but that is much more complex.
I would rather:
keep both repos separate
delete from the first one the common files you need to merge in the second one.
report and merge those common files in the second one.