Menu
  • HOME
  • TAGS

Getting .hg not found with Mercurial repo

Tag: mercurial,bitbucket

Just the other day I was having some problems with my XCode project so I deleted all of the files in my project directory, downloaded my latest commit from BitBucket, and copied all the files from that directory into my empty project directory. Yes I know this was pretty dumb, but now when I try to make a new commit I get: .hg not found. Is it possible to fix this or have I permanently screwed over my repo?

Best How To :

The whole mercurial repository usually remains in your working folder, right under the sub-folder .hg. I say usually, because by deleting your working folder, you also deleted your repo, so yes, it cannot be found anymore. Simply downloading your latest state does not bring it back.

Don't worry, since you had the whole repo in Bitbucket, you only need to reclone. Make a manual backup of your current changes before doing so, if you don't want to loose them.

How to set up default local push path in Mercurial?

mercurial

You want to use: [paths] default = file:///home/user/myscript/ default-push = file:///home/user/myscript/ ...

Commit and Push Enterprise Application Project into BitBucket

java,git,ejb,bitbucket

You can put all these five projects into a common root directory and use that as your repository. Then you'll have just one repository. Downside is that you cannot have per-project access controls.

Rubyonrails cloud9 to bitbucket to heroku update

ruby-on-rails,heroku,bitbucket,cloud9-ide

Assuming you have a bitbucket repository set up and reflecting your production code, you should generally be doing the following: git checkout -b new-feature # create repository branch `new-feature` to do more work ... make a bunch of changes and test them ... git add -A # add all of...

Mount Github link as docker volume

github,docker,bitbucket

You cannot mount such remote resources that are on the Internet. What you can do is to have a shell script in your docker image which when executed will download those resources. And make docker run that script when the container is run. Dockerfile FROM ubuntu:latest COPY download-from-github.sh / #...

Change upstream of local (hg-git) clone from (github) original to fork

github,mercurial,hg-git

You need to push via ssh, meaning you need to push via: hg push git+ssh://[email protected]/<login>/<repo> Note the usage of [email protected] instead of your login in the first part of the URL. This actually matters; the server will figure out your credentials via the supplied SSH key. You may also have...

Is there a mercurial command which can generate a clone without largefiles?

python,mercurial,large-files

Simply use hg lfconvert --to-normal <old> <new> This will convert the repository in directory <old> to a repository in directory <new> with all large files turned back into normal files. Revision hashes will change, but otherwise, the revision history should remain intact. If you actually want to first strip all...

Remove deployment key from Bitbucket

git,bitbucket,ssh-keys,public-key

No, deleting the team is unnecessary. This page seems to have settings for your team SSH keys (fill in your team name) https://bitbucket.org/account/user/your_team_name/ssh-keys/ You should be able to delete the key on that page....

How can I use a Maven project as a dependency to another Maven project?

java,maven,mercurial

A general advice when using Maven is to use a Maven Repository Manager such as Nexus. In this case Nexus has the addtional benefit that it can host your jars. So I advice to do the following: Configure a CI (e.g. Jenkins) job to build projectA and deploy the JAR...

Extended description text on Git

git,bitbucket

There is no "extended description" concept in git. Only the commit message. What happens is that the commit message can have a single line or multiple lines. External tools or websites such as git-cola or GitHub can interpret multiple lines commit messages as: The first line is a short description...

Making local copy of git branch current

git,branch,bitbucket

Just do: git fetch git checkout rogersbranch git merge 2.0BranchName ...

Capistrano deploy with bitbucket - Permission denied (publickey)

git,ssh,bitbucket

