TeamCity issue with anonymous branch in Mercurial - version-control

An anonymous branch was created by backing out of a change. This branch was then pushed and is now public. The branch name is just a load of white spaces which I am having trouble referencing.
I have 3 branches, default, rc and stable, and I use TortoiseHg to interface with mercurial.
Every time I try to update to the anonymous branch I get the invalid arguments error. When I try to merge I get an abort: merging with a working directory ancestor has no effect, error. I can update to the 1011 commit which the anonymous branch is on, but I cant see what I can do from there.
Commit history
The image above shows my commit history. In it you can see the anonymous branch, my failed attempt to rebase it (new_for_1008 branch) and my attempt to close both the rebase branch and the anonymous branch. If I attempt to push I get the following error...
hint: merge or see "hg help push" for details about pushing new heads.
The reason this anonymous branch is causing issue is that my VCS connections in team city are getting confused. When I try to run anything link to this repository I get the following error.
Failed for the root '"SITENAME Default" {instance id=301, parent internal id=33, parent id=SITENAME_SITENAMEDefault, description: "mercurial: http://hg/REPONAME"}: java.lang.IllegalArgumentException: Empty branch name
Could anyone let me know where I'm going wrong and what else I could try to remove/rename the anonymous branch. Or if there is something else I could do to fix the VCS connection.
Thanks,

Related

Can't to push commits from local branch to github repository

I was committing and pushing in ordinary for my repository.
but once i used command of git checkout for change to the previous version of my repository.
after that i tried to commit and push, then it can not completed.
i try to use the --no-verify command to push the commit but it also not success.
error: failed to push some refs to 'https://github.com/ruwanliyanage123/Hair-4-U-Hospital.git'
i want to push my commit into github repository
Since you switched to a previous version of your repository, your head is most probably detached. You can't just go back anywhere in your history and make commits.
Consider making a branch from there and then commit to it.
Try to first check in which branch you are working do git branch, check is the one you are working. Then I sometimes do git pull to just make sure that the connection is working this should not delete your progress the you should be able to do git push. If you are afraid youll mess up first do a local back up of all project files except for the .git one which are hidden by default in windows.Lastly I would suggest never posting the actual link to your github repository in case whatever you are working is important, you can just replace with
https://github.com/user/projectname.git

How to merge to a branch that is behind in network in Gitlab?

I am quite new with Gitlab and I'm having an issue for merging in Eclipse.
We're working as a team, and we all have development branches that we are trying to merge into a single one. Unfortunately, when I did my merge, I have done a stupid mistake. Instead of merging my development branch to the main one, I have merged the main one into my development branch.
I have reversed the commit/merge on gitlab, but now as I try to merge back my development branch into the main one on Eclipse, it seems like I am 9 commits ahead of this branch (described as the arrows on Eclipse here: ), so the potential merge would basically replace everything by my code, when I should actually have merge conflicts to solve.
I am not quite sure how to merge properly so that I get back these merge conflicts.
Here is a screenshot of my network:
The ['1'] commit in the network on the left branch (my branch) corresponds to the merge from Week6AllIssues to my dev branch (the wrong merge). The last commit on this left branch is me reversing the commit.
Thanks a lot for your help !
If you're not using the remote branch with anyone else, the following series of steps might help.
First, remove the superfluous commits from the local branch. It can be achieved with git reset --hard <the commit before you merged master into your branch> command (see this link on how to do this with Eclipse).
Now make the remote branch match your local branch. You can do this with git push --force command. In Eclipse, this command corresponds to configure push - enable "force update" option.
Now the superfluous commits are gone.

"push creates new remote head" issue

I read all SO questions about this issue, and I still can't resolve it.
I am using TortoiseHg. I worked on a side-branch, and now I want to merge it back to the main branch. I pulled all changes made in both branches, updated to the main branch, and merged (and committed). But still when I try to push all this, I get the "abort:push creates new remote head" message.
I also tried (as was suggested in one of the questions in SO) to close the branch using the --close-branch option.
The only thing I did not try is to 'force' push.
Any suggestions? Or is force-pushing the only option?
Just for everyone else that runs into this problem.
What caused this problem for me were some local revisions on the default branch that I didn't push before I started to work on a new branch.
I had merged the latest revision I pulled for the default branch with my new branch, but these leaves your local changes to the default branch committed but un-pushed.
If you try to push them, it's not your new branch that is creating a remote head, it's the un-pushed revisions to the default branch that is creating a remote head.
When I stripped out those revision with hg strip -r 1234
hg push --new-branch
went perfect.
What put me on the right track was
hg heads
With showed I had two heads that both had the name of the default branch with different revision numbers.
I just tried a similar setup, and I get the same warning. Apparently, although the second head you are trying to push is closed, it is seen as another head during the push. And closing both heads does not seem to be pushable either.
You can force the push, it should be ok, but you could eventually get the same issue if you keep multiple heads on your visualization branch, like you already have with changesets 14 and 20. To solve the issue once and for all, I would instead suggest to merge both changesets (14 and 20) and reclose the final head.
Thanks for the answers, I definitely learned some new tricks.
What I ended up doing, is cloning an early revision from the remote repository, that is, a repository that doesn't have all the commits of my merges etc. I then pulled the change-sets, merged, and committed. Then the push finally succeeded.
It was basically the same steps I tried to do before, but apparently on the first (unsuccessful) trial I broke it down to more steps than were needed, and something went wrong at some point.
Try this solution,
Assumption. You have enough rights to close and create the branch in the remote
This happens because you are trying to rewrite the history. Just try hg push -f which will create two heads in the remote repo, which you might not
So the first login to your remote and close the branch, now come to your local and push using hg push -f. The necessary new branch will be created automatically with the original condition as it was before.

GitHUB rejected master -> master (non-fast-forward)

This might be recursive and i have seen answers about this questions on other thread here on Stackoverflow.
The reason i am asking is that i dont understand one thing, that when it gives this error, i have seen answers here that tell that it is because that the remote master on Github is no where in my history of master branch on my local repository that is why it gives this error.
I have also seen explanations where it is written that the changes on remote have to be merged locally and then push your changes from local to remote.
So what i have done is that i have created a remote repository on github and am trying to push my changes from eclipse to this remote repository and it throws me this error. Regarding second solution of merging the changes first from remote, but i dont have anything to merge it is a new repository. So why does it throw this error.
This particular error is because the Local Branch is not up to date in order to Push your commit(The remote branch is updated with other commits).
Fetch from the Upstream to sync your Local Branch and the Remote Branch
Pull the changes
Then Push your commits which will be fast forward without any conflicts

can't push upstream using EGit

I use EGit in eclipse to pull and push.
my config is:
[remote "origin"]
fetch = refs/heads/*:refs/remotes/origin/*
push = refs/heads/*:refs/remotes/origin/*
local branch is master
Remote Tracking branch is origin/master
when I do push, it comes out "origin/master:master[up to date]". Actually the remote branch is not up to date. I wander if I configure the wrong way.
Sometimes I change different configure, I will get either "create a new branch"(which is wrong, as I just push some commits) or "reject-no fast forward"(which is strange, as I am the only user of the remote repository and I have already fetch before push)
Check with Egit if you aren't in a detached HEAD mode:
If HEAD is "detached", i.e. is not pointing to the tip of a local branch but to a commit or tag, then none or several "checked-out" markers may appear in the tree, since any number of remote branch or tags may point to the currently checked out commit.
The state you are in while your HEAD is detached is not recorded by any branch (which is natural --- you are not on any branch).
(See "Why did git detach my head?" for probable cause, and "Git: How can I reconcile detached HEAD with master/origin?" for reconciliation).
That is a common cause for an "up to date" message when pushing to a remote repo.
After I push to upstream successfully, like version 0.3.9, I continue to change my codes locally and submit a version 0.5.0. This submit should based on version 0.3.9. I don't know why. That's why I have to do merge every time, and sometimes merge make my codes messy.