I have a repository, from which a fork was created. Fork is being developed, and the parent repository is forgotten, nothing is changed there for years. At some point we've started to clean up old repositories and found this one. So I want the fork, but I don't need the initial repository. If I delete the repository, the fork will also be deleted. I need some way to transfer a fork into a new repository, if possible.
So, how do I delete the repository and keep a fork and all the commit history from the point it was created?
You can delete the original.
I see that the link was removed, everything else unchanged.
Related
I have a Mercurial repository on BitBucket, and I use SourceTree to keep it synced with my local repository. When I want to make a new branch, what I usually do is create the branch on BitBucket and then open SourceTree and pull the latest changes, and then I update my working repository to the new branch. Then, when the changes are complete I merge the branch into default and push the changes back to BitBucket.
Lately, when I make a new branch on BitBucket and click pull in SourceTree it says there are no changes to be pulled. If I make changes in my local repository and try to push them it says there are no changes to be pushed.
However, if I use the command line interface to pull/push the changes it works correctly. I used this process 5+ times for other branches, and it just now stopped working, as if SourceTree is no longer connected to my BitBucket repository. Does anyone know how I can fix this?
It turns out all I had to do was update to the most up-to-date version of SourceTree.
Edit: I updated from version 2.6.10 to version 3.0.12.
I use two mercurial repositories, one for the current stable version and one for new development. I accidentally developed a new feature inside the current stable repo and now I want to commit the changes to the new dev repo and not to the current stable repo. Is there a way to do this? I have not committed any of my changes yet.
Use
hg diff >changes.patch
To create a patch of your changes. Then, go in the other repo, update where you need your changes to be, and issue
hg import --no-commit changes.patch
With the proper folder to changes.patch You should then be at the same place you were on the other repo, too.
However, if both repos are equivalent, whether you commit and push your changes from the current repo or the other, they could eventually be replicated on both, so think about the necessity of moving the changes across repos. Use branches to handle different feature development.
We have some restrictions on what we are allowed to put in our central Mercurial repository.
Is there some way I can keep stuff in my local Hg repository, without having it pushed to the central one?
Note:
The files might be connected to files in the central repository (branches for example).
Local stuff might later be incorporated in the central repository.
If you're using branches, you can set their visibility to secret. This will prevent them to be pushed.
hg phase --secret --force my-branch
When you want to share, you change their phase to draft and then they will be automatically collected during a push operation.
See hg help phases for more information.
You could also use Mercurial Queues. With MQ, you can work with patches (which are changesets) and update or re-order them based on changes in the official repository. This will also make it easier to incorporate some or all of your changes into the main repository or just discard them later.
Commit to your local repo, then push to the remote repo when you are finished.
You can push to your local repo as well, but from my understanding that is where your current development is?
I think you want Shelve Extension or Attic Extension.
The other option is if your using a newer Hg with better branching you can just fork the central repo somewhere like bitbucket and use that as your repository for your temporary stuff and potentially branch that.
Finally you could also just use .hgignore but that could be problematic later when someone does check in the file with the same name.
I am in the process of setting up some third-party subrepositories under a Mercurial repository. One subrepo is another Mercurial repo hosted on Bitbucket.
Since it is a public repo, and I am not a contributor to it, I don't wish to push back to it. However I would like to still have the repository automatically cloned when I clone the parent repository. For one thing, I'd like to have access to the collective history of the subrepository so I can see what may or may not have changed over time.
So, I made an entry in the parent repo's .hgsub file as follows:
thesubrepo = https://bitbucket.org/user/repo
and cloned the repo using
$ hg clone https://bitbucket.org/user/repo thesubrepo
I made a commit to record the subrepo state. I then went to push my parent repo back to it's server (Kiln) only to discover that it was trying to push the subrepo I back to the Bitbucket server. The push to the Bitbucket subrepository appears to not do anything, though.
I did not observe this behaviour when I made a Git subrepo in the same manner (hosted on Git hub) using an entry in .hgsub like this
abc = [git]git://github.com/xyz/abc
Is it best for me just to do this by not setting up a subrepository, and just let Mercurial store the files as files? Or (preferably) is there some setting somewhere that I can use to tell Mercurial to never actually push the contents of this subrepo back to it's source location?
I'd rather be able to configure it to only push those subrepos manually, so if anyone can shed some light on this, I would appreciate it.
I found a reference to commitsubrepos = no in another stack overflow answer, which as far as i can tell is about commits, and not pushes of sub repositories. I then looked this up on the mercurial website, in the hope there might be some reference to a setting pertaining to pushing subrepos, but... no
You cannot (currently, as of version 2.0) ask Mercurial to not push subrepositories.
The fundamental problem is that Mercurial must ensure that you have a consistent state on the remote repository when you push. It would be unsafe if you could push back to Kiln and then have a changeset there that references a revision on Bitbucket that isn't there. Mercurial doesn't know if a changeset you have locally is published or if you created it — so it has to (try to) push.
We're currently working on a concept called phases. With that in place, Mercurial will begin tracking if a changeset is created locally or already published. That can be used for subrepositories too: if there are only changesets in the "public" phase in a subrepo, then there's no need to try pushing!
I have a large codebase that I have been working on for a while. It is not ready to push live, even experimentally. However, my client is requiring a minor change that I cannot fix without pushing my whole new update (which is not ready). I would like to do the following:
Take a stable changeset (I know which one) and create a codebase that I can then work from in Visual Studio.
Make the (very minor) update
Commit my change
Upload my change to the server
Merge/push my changes
Be able to go on working on my current project with that minor change included
I don't want to screw anything up though. Can anyone offer some advice on how to do this?
Thanks
Sure.
hg clone then hg update <rev> to the stable changeset
Edit the code as needed
hg commit
Upload this version (stable + patch) to the server
hg push to the server (your new patch)
At some point, do hg pull in your main development clone when you don't have any uncommitted changes, then do hg rebase to make Mercurial adjust your main development changesets to come after the patch we made above. The history will then be as if the "hotfix" had been done before you started working on your new development.