I performed a histedit fold on my local repo after which I tried pushing the changes to Bitbucket, but the push fails with the message:
remote has heads on branch 'default' that are not known locally
abort: push creates new remote head
(pull and merge or see 'hg help push' for details about pushing new heads)
How do I go about doing a fold on the remote repo without running into this problem?
Related
MacOs Yosemite
I try clone repository with sourcetree. It began cloning but through some minutes it show me alert "Confirm Delete Repository" with text "You opted to delete repositories on disk but the repository "(null)" contains uncommitted files which will be lost forever if you delete this repository. Are you sure you want to delete the repository on disk?" So i can't clone
I try clone with terminal. After cloning terminal write message: "remote: Connection to bitbucket.org closed by remote host." But it's not clong all my repository and subrepository.
How I can get repository from bitbucket? I have 2 repositories, that I cloning 2-3 monthes ago on my macbook, and it was all good. Repository is cloned on my work under my account too without problems. But now I try get 2 new repositories on my mac, and I have same issues, that I described
In sourcetree I got such error:
hg clone ssh://hg#bitbucket.org/{my_repository}
requesting all changes
adding changesets
adding manifests
adding file changes
added 19 changesets with 115 changes to 58 files
updating to branch default
cloning subrepo framework from ssh://hg#bitbucket.org/{my_repository}
requesting all changes
adding changesets
adding manifests
adding file changes
added 1004 changesets with 4877 changes to 2384 files (+3 heads)
remote: Connection to bitbucket.org closed by remote host.
Completed with errors, see above
how can I reset my local repository, to the state of remote one?
I have commited local changes (didn't push).
I want to delete all the differencies.
There are several options:
Make a new clone of the remote repo and throw away the old clone.
Make a new clone of the local repo, but limit it to the last revision in the remote. (e.g. hg clone -r <last remote changeset> <local_repo_old> <local_repo_new>).
Use the hg strip command from the mq extension to remove the changesets from your local repo
NOTE: When trying options 2 or 3, you can use the hg outgoing command to see which changesets have not yet been pushed to the remote repo.
I have recently added several projects to an existing repository on my local dev box. I periodically synchronize the local repository to a network drive repository. However, the new projects do not automatically show up on the network repo---only the ones that were there when I performed the initial clone.
How do I get the new projects into my network repo?
You use the 'hg push' command to push changesets from local to remote and use 'hg pull' to pull changesets from remote to local.
Moving the changesets over is sufficient to get the contents there, but if you want to see them in the working directory you hg update.
Also it sounds like you have multiple projects in a single repo. That's the normal setup in subversion, but in Mercurial or git you want separate repositories per project. It's better that way because all changesets/commits span the entire repo and it's not possible to hg update or hg clone only a portion of the repo like it is with svn.
Here is what I did:
Cloned a remote repository to my local computer. Created a second clone from the first clone. Made changes in the second clone. Never touched anything that resides in the first clone.
Now what happens if I directly push to remote repo from the second clone? A new branch is introduced in the remote repo?
Maybe a stupid question but I can't test it because there are other developers working on the code and I don't want to mess anything.
Thanks.
Now what happens if I directly push to remote repo from the second clone? A new branch is introduced in the remote repo?
What you would want to do in this situation is clone the central repo again (in case any other programmers made changes) merge your changes with those, and then push that back to the central repo.
This ensures that your branch is now part of the main branch again.
Metropolis
EDIT
Maybe this will be a little more clear
Clone repo1 to your machine
Make a clone of repo1 on your machine to keep the original in tact
Make changes to repo2 on your machine
Pull changes from repo2 to repo1, merge (if needed)
Clone CR again (in case other programmers made changes)
Pull changes from repo1 to the newly cloned repo (merge if needed)
Push newly cloned repo back to CR
Clone CR again and remove all of your repos to get the newest copy
I'm new to Mercurial.
I initialized a Mercurial project on Machine A, committed my changes and uploaded them to a remote repository.
Then I cloned that repository on Machine B, committed some additional changes and uploaded them to the same remote repository.
In both cases, I uploaded the changes with the same command:
hg push https://username:password#domain/user/repository/
Now I'm back on Machine A and I'm not sure how to update my local repository with the last changes I uploaded to the remote repository from Machine B.
The commands hg clone or hg pull look like they might work but I'm not sure.
Would appreciate any guidance. Thanks.
hg pull will transfer any remote changesets not present in your local repo. Afterwards, you'll need to either hg update or hg merge depending on the presence of local changes.
Use hg pull; pull transfers only changesets which are missing in the existing destination repository.
hg clone creates local copy of a remote repository.
See also this so question.