Have you run the ssh -T [email protected] command on the remote server, and confirmed it there? I've just checked a Linux server I deploy onto with Capistrano, and bitbucket.org is listed in the deploying user's .ssh/known_hosts files (it's hashed, but ssh-keygen -F bitbucket.org shows it). Capistrano SSHes into the remote...

git - put files back under version control

git,version-control,bitbucket

Create a backup directory on your Server. git clone your repository in that backup directory. Copy the files from Server directory to the backup directory. Swap original server directory with the backup directory....

Installing SSH in Ubuntu 14.04 for Bitbucket

ubuntu,ssh,bitbucket

This should probably be posted to Superuser rather than Stackoverflow. However, there is a distinction between openssh-server and the SSH client. The latter is included with Ubuntu by default, the server may not be. If you want to connect to an SSH Server, you do not need openssh-server to be...

import project from git is missing manifest file

android,git,bitbucket

I always try not to use the IDE. So try using the command line. Simply git clone <repo> the repo Then, in Intellij/Android Studio, File -> Import Project -> Select the build.gradle ...

Searching for the change history of partial file or path in Mercurial or TortoiseHg

mercurial,tortoisehg,file-search

I can very much advise using the hg help system for this. The most useful pages to look at (in my view): hg help revsets hg help filesets hg help patterns In the page about patterns, you can find about 'path:': To use a plain path name without any pattern...

ignore certain mercurial commands in mercurial hook

python,mercurial,hook

Unfortunately the answer seems to be no. I just debugged into the hook mechanism of hg 3.1, and the information about which command was issued is not propagated into the hook function. The only way I can think of is to hack something ugly with the debugger api to extract...

Mercurial - abandoning loose ends

version-control,mercurial,branch,tortoisehg,branching-and-merging

With TortoiseHg, enable either the strip or mq extension via File, Settings, global settings tab, Extensions. Then right-click the obsolete changeset, Modify History, Strip... will remove the changeset, assuming it hasn't been pushed yet.

Automating access to Bitbucket private repo

git,bitbucket

Without seeing your git pull command, I assume you are using git clone https://[email protected]/someone/repo.git - this uses basic authentication over https not ssh keys. Using https to access a repo requires a username/password. In order to use ssh key auth, you have to use ssh for your repo access with...

How to get rid of .ignore file in Git?

git,file,bitbucket,ignore

.gitignore is just like any other file under version control, so yes, you can delete it. However, keep in mind that it probably has entries in it that should be kept, so instead of deleting it, I would just modify it so that your jar files are no longer ignored.

changing remote url for BitBucket in Microsoft GIT provider

visual-studio-2013,bitbucket

I've found the solution! There is a hidden folder named .git in your project root folder. Into this folder there is file called config. You can open it with any text editor, such as notepad++ and edit the line which specifies the remote URL for this repository. The setting I...

How to use Pull Request properly ? (git / bitbucket)

git,bitbucket

If you want the reviewer to look at each feature separately, you are probably better off creating one pull request for each feature. If on the other hand you want them to look at all your changes simultaneously, then you might as well create one big pull request. In the...

Berkshelf vendoring of cookbook on private Bitbucket repository

git,ssh,vagrant,bitbucket,berkshelf

Here are a couple of suggestions: Make sure that the environment variable HOME is set to C:\Users\MyUser when you are running the berks command. Use a full path for the private key Host mycompany HostName bitbucket.org IdentityFile /C/User/MyUser/.ssh/mykey.ppk try and use rsa keys instead of private putty keys (ppk) ssh-keygen...

Best way to use multiple accounts on Bitbucket from my laptop

git,ssh,bitbucket

Your config file has the same name in both Host: "bitbucket.org". You need to give a different name to each one, and then adjust your git remote url accordingly. For example: Host bitbucket.org User git Hostname bitbucket.org PreferredAuthentications publickey IdentityFile ~/.ssh/myaccount1 Host othername User git Hostname bitbucket.org PreferredAuthentications publickey IdentityFile...

Git - folder not pushed to repo

git,bitbucket

Those are submodule entries. They are called gitlink, special entries in the index of the pushed repo. A submodule is made to record a specific SHA1 of a subrepo: see "git submodule checks out the same commit". If a .gitmodule is no longer in the repo, then those gitlinks need...

Mercurial - merging last three unpushed commits

version-control,merge,mercurial,commit,tortoisehg

You can use the 'histedit' extension for this. To activate it, add the following to your hgrc: [extensions] histedit = If these are the only unpushed changesets, you can use hg histedit --outgoing. Once in the histedit interface, 'fold' will be a useful action for you (it allows combining your...

Git change filename has caused it to be not tracked

ruby-on-rails,ruby,osx,git,bitbucket

When installing OSX, you have the choice of formatting your drive as case-sensitive or case insensitive. It sounds like yours is case-sensitive (capitalization matters). The thing with git is that to do a file rename, you have to do it with git. If you rename the file through your text...

Mercurial: are pre-commit hooks run for other committing commands than “hg ci”

mercurial

Yes they do run for these operations: they run for every commit created on the local repo. You can convince yourself that they run with a simple test like: hg graft 10 --config hooks.precommit="echo 'hook ran'" It will print hook ran when the hook is called...

Mercurial revset selecting up to a bookmark

mercurial,mercurial-revsets

I'm not entirely clear whether you want to squash C and D, creating a new commit C', or whether you want to squash B, C, and D, creating a new commit B', which will keep the original bookmark. For the first: hg rebase -s 'children(bookmark)' -d bookmark --collapse -m <msg>...

How can I repair a repository broken by hg unshelve?

mercurial,unshelve

The following steps solved the problems for me: Use hg debugsetparents to replace the corrupted parent revision number 893e15ecb5b4 with the correct one I had updated to before using unshelve Because the above had left me in a state where Mercurial had forgotten all local changes, I had to use...

Simple php post hook on Bitbucket doesn't work

php,bitbucket,webhooks

Check user Please check if the webserver user is really apache. <?php echo exec('whoami'); ?> If it is not, check that the user have enough permissions. SSH keys Are the SSH keys for Bitbucket (deployment keys) available or are you using only key forwarding via SSH? Check output Please check...

How to merge uncommitted changes in files from one local branch to another using mercurial

mercurial

Since you stated the files were only changed locally, the following assumes the files were new files: hg add fileone.java filetwo.java hg commit -m "mini-feature" hg push This will leave filethree.java uncommitted in the working directory. Instead, if you made modifications to files already committed to the repository: hg commit...

What's the use of Pull Request? And how to use Bitbucket properly?

git,bitbucket,atlassian-sourcetree

2) A pull request is a message that says "hey, I have some stuff to share, please pull from my repository." That's all there is to it. PR's used to be just e-mail messages. Websites like github and bitbucket made it into a "feature" with a button. The concept of...

Why these commands in mercurial create a new head?

version-control,mercurial

Steps 1-5 leave the main and first repositories in the following state, assuming a r1-r3 was the original state of main: Main: r1--r2--r3 First: r1--r2--r3--r4 Steps 6-11 copy first to second, commit something to second, and push it back to main: Main: r1--r2--r3--r4--r5 First: r1--r2--r3--r4 Second: r1--r2--r3--r4--r5 Steps 12-15 go...

Deploy bitbucket public repo as application dependancy through composer on Heroku

git,heroku,composer-php,bitbucket

At last, I am able to fix problem. Actually it was SSH Keys issue as mentioned by @HonzaHaering in comment. I thought it will be useful for someone to add solution here. First check do you have any SSH-Key on Heroku by: ls ~/.ssh/id_rsa If you don't have key then...

Bitbucket doesn't recognize my Swift project

ios,swift,bitbucket

Bitbucket doesn't have a default logo for swift project, you can set the language and logo on the repository settings.

How to pull from an origin and merger to a different one?

git,bitbucket,acquia

You can keep things in sync with a simple git pull bitbucket git push origin This pulls the latest changes from one remote repository and applies them to the other....

Cut off the “desc” at N characters in hg log output with templates

mercurial,hg-log

You can use regular expressions and the sub() function to accomplish that. For example: hg log --template '{sub("^(.{0,50})(.|\n)*","\\1",desc)}\n' The sub() function takes three arguments, the pattern, the replacement, and the string to be processed. In this example, we use a group that captures anywhere from 0 to 50 characters (except...

When does a new head is created in a repository?

mercurial

A new head can be created in three ways: * when you need to use --force on the push command, a new head is created on the repository you push to. Hint: Do never use --force (or its equivalent -f) with push when you do not have to * when...

Hg Mercurial - Upgrading code not in repository

version-control,merge,mercurial,tortoisehg

Doing the merge vice versa (your changes into v3.6 might work better. Also make sure that you have selected a reasonable merge tool (internal works, but there are possibly more convenient ones out there, I use kdiff3 myself): I assume you have a repository with v3.5 and on top of...

cloning a private bitbucket repository given access to me

git,clone,bitbucket

When cloning a git project you can either use SSH or HTTP protocols. See the documentation: You can use either secure hypertext transport protocol (HTTPS) or secure shell (SSH) to connect to Bitbucket. HTTPS requires you to enter a username/password each time you connect to the Bitbucket server, for example,...

Phantom Mercurial, How to remove?

ubuntu,installation,mercurial,tortoisehg

You can find out where in your path an application exists using the type command like this (when using bash): [email protected]:~$ type -a hg hg is /usr/local/bin/hg It's possible it was installed as a python package in which case the command would be: pip uninstall mercurial but it might just...

Need help merging changes into a git repo

git,bitbucket

So funny thing, i was able to solve it myself. cp is unable to copy subdirectories. i needed to cd to the production directory and copy the files from there. cd production && cp -rfHip .git ../dev/.git && cd ../dev && git add -A && git commit -a...

How to do hg revert --all with git?

git,mercurial

git read-tree -um @ $thatcommit will do it. That's "transition the index and worktree from the HEAD aka @ commit to $thatcommit, as for checkout (but without touching HEAD)". When what you're doing isn't a good match for any of the convenience commands, the core commands have your back :-)...

How do I make a revset alias for tags whose names follow a pattern?

mercurial,mercurial-revsets

I tested the following that works: new($1, $2) = (::"version-" ## $2) - (::"version-" ## $1) For reference $1::$2 won't give you the same thing, it means the revision between $1 and $2 An equivalent revset that I would prefer is: new($1, $2) = only("version-" ## $2, "version-" ## $1)...

Keep getting 'Partial Merge Commit' Dialog

git,phpstorm,bitbucket

Partial commit during a merge is not allowed. You're in the middle of a merge process. You cannot commit just some files. A merge needs all files to be commited. If you want to stop the merge Option 1. git stash save git merge --abort Option 2. If you...

Remove folder in bitbucket

java,git,bitbucket

If eclipse did rename your package, that means you should not have anymore your old folder representing the old package. Switch to the command line, and confirm that with git status: it should show you that old package as deleted. If so: cd /path/to/your/project/src git add -A . git commit...

BitBucket - submodule not download when using git clone

git,bitbucket

It means the submodule references a SHA1 of another repo. That is the SHA1 you see after the arrow. This is a special entry in the index, called gitlink. You can see those in the question "Bitbucket submodules wont delete". When you clone a repo with submodule, you need to...

How to automate deployment of source & compiled code (excluding git history) to third-party developers?

git,deployment,continuous-integration,bitbucket

Sounds like you want to write some post-commit hook. But that might be too fine grained for you. Just write the automatic steps to .git/hooks/post-commit and make that executable. You can git --work-tree PATH_FOR_THIRD_PARTY checkout HEAD -- PUBLIC_FILES to update the PUBLIC_FILES for your third-party developers in PATH_FOR_THIRD_PARTY, where I...

How to remove a branch merged with develop in bitbucket git?

git,bitbucket,tortoisegit

If you want to remove commits coming from a merged branch, there is a brilliant answer here: Undo a Git merge? It is not possible to undo a merge in Bitbucket's interface, and as far as I know Tortoise does not support that either....

Mercurial get branch name by changeset

mercurial,hg-log

That's... not what revsets are for. You want to do something rather different: hg log --rev [changeset] --template "{branch}\n" See hg help templates....