QuestionId
stringlengths
3
8
QuestionTitle
stringlengths
15
149
QuestionScore
int64
1
27.2k
QuestionCreatedUtc
stringdate
2008-08-01 18:33:08
2025-06-16 04:59:48
QuestionBodyHtml
stringlengths
40
28.2k
QuestionViewCount
int64
78
16.5M
QuestionOwnerUserId
float64
4
25.2M
QuestionLastActivityUtc
stringdate
2008-09-08 19:26:01
2026-01-24 22:40:25
AcceptedAnswerId
int64
266
79.7M
AnswerScore
int64
2
30.1k
AnswerCreatedUtc
stringdate
2008-08-01 23:40:28
2025-06-16 05:23:39
AnswerOwnerUserId
float64
1
29.5M
AnswerLastActivityUtc
stringdate
2008-08-01 23:40:28
2026-01-23 17:46:09
QuestionLink
stringlengths
31
36
AnswerLink
stringlengths
31
36
AnswerBodyHtml
stringlengths
35
33k
AnswerBodyPreview
stringlengths
35
400
AllTagIdsCsv
stringlengths
2
37
AllTagNamesCsv
stringlengths
2
106
MergedQuestion
stringlengths
74
28.4k
quality_filter
stringclasses
10 values
unique_id
int64
0
29k
tag_major_lang
stringclasses
10 values
MergedQuestion_md
stringlengths
60
28.1k
AnswerBodyHtml_md
stringlengths
14
29.2k
12425500
git: how to sync to latest revision
6
2012-09-14 13:23:45
<p>Warning: git novice here.</p> <p>I have downloaded the source code of an open-source project (ffmpeg, to be exact) using git (<code>git clone</code>). I checked out an older revision in order to do test it (<code>git checkout [version number]</code>), and git told me that I'm now in a detached HEAD state. Now I wan...
24,294
470,994
2012-09-14 13:30:25
12,425,611
11
2012-09-14 13:30:25
877,115
2012-09-14 13:30:25
https://stackoverflow.com/q/12425500
https://stackoverflow.com/a/12425611
<blockquote> <p>I don't want to create any local branches.</p> </blockquote> <p>Sure you do. You just want a "local tracking branch", which is a branch that tracks a remote branch, making it easy to stay up to date with the project.</p> <p>Try this:</p> <pre><code>git checkout master ;# you should have a 'master' ...
<blockquote> <p>I don't want to create any local branches.</p> </blockquote> <p>Sure you do. You just want a "local tracking branch", which is a branch that tracks a remote branch, making it easy to stay up to date with the project.</p> <p>Try this:</p> <pre><code>git checkout master ;# you should have a 'master' ...
119
git
<h1>git: how to sync to latest revision</h1> <p>Warning: git novice here.</p> <p>I have downloaded the source code of an open-source project (ffmpeg, to be exact) using git (<code>git clone</code>). I checked out an older revision in order to do test it (<code>git checkout [version number]</code>), and git told me tha...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,760
git
# git: how to sync to latest revision Warning: git novice here. I have downloaded the source code of an open-source project (ffmpeg, to be exact) using git (`git clone`). I checked out an older revision in order to do test it (`git checkout [version number]`), and git told me that I'm now in a detached HEAD state. No...
> I don't want to create any local branches. Sure you do. You just want a "local tracking branch", which is a branch that tracks a remote branch, making it easy to stay up to date with the project. Try this: ``` git checkout master ;# you should have a 'master' branch by default git pull ;# to get the newest changes...
12341665
Git new file appears in all branches
6
2012-09-09 18:20:07
<p>I thought a file created on one branch will not appear in any other branches until I merge or rebase the branch?</p> <p><strong>Example:</strong></p> <p>I have two branches:</p> <ol> <li>master</li> <li>new_contact_page</li> </ol> <p>I checkout the <strong>new_contact_page</strong> branch.</p> <pre><code>$ git ...
1,892
1,001,938
2012-09-10 06:39:17
12,341,681
11
2012-09-09 18:21:56
34,397
2012-09-09 18:21:56
https://stackoverflow.com/q/12341665
https://stackoverflow.com/a/12341681
<p>Git will never touch any files that aren't actually in your repository. (untracked files) </p> <p>You need to <code>git add</code> and <code>git commit</code> the file (into one branch) first.</p>
<p>Git will never touch any files that aren't actually in your repository. (untracked files) </p> <p>You need to <code>git add</code> and <code>git commit</code> the file (into one branch) first.</p>
119, 717, 1879, 5597, 8974
branch, commit, git, merge, rebase
<h1>Git new file appears in all branches</h1> <p>I thought a file created on one branch will not appear in any other branches until I merge or rebase the branch?</p> <p><strong>Example:</strong></p> <p>I have two branches:</p> <ol> <li>master</li> <li>new_contact_page</li> </ol> <p>I checkout the <strong>new_contac...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,761
git
# Git new file appears in all branches I thought a file created on one branch will not appear in any other branches until I merge or rebase the branch? **Example:** I have two branches: 1. master 2. new_contact_page I checkout the **new_contact_page** branch. ``` $ git checkout new_contact_page ``` Then I create...
Git will never touch any files that aren't actually in your repository. (untracked files) You need to `git add` and `git commit` the file (into one branch) first.
11954635
git rebase to remove a commit
6
2012-08-14 14:33:13
<p>I have the following change history in my git repository:</p> <pre><code>---X---Y---Z---A---B---C </code></pre> <p>I began working from a base of code Z and made three changes A, B and C. Each of these changes has been uploaded as separate reviews on Gerrit and each depends on the change before it.</p> <p>Followi...
13,104
1,474,886
2012-08-27 14:29:14
11,955,118
11
2012-08-14 14:56:59
1,474,886
2012-08-16 08:33:57
https://stackoverflow.com/q/11954635
https://stackoverflow.com/a/11955118
<p>The following steps have now worked for me:</p> <ol> <li><p>Use git rebase -i HEAD~3 to show the last three commits. This shows the file contents:</p> <p><code>pick 1234567 Commit A message</code><br> <code>pick 1a2b3c4 Commit B message</code><br> <code>pick abcdefg Commit C message</code></p></li> <li><p>I can th...
<p>The following steps have now worked for me:</p> <ol> <li><p>Use git rebase -i HEAD~3 to show the last three commits. This shows the file contents:</p> <p><code>pick 1234567 Commit A message</code><br> <code>pick 1a2b3c4 Commit B message</code><br> <code>pick abcdefg Commit C message</code></p></li> <li><p>I can th...
119, 7330, 52272
gerrit, git, repository
<h1>git rebase to remove a commit</h1> <p>I have the following change history in my git repository:</p> <pre><code>---X---Y---Z---A---B---C </code></pre> <p>I began working from a base of code Z and made three changes A, B and C. Each of these changes has been uploaded as separate reviews on Gerrit and each depends o...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,762
git
# git rebase to remove a commit I have the following change history in my git repository: ``` ---X---Y---Z---A---B---C ``` I began working from a base of code Z and made three changes A, B and C. Each of these changes has been uploaded as separate reviews on Gerrit and each depends on the change before it. Followin...
The following steps have now worked for me: 1. Use git rebase -i HEAD~3 to show the last three commits. This shows the file contents: `pick 1234567 Commit A message` `pick 1a2b3c4 Commit B message` `pick abcdefg Commit C message` 2. I can then delete the first line and save the file to remove the first c...
11834305
What does it mean that a Git push can not be fast foward merged?
6
2012-08-06 19:06:29
<p>Can someone please provide a simple example of what would cause a Git push to a central repo to fail because a fast forward could not occur? What would the local repo vs the central repo's state need to look like in order for this to occur? Really having trouble visualizing this... </p>
541
203,802
2012-08-06 22:25:17
11,835,258
11
2012-08-06 20:15:41
77,567
2012-08-06 22:25:17
https://stackoverflow.com/q/11834305
https://stackoverflow.com/a/11835258
<p>I assume you're seeing this problem:</p> <pre><code> ! [rejected] master -&gt; master (non-fast-forward) error: failed to push some refs to '/Users/mayoff/t/test/central' To prevent you from losing history, non-fast-forward updates were rejected Merge the remote changes (e.g. 'git pull') before pushing again...
<p>I assume you're seeing this problem:</p> <pre><code> ! [rejected] master -&gt; master (non-fast-forward) error: failed to push some refs to '/Users/mayoff/t/test/central' To prevent you from losing history, non-fast-forward updates were rejected Merge the remote changes (e.g. 'git pull') before pushing again...
119, 717, 28897, 52842
fast-forward, git, git-merge, merge
<h1>What does it mean that a Git push can not be fast foward merged?</h1> <p>Can someone please provide a simple example of what would cause a Git push to a central repo to fail because a fast forward could not occur? What would the local repo vs the central repo's state need to look like in order for this to occur? Re...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,763
git
# What does it mean that a Git push can not be fast foward merged? Can someone please provide a simple example of what would cause a Git push to a central repo to fail because a fast forward could not occur? What would the local repo vs the central repo's state need to look like in order for this to occur? Really havi...
I assume you're seeing this problem: ``` ! [rejected] master -> master (non-fast-forward) error: failed to push some refs to '/Users/mayoff/t/test/central' To prevent you from losing history, non-fast-forward updates were rejected Merge the remote changes (e.g. 'git pull') before pushing again. See the 'Note ...
9400474
heroku + git submodule needs authentication
6
2012-02-22 18:08:47
<p>We are using gitolite to manage our repositories and one of our heroku project's have git submodules. Is there a way to get Heroku's public key for the authentication?</p> <p>Thanks, David</p>
5,751
464,811
2016-12-21 14:27:17
10,111,002
11
2012-04-11 17:32:15
687,783
2012-04-11 17:32:15
https://stackoverflow.com/q/9400474
https://stackoverflow.com/a/10111002
<p>No, probably not. Instead, you can use HTTPS basic authentication when you create the submodule in your git repository, <a href="https://stackoverflow.com/a/8949955/687783">similar to deploying private gems to Heroku</a>. Looks something like this:</p> <pre><code>git submodule add https://username:password@github.c...
<p>No, probably not. Instead, you can use HTTPS basic authentication when you create the submodule in your git repository, <a href="https://stackoverflow.com/a/8949955/687783">similar to deploying private gems to Heroku</a>. Looks something like this:</p> <pre><code>git submodule add https://username:password@github.c...
119, 8279, 39151
git, gitolite, heroku
<h1>heroku + git submodule needs authentication</h1> <p>We are using gitolite to manage our repositories and one of our heroku project's have git submodules. Is there a way to get Heroku's public key for the authentication?</p> <p>Thanks, David</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,764
git
# heroku + git submodule needs authentication We are using gitolite to manage our repositories and one of our heroku project's have git submodules. Is there a way to get Heroku's public key for the authentication? Thanks, David
No, probably not. Instead, you can use HTTPS basic authentication when you create the submodule in your git repository, [similar to deploying private gems to Heroku](https://stackoverflow.com/a/8949955/687783). Looks something like this: ``` git submodule add https://username:password@github.com/username/repo.git ```
9994820
Improving speed of checkout from git (from github)
6
2012-04-03 13:57:29
<p>I'm using git and TeamCity v6.0 in a Windows environment. </p> <p>I have just switched over from server side checkouts to checkout on agents because of IO issues, however...</p> <p>Initial checkout has become exceeding slow from ~ a minute to >45 minutes. Once the repo is cloned everything is OK. Is there some con...
5,670
592,308
2014-07-03 08:28:52
9,998,964
11
2012-04-03 18:13:50
374,356
2012-04-03 18:13:50
https://stackoverflow.com/q/9994820
https://stackoverflow.com/a/9998964
<p>One thing that can cause a slowdown is java ssh implementation used with agent-side checkout, to turn it off set an <a href="http://confluence.jetbrains.net/display/TCD65/Build+Agent+Configuration" rel="noreferrer">agent property</a> <code>teamcity.git.use.native.ssh=true</code>. </p> <p>Also you can set an agent p...
<p>One thing that can cause a slowdown is java ssh implementation used with agent-side checkout, to turn it off set an <a href="http://confluence.jetbrains.net/display/TCD65/Build+Agent+Configuration" rel="noreferrer">agent property</a> <code>teamcity.git.use.native.ssh=true</code>. </p> <p>Also you can set an agent p...
119, 604, 104996
git, teamcity, teamcity-6
<h1>Improving speed of checkout from git (from github)</h1> <p>I'm using git and TeamCity v6.0 in a Windows environment. </p> <p>I have just switched over from server side checkouts to checkout on agents because of IO issues, however...</p> <p>Initial checkout has become exceeding slow from ~ a minute to >45 minutes....
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,765
git
# Improving speed of checkout from git (from github) I'm using git and TeamCity v6.0 in a Windows environment. I have just switched over from server side checkouts to checkout on agents because of IO issues, however... Initial checkout has become exceeding slow from ~ a minute to >45 minutes. Once the repo is cloned...
One thing that can cause a slowdown is java ssh implementation used with agent-side checkout, to turn it off set an [agent property](http://confluence.jetbrains.net/display/TCD65/Build+Agent+Configuration) `teamcity.git.use.native.ssh=true`. Also you can set an agent property `teamcity.git.use.local.mirrors=true`, in ...
7033991
Gitolite access repair
6
2011-08-11 23:07:31
<p>I have set up gitolite on my linux server and added my laptop to the gitolite-admin repository. I was forced to format my laptop (bad hard drive) so I need to figure out a way to regain access to my other repositories gitolite controls. It's worth mentioning, I have root access on my linux server, if that helps. ...
3,059
194,261
2013-04-16 10:53:17
7,035,985
11
2011-08-12 05:35:58
193,688
2012-01-10 19:19:33
https://stackoverflow.com/q/7033991
https://stackoverflow.com/a/7035985
<p>If you have version 2.0.3 or later installed, you can use the <code>gl-admin-push</code> command to push from a local clone of the admin repository:</p> <p>See <a href="http://sitaramc.github.com/gitolite/adminpush.html" rel="noreferrer">gl-admin-push: bypassing gitolite for the gitolite-admin repo </a>:</p> <ul> ...
<p>If you have version 2.0.3 or later installed, you can use the <code>gl-admin-push</code> command to push from a local clone of the admin repository:</p> <p>See <a href="http://sitaramc.github.com/gitolite/adminpush.html" rel="noreferrer">gl-admin-push: bypassing gitolite for the gitolite-admin repo </a>:</p> <ul> ...
58, 119, 549, 39151
git, gitolite, linux, ubuntu
<h1>Gitolite access repair</h1> <p>I have set up gitolite on my linux server and added my laptop to the gitolite-admin repository. I was forced to format my laptop (bad hard drive) so I need to figure out a way to regain access to my other repositories gitolite controls. It's worth mentioning, I have root access on m...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,766
git
# Gitolite access repair I have set up gitolite on my linux server and added my laptop to the gitolite-admin repository. I was forced to format my laptop (bad hard drive) so I need to figure out a way to regain access to my other repositories gitolite controls. It's worth mentioning, I have root access on my linux ser...
If you have version 2.0.3 or later installed, you can use the `gl-admin-push` command to push from a local clone of the admin repository: See [gl-admin-push: bypassing gitolite for the gitolite-admin repo](http://sitaramc.github.com/gitolite/adminpush.html) : - `su` to your Gitolite user - `cd /tmp && git clone ~/rep...
6498292
Git: How to rollback/undo a change to an image?
6
2011-06-27 20:04:09
<p>So our designer made some changes to some images, and committed the changes. So now our <code>git log</code> looks something like this:</p> <pre><code>Commit 1: Changed images Commit 2: Oops, forgot to commit a few images </code></pre> <p>...then the business wanted them to look different, so the designer changed ...
3,237
48,523
2011-06-27 20:14:39
6,498,409
11
2011-06-27 20:14:39
335,415
2011-06-27 20:14:39
https://stackoverflow.com/q/6498292
https://stackoverflow.com/a/6498409
<p>What you want to do is check the file out from an old commit.</p> <p>It'll look like:</p> <pre><code>git checkout &lt;commit 1 refspec&gt; imagefilename.png </code></pre> <p>that commit refspec might be HEAD{4} or might be a SHA or maybe a tag.... Something that refers to that commit. Then it'll be sitting in you...
<p>What you want to do is check the file out from an old commit.</p> <p>It'll look like:</p> <pre><code>git checkout &lt;commit 1 refspec&gt; imagefilename.png </code></pre> <p>that commit refspec might be HEAD{4} or might be a SHA or maybe a tag.... Something that refers to that commit. Then it'll be sitting in you...
119, 34403
git, git-revert
<h1>Git: How to rollback/undo a change to an image?</h1> <p>So our designer made some changes to some images, and committed the changes. So now our <code>git log</code> looks something like this:</p> <pre><code>Commit 1: Changed images Commit 2: Oops, forgot to commit a few images </code></pre> <p>...then the busines...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,767
git
# Git: How to rollback/undo a change to an image? So our designer made some changes to some images, and committed the changes. So now our `git log` looks something like this: ``` Commit 1: Changed images Commit 2: Oops, forgot to commit a few images ``` ...then the business wanted them to look different, so the desi...
What you want to do is check the file out from an old commit. It'll look like: ``` git checkout <commit 1 refspec> imagefilename.png ``` that commit refspec might be HEAD{4} or might be a SHA or maybe a tag.... Something that refers to that commit. Then it'll be sitting in your working directory as a change to add a...
5270243
How to setup gitattributes to filter part of a file?
6
2011-03-11 07:39:44
<p>I am using Visual Studio 2010 and git (git svn). My coworker uses pure svn with the Ankhsvn plugin.</p> <p>When i try to open the file with the Git Source Control Provider enabled, Visual Studion complains:</p> <blockquote> <p>Source Control Plug-in<br> The active solution or project is controlled by adifferen...
8,290
114,798
2011-03-14 14:13:26
5,272,721
11
2011-03-11 12:10:56
612,704
2011-03-11 18:38:05
https://stackoverflow.com/q/5270243
https://stackoverflow.com/a/5272721
<p>I do not know how to do it exactly on windows, but I do know how I would do it on *nix.</p> <p>I would write a sed/bash script (called myscript) which removes those lines from the file when they are checked-out by git using a <a href="http://git-scm.com/docs/gitattributes#_tt_filter_tt" rel="noreferrer">git "smudge...
<p>I do not know how to do it exactly on windows, but I do know how I would do it on *nix.</p> <p>I would write a sed/bash script (called myscript) which removes those lines from the file when they are checked-out by git using a <a href="http://git-scm.com/docs/gitattributes#_tt_filter_tt" rel="noreferrer">git "smudge...
119, 6452, 10052, 56102
filter, git, gitattributes, git-svn
<h1>How to setup gitattributes to filter part of a file?</h1> <p>I am using Visual Studio 2010 and git (git svn). My coworker uses pure svn with the Ankhsvn plugin.</p> <p>When i try to open the file with the Git Source Control Provider enabled, Visual Studion complains:</p> <blockquote> <p>Source Control Plug-in<b...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,768
git
# How to setup gitattributes to filter part of a file? I am using Visual Studio 2010 and git (git svn). My coworker uses pure svn with the Ankhsvn plugin. When i try to open the file with the Git Source Control Provider enabled, Visual Studion complains: > Source Control Plug-in > The active solution or project is...
I do not know how to do it exactly on windows, but I do know how I would do it on *nix. I would write a sed/bash script (called myscript) which removes those lines from the file when they are checked-out by git using a [git "smudge" filter](http://git-scm.com/docs/gitattributes#_tt_filter_tt). So in "$GIT_DIR/info/at...
4951515
How to combine new changes with previous commit in git
6
2011-02-09 22:50:38
<p>I made a commit A and now have additional changes that if I committed would give me two commits A &amp; B.</p> <p>What is the most efficient way to combine the new changes with the ones from the previous commit so that I end up with just one commit?</p>
1,411
97,101
2024-05-14 06:58:33
4,951,549
11
2011-02-09 22:54:28
582
2011-02-09 22:54:28
https://stackoverflow.com/q/4951515
https://stackoverflow.com/a/4951549
<p><code>git add -u &amp;&amp; git commit --amend</code></p> <p>This will stage all local changes and then use them to rewrite the previous commit. Note that if you've already pushed the previous commit then this is a really bad idea.</p>
<p><code>git add -u &amp;&amp; git commit --amend</code></p> <p>This will stage all local changes and then use them to rewrite the previous commit. Note that if you've already pushed the previous commit then this is a really bad idea.</p>
119, 53850
git, git-commit
<h1>How to combine new changes with previous commit in git</h1> <p>I made a commit A and now have additional changes that if I committed would give me two commits A &amp; B.</p> <p>What is the most efficient way to combine the new changes with the ones from the previous commit so that I end up with just one commit?</p...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,769
git
# How to combine new changes with previous commit in git I made a commit A and now have additional changes that if I committed would give me two commits A & B. What is the most efficient way to combine the new changes with the ones from the previous commit so that I end up with just one commit?
`git add -u && git commit --amend` This will stage all local changes and then use them to rewrite the previous commit. Note that if you've already pushed the previous commit then this is a really bad idea.
4523131
get the number of n digit in a 2+ digit number
6
2010-12-23 23:11:35
<p>For example, getting "5" in "256". The closest I've gotten is Math.floor(256/10)), but that'll still return the numbers in front. Is there any simple way to get what I want or would I have to make a big function for it? Also, for clarity: "n digit" would be defined. Example, getDigit(2,256) would return 5 (second di...
12,497
507,012
2015-09-03 05:28:27
4,523,149
11
2010-12-23 23:16:10
71,034
2013-03-29 20:27:56
https://stackoverflow.com/q/4523131
https://stackoverflow.com/a/4523149
<pre><code>Math.floor((256 / 10) % 10) </code></pre> <p>or more generally:</p> <pre><code>Math.floor(N / (Math.pow(10, n)) % 10) </code></pre> <p>where <code>N</code> is the number to be extracted, and <code>n</code> is the position of the digit. Note that this counts from 0 starting from the right (i.e., the least ...
<pre><code>Math.floor((256 / 10) % 10) </code></pre> <p>or more generally:</p> <pre><code>Math.floor(N / (Math.pow(10, n)) % 10) </code></pre> <p>where <code>N</code> is the number to be extracted, and <code>n</code> is the position of the digit. Note that this counts from 0 starting from the right (i.e., the least ...
3, 3496, 48894
digit, javascript, numbers
<h1>get the number of n digit in a 2+ digit number</h1> <p>For example, getting "5" in "256". The closest I've gotten is Math.floor(256/10)), but that'll still return the numbers in front. Is there any simple way to get what I want or would I have to make a big function for it? Also, for clarity: "n digit" would be def...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,770
git
# get the number of n digit in a 2+ digit number For example, getting "5" in "256". The closest I've gotten is Math.floor(256/10)), but that'll still return the numbers in front. Is there any simple way to get what I want or would I have to make a big function for it? Also, for clarity: "n digit" would be defined. Exa...
``` Math.floor((256 / 10) % 10) ``` or more generally: ``` Math.floor(N / (Math.pow(10, n)) % 10) ``` where `N` is the number to be extracted, and `n` is the position of the digit. Note that this counts from 0 starting from the right (i.e., the least significant digit = 0), and doesn't account for invalid values of ...
2608869
How can I commit many new files with git gui without clicking each of it?
6
2010-04-09 15:52:15
<p>I have a ton of new files to commit. Clicking each one in git gui (Windows) to stage is annoying.</p> <p>How can I can I commit a whole bunch of files at once?</p>
19,404
94,154
2017-02-15 14:19:16
2,608,883
11
2010-04-09 15:54:41
52,444
2010-04-09 15:54:41
https://stackoverflow.com/q/2608869
https://stackoverflow.com/a/2608883
<p>Don't use the gui ^^ ... a <code>git add .</code> will add all new files to the index.</p>
<p>Don't use the gui ^^ ... a <code>git add .</code> will add all new files to the index.</p>
119, 33729, 53850
git, git-commit, git-gui
<h1>How can I commit many new files with git gui without clicking each of it?</h1> <p>I have a ton of new files to commit. Clicking each one in git gui (Windows) to stage is annoying.</p> <p>How can I can I commit a whole bunch of files at once?</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,771
git
# How can I commit many new files with git gui without clicking each of it? I have a ton of new files to commit. Clicking each one in git gui (Windows) to stage is annoying. How can I can I commit a whole bunch of files at once?
Don't use the gui ^^ ... a `git add .` will add all new files to the index.
2327050
git push after removing large file
6
2010-02-24 15:17:22
<p>I accidentally commited log/test.log but have never pushed it. I have since done a git rm to get rid of it. But when I try to push, I'm still getting a huge amount of data attempting to be transferred. Shouldn't the git rm fix that problem. If not, how could I fix it? </p>
4,268
111,674
2010-02-24 17:25:43
2,327,928
11
2010-02-24 17:11:45
123,109
2010-02-24 17:25:43
https://stackoverflow.com/q/2327050
https://stackoverflow.com/a/2327928
<p>Don't revert the commit and then push because the huge file will still be carried around in the history.</p> <p>Given that you haven't yet pushed it and that the commit you want to redo is the most recent, remove that commit from your history:</p> <pre>$ git reset HEAD^</pre> <p>This will return your index to the...
<p>Don't revert the commit and then push because the huge file will still be carried around in the history.</p> <p>Given that you haven't yet pushed it and that the commit you want to redo is the most recent, remove that commit from your history:</p> <pre>$ git reset HEAD^</pre> <p>This will return your index to the...
119
git
<h1>git push after removing large file</h1> <p>I accidentally commited log/test.log but have never pushed it. I have since done a git rm to get rid of it. But when I try to push, I'm still getting a huge amount of data attempting to be transferred. Shouldn't the git rm fix that problem. If not, how could I fix it? ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,772
git
# git push after removing large file I accidentally commited log/test.log but have never pushed it. I have since done a git rm to get rid of it. But when I try to push, I'm still getting a huge amount of data attempting to be transferred. Shouldn't the git rm fix that problem. If not, how could I fix it?
Don't revert the commit and then push because the huge file will still be carried around in the history. Given that you haven't yet pushed it and that the commit you want to redo is the most recent, remove that commit from your history: ``` $ git reset HEAD^ ``` This will return your index to the state it was in on ...
59269208
"ERROR:root:code for hash md5 was not found" when using any hg mercurial commands
239
2019-12-10 14:13:50
<p>When trying to use any <code>hg</code> Mercurial commands on the console, I keep getting this error. I installed Python using Homebrew and I am running Mac OS Catalina v. 10.15.1.</p> <p>Any reference would be appreciated. Here is the error I'm getting:</p> <pre><code>hg commit --amend ERROR:root:code for hash md...
143,274
10,299,105
2024-07-30 14:52:47
59,816,812
713
2020-01-20 03:55:39
2,293,304
2020-04-24 20:05:41
https://stackoverflow.com/q/59269208
https://stackoverflow.com/a/59816812
<p>Running <code>brew reinstall python@2</code> didn't work for my existing Python 2.7 virtual environments. Inside them there were still <code>ERROR:root:code for hash sha1 was not found</code> errors.</p> <p>I encountered this problem after I ran <code>brew upgrade openssl</code>. And here's the fix:</p> <pre><code...
<p>Running <code>brew reinstall python@2</code> didn't work for my existing Python 2.7 virtual environments. Inside them there were still <code>ERROR:root:code for hash sha1 was not found</code> errors.</p> <p>I encountered this problem after I ran <code>brew upgrade openssl</code>. And here's the fix:</p> <pre><code...
16, 369, 802, 1067, 1999
homebrew, macos, mercurial, openssl, python
<h1>"ERROR:root:code for hash md5 was not found" when using any hg mercurial commands</h1> <p>When trying to use any <code>hg</code> Mercurial commands on the console, I keep getting this error. I installed Python using Homebrew and I am running Mac OS Catalina v. 10.15.1.</p> <p>Any reference would be appreciated. H...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,773
mercurial
# "ERROR:root:code for hash md5 was not found" when using any hg mercurial commands When trying to use any `hg` Mercurial commands on the console, I keep getting this error. I installed Python using Homebrew and I am running Mac OS Catalina v. 10.15.1. Any reference would be appreciated. Here is the error I'm getting...
Running `brew reinstall python@2` didn't work for my existing Python 2.7 virtual environments. Inside them there were still `ERROR:root:code for hash sha1 was not found` errors. I encountered this problem after I ran `brew upgrade openssl`. And here's the fix: ``` $ ls /usr/local/Cellar/openssl ``` ...which shows `...
12865
Mercurial stuck "waiting for lock"
362
2008-08-15 23:01:16
<p>Got a bluescreen in windows while cloning a mercurial repository.</p> <p>After reboot, I now get this message for almost all hg commands:</p> <pre> c:\src\>hg commit waiting for lock on repository c:\src\McVrsServer held by '\x00\x00\x00\x00\x00\ x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' interru...
122,101
814
2025-04-30 11:40:09
12,879
510
2008-08-15 23:20:18
814
2019-05-23 14:43:33
https://stackoverflow.com/q/12865
https://stackoverflow.com/a/12879
<p>When "waiting for lock on repository", delete the repository file: <code>.hg/wlock</code> (or it may be in <code><code>.hg/store/lock</code></code>)</p> <p>When deleting the lock file, you must make sure nothing else is accessing the repository. (If the lock is a string of zeros or blank, this is almost certainly ...
<p>When "waiting for lock on repository", delete the repository file: <code>.hg/wlock</code> (or it may be in <code><code>.hg/store/lock</code></code>)</p> <p>When deleting the lock file, you must make sure nothing else is accessing the repository. (If the lock is a string of zeros or blank, this is almost certainly ...
802
mercurial
<h1>Mercurial stuck "waiting for lock"</h1> <p>Got a bluescreen in windows while cloning a mercurial repository.</p> <p>After reboot, I now get this message for almost all hg commands:</p> <pre> c:\src\>hg commit waiting for lock on repository c:\src\McVrsServer held by '\x00\x00\x00\x00\x00\ x00\x00\x00\x00\x00\x00\...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,775
mercurial
# Mercurial stuck "waiting for lock" Got a bluescreen in windows while cloning a mercurial repository. After reboot, I now get this message for almost all hg commands: ``` c:\src\>hg commit waiting for lock on repository c:\src\McVrsServer held by '\x00\x00\x00\x00\x00\ x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0...
When "waiting for lock on repository", delete the repository file: `.hg/wlock` (or it may be in `.hg/store/lock`) When deleting the lock file, you must make sure nothing else is accessing the repository. (If the lock is a string of zeros or blank, this is almost certainly true).
2412239
How to do Mercurial's 'hg remove' for all missing files?
231
2010-03-09 20:17:46
<p>I use this to remove a file from the repo:</p> <pre><code>hg remove &lt;full file path&gt; </code></pre> <p>What command can you use to do an <code>hg remove</code> on <em>all</em> files that have been deleted locally? </p> <p>By deleted locally, I mean those showing up with an <code>!</code> when you do <code>h...
93,068
47,281
2017-03-22 06:39:04
2,412,359
375
2010-03-09 20:35:40
220,156
2010-03-09 20:35:40
https://stackoverflow.com/q/2412239
https://stackoverflow.com/a/2412359
<p>This will add all new files that are not ignored, and remove all locally missing files</p> <pre><code>hg addremove </code></pre> <p>Either of these will remove all locally missing files(They are the same command)</p> <pre><code>hg remove --after hg remove -A </code></pre>
<p>This will add all new files that are not ignored, and remove all locally missing files</p> <pre><code>hg addremove </code></pre> <p>Either of these will remove all locally missing files(They are the same command)</p> <pre><code>hg remove --after hg remove -A </code></pre>
802
mercurial
<h1>How to do Mercurial's 'hg remove' for all missing files?</h1> <p>I use this to remove a file from the repo:</p> <pre><code>hg remove &lt;full file path&gt; </code></pre> <p>What command can you use to do an <code>hg remove</code> on <em>all</em> files that have been deleted locally? </p> <p>By deleted locally, ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,777
mercurial
# How to do Mercurial's 'hg remove' for all missing files? I use this to remove a file from the repo: ``` hg remove <full file path> ``` What command can you use to do an `hg remove` on *all* files that have been deleted locally? By deleted locally, I mean those showing up with an `!` when you do `hg status`. For ...
This will add all new files that are not ignored, and remove all locally missing files ``` hg addremove ``` Either of these will remove all locally missing files(They are the same command) ``` hg remove --after hg remove -A ```
1101167
What is the difference between hg forget and hg remove?
326
2009-07-08 23:51:30
<p>I want mercurial to remove several files from the current state of the repository. However, I want the files to exist in prior history.</p> <p>How do <code>forget</code> and <code>remove</code> differ, and can they do what I want?</p>
115,975
26,227
2015-05-14 05:43:40
1,101,902
358
2009-07-09 04:58:51
8,992
2009-07-11 03:37:23
https://stackoverflow.com/q/1101167
https://stackoverflow.com/a/1101902
<p>'<code>hg forget</code>' is just shorthand for '<code>hg remove -Af</code>'. From the '<code>hg remove</code>' help:</p> <blockquote> <p>...and -Af can be used to remove files from the next revision without deleting them from the working directory.</p> </blockquote> <p>Bottom line: '<code>remove</code>' d...
<p>'<code>hg forget</code>' is just shorthand for '<code>hg remove -Af</code>'. From the '<code>hg remove</code>' help:</p> <blockquote> <p>...and -Af can be used to remove files from the next revision without deleting them from the working directory.</p> </blockquote> <p>Bottom line: '<code>remove</code>' d...
456, 802
mercurial, version-control
<h1>What is the difference between hg forget and hg remove?</h1> <p>I want mercurial to remove several files from the current state of the repository. However, I want the files to exist in prior history.</p> <p>How do <code>forget</code> and <code>remove</code> differ, and can they do what I want?</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,778
mercurial
# What is the difference between hg forget and hg remove? I want mercurial to remove several files from the current state of the repository. However, I want the files to exist in prior history. How do `forget` and `remove` differ, and can they do what I want?
'`hg forget`' is just shorthand for '`hg remove -Af`'. From the '`hg remove`' help: > ...and -Af can be used to remove files > from the next revision without > deleting them from the working > directory. Bottom line: '`remove`' deletes the file from your working copy on disk (unless you uses `-Af`) and '`forget`' doe...
2584407
How to save username and password with Mercurial?
278
2010-04-06 11:28:26
<p>I used Mercurial in a personal project, and I have been typing my username and password every time I want to push something to the server.</p> <p>I tried adding the following to the <code>.hgrc</code> file in my home directory, but it seems to be completely ignored.</p> <pre><code>[ui] username = MY_USER_NAME pass...
183,329
225,262
2019-11-05 11:08:05
2,589,195
338
2010-04-07 00:12:25
310,500
2019-10-07 16:57:22
https://stackoverflow.com/q/2584407
https://stackoverflow.com/a/2589195
<p>You can make an auth section in your <code>.hgrc</code> or <code>Mercurial.ini</code> file, like so:</p> <pre><code>[auth] bb.prefix = https://bitbucket.org/repo/path bb.username = foo bb.password = foo_passwd </code></pre> <p>The ‘bb’ part is an arbitrary identifier and is used to match prefix with username and p...
<p>You can make an auth section in your <code>.hgrc</code> or <code>Mercurial.ini</code> file, like so:</p> <pre><code>[auth] bb.prefix = https://bitbucket.org/repo/path bb.username = foo bb.password = foo_passwd </code></pre> <p>The ‘bb’ part is an arbitrary identifier and is used to match prefix with username and p...
802, 34046
hgrc, mercurial
<h1>How to save username and password with Mercurial?</h1> <p>I used Mercurial in a personal project, and I have been typing my username and password every time I want to push something to the server.</p> <p>I tried adding the following to the <code>.hgrc</code> file in my home directory, but it seems to be completely...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,780
mercurial
# How to save username and password with Mercurial? I used Mercurial in a personal project, and I have been typing my username and password every time I want to push something to the server. I tried adding the following to the `.hgrc` file in my home directory, but it seems to be completely ignored. ``` [ui] usernam...
You can make an auth section in your `.hgrc` or `Mercurial.ini` file, like so: ``` [auth] bb.prefix = https://bitbucket.org/repo/path bb.username = foo bb.password = foo_passwd ``` The ‘bb’ part is an arbitrary identifier and is used to match prefix with username and password - handy for managing different username/p...
1212370
How do I delete all untracked files from my working directory in Mercurial?
230
2009-07-31 12:50:20
<p>Is it possible to delete all untracked files from my working directory? Let's say I added a bunch of files to my working directory, didn't add them via 'hg add' and now want to get rid of those new files entirely?</p> <p>I'm on windows, although I'm using PowerShell, so a combined solution is also possible here.</p...
83,281
430,254
2021-02-21 18:55:24
1,212,486
311
2009-07-31 13:18:03
63,841
2019-02-05 08:28:04
https://stackoverflow.com/q/1212370
https://stackoverflow.com/a/1212486
<p>Add the Mercurial Extension called <strong>purge</strong>. It is distributed by Mercurial.</p> <p>This extension adds a “purge” command to “hg” that removes files not known to Mercurial. i.e. untracked Files. So your command would be, </p> <pre><code>hg purge </code></pre> <p>It is not enabled by default, maybe t...
<p>Add the Mercurial Extension called <strong>purge</strong>. It is distributed by Mercurial.</p> <p>This extension adds a “purge” command to “hg” that removes files not known to Mercurial. i.e. untracked Files. So your command would be, </p> <pre><code>hg purge </code></pre> <p>It is not enabled by default, maybe t...
802
mercurial
<h1>How do I delete all untracked files from my working directory in Mercurial?</h1> <p>Is it possible to delete all untracked files from my working directory? Let's say I added a bunch of files to my working directory, didn't add them via 'hg add' and now want to get rid of those new files entirely?</p> <p>I'm on win...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,781
mercurial
# How do I delete all untracked files from my working directory in Mercurial? Is it possible to delete all untracked files from my working directory? Let's say I added a bunch of files to my working directory, didn't add them via 'hg add' and now want to get rid of those new files entirely? I'm on windows, although I...
Add the Mercurial Extension called **purge**. It is distributed by Mercurial. This extension adds a “purge” command to “hg” that removes files not known to Mercurial. i.e. untracked Files. So your command would be, ``` hg purge ``` It is not enabled by default, maybe to avoid accidentally removing files that you for...
8182858
Mercurial: how to amend the last commit?
227
2011-11-18 13:04:02
<p>I'm looking for a counter-part of <code>git commit --amend</code> in Mercurial, i.e. a way to modify the commit which my working copy is linked to. I'm only interested in the last commit, not an arbitrary earlier commit.</p> <p>The requirements for this amend-procedure are:</p> <ul> <li><p>if possible, it should n...
117,640
241,453
2023-11-03 22:01:59
10,419,831
305
2012-05-02 18:46:37
203,002
2023-11-03 22:01:59
https://stackoverflow.com/q/8182858
https://stackoverflow.com/a/10419831
<p>You can now use the <code>--amend</code> option with <code>hg commit</code> to update the last commit with the current working directory, since the release of <a href="https://wiki.mercurial-scm.org/WhatsNew/Archive#Mercurial_2.2_.282012-05-01.29" rel="nofollow noreferrer">Mercurial 2.2</a>.</p> <p>From the <a href=...
<p>You can now use the <code>--amend</code> option with <code>hg commit</code> to update the last commit with the current working directory, since the release of <a href="https://wiki.mercurial-scm.org/WhatsNew/Archive#Mercurial_2.2_.282012-05-01.29" rel="nofollow noreferrer">Mercurial 2.2</a>.</p> <p>From the <a href=...
802, 5597, 127564
commit, mercurial, mercurial-commit
<h1>Mercurial: how to amend the last commit?</h1> <p>I'm looking for a counter-part of <code>git commit --amend</code> in Mercurial, i.e. a way to modify the commit which my working copy is linked to. I'm only interested in the last commit, not an arbitrary earlier commit.</p> <p>The requirements for this amend-proced...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,783
mercurial
# Mercurial: how to amend the last commit? I'm looking for a counter-part of `git commit --amend` in Mercurial, i.e. a way to modify the commit which my working copy is linked to. I'm only interested in the last commit, not an arbitrary earlier commit. The requirements for this amend-procedure are: - if possible, it...
You can now use the `--amend` option with `hg commit` to update the last commit with the current working directory, since the release of [Mercurial 2.2](https://wiki.mercurial-scm.org/WhatsNew/Archive#Mercurial_2.2_.282012-05-01.29). From the [command line reference](https://www.selenic.com/mercurial/hg.1.html#commit)...
623052
How to edit incorrect commit message in Mercurial?
339
2009-03-08 04:42:39
<p>I am currently using TortoiseHg (Mercurial) and accidentally committed an incorrect commit message. How do I go about editing this commit message in the repository?</p>
148,571
72,990
2021-01-08 19:46:40
623,087
257
2009-03-08 05:05:34
14,955
2015-01-03 03:58:45
https://stackoverflow.com/q/623052
https://stackoverflow.com/a/623087
<p><strong>Update:</strong> Mercurial has added <code>--amend</code> which should be <a href="https://stackoverflow.com/q/8182858/84378">the preferred option now</a>.</p> <hr> <p>You can rollback the last commit (but only the last one) with <code>hg rollback</code> and then reapply it.</p> <p><strong>Important</stro...
<p><strong>Update:</strong> Mercurial has added <code>--amend</code> which should be <a href="https://stackoverflow.com/q/8182858/84378">the preferred option now</a>.</p> <hr> <p>You can rollback the last commit (but only the last one) with <code>hg rollback</code> and then reapply it.</p> <p><strong>Important</stro...
456, 802, 3809, 8122, 127564
commit-message, mercurial, mercurial-commit, tortoisehg, version-control
<h1>How to edit incorrect commit message in Mercurial?</h1> <p>I am currently using TortoiseHg (Mercurial) and accidentally committed an incorrect commit message. How do I go about editing this commit message in the repository?</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,784
mercurial
# How to edit incorrect commit message in Mercurial? I am currently using TortoiseHg (Mercurial) and accidentally committed an incorrect commit message. How do I go about editing this commit message in the repository?
**Update:** Mercurial has added `--amend` which should be [the preferred option now](https://stackoverflow.com/q/8182858/84378). --- You can rollback the last commit (but only the last one) with `hg rollback` and then reapply it. **Important**: this **permanently removes the latest commit** (or pull). So if you've d...
2672351
Hg: How to do a rebase like git's rebase
215
2010-04-20 03:34:23
<p>In Git I can do this:</p> <pre> 1. Start working on new feature: $ git co -b newfeature-123 # (a local feature development branch) do a few commits (M, N, O) master A---B---C \ newfeature-123 M---N---O 2. Pull new changes from upstream master: $ git pull (master updated with ff-commits) master...
90,926
192,819
2019-03-26 02:29:26
2,672,489
243
2010-04-20 04:14:15
8,992
2010-04-20 04:14:15
https://stackoverflow.com/q/2672351
https://stackoverflow.com/a/2672489
<p>VonC has <a href="https://stackoverflow.com/questions/2672351/hg-how-to-do-a-rebase-like-gits-rebase/2672429#2672429">the answer you're looking for</a>, the Rebase Extension. It is, however, worth spending a second or two thinking about why neither mq nor rebase are enabled by default in mercurial: because mercuria...
<p>VonC has <a href="https://stackoverflow.com/questions/2672351/hg-how-to-do-a-rebase-like-gits-rebase/2672429#2672429">the answer you're looking for</a>, the Rebase Extension. It is, however, worth spending a second or two thinking about why neither mq nor rebase are enabled by default in mercurial: because mercuria...
119, 802, 3346, 8974
dvcs, git, mercurial, rebase
<h1>Hg: How to do a rebase like git's rebase</h1> <p>In Git I can do this:</p> <pre> 1. Start working on new feature: $ git co -b newfeature-123 # (a local feature development branch) do a few commits (M, N, O) master A---B---C \ newfeature-123 M---N---O 2. Pull new changes from upstream master: $...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,786
mercurial
# Hg: How to do a rebase like git's rebase In Git I can do this: ``` 1. Start working on new feature: $ git co -b newfeature-123 # (a local feature development branch) do a few commits (M, N, O) master A---B---C \ newfeature-123 M---N---O 2. Pull new changes from upstream master: $ git pull (mast...
VonC has [the answer you're looking for](https://stackoverflow.com/questions/2672351/hg-how-to-do-a-rebase-like-gits-rebase/2672429#2672429), the Rebase Extension. It is, however, worth spending a second or two thinking about why neither mq nor rebase are enabled by default in mercurial: because mercurial is all about ...
4378684
Mercurial: Can I rename a branch?
214
2010-12-07 15:59:59
<p>We now have a "stiging" branch, where "staging" seems to be a far better semantic fit. What's a good strategy for handling this?</p>
68,946
13,139
2025-08-17 12:33:24
7,245,187
230
2011-08-30 14:54:07
503,377
2011-11-30 17:57:36
https://stackoverflow.com/q/4378684
https://stackoverflow.com/a/7245187
<p>Update to the <code>stiging</code> branch and create a new branch off of it. Then close the old branch.</p> <p>In summary:</p> <pre><code>hg update stiging hg branch staging hg commit -m"Changing stiging branch to staging." hg update stiging hg commit --close-branch -m"This was a typo; use staging instead." hg pus...
<p>Update to the <code>stiging</code> branch and create a new branch off of it. Then close the old branch.</p> <p>In summary:</p> <pre><code>hg update stiging hg branch staging hg commit -m"Changing stiging branch to staging." hg update stiging hg commit --close-branch -m"This was a typo; use staging instead." hg pus...
802, 1879, 3346
branch, dvcs, mercurial
<h1>Mercurial: Can I rename a branch?</h1> <p>We now have a "stiging" branch, where "staging" seems to be a far better semantic fit. What's a good strategy for handling this?</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,788
mercurial
# Mercurial: Can I rename a branch? We now have a "stiging" branch, where "staging" seems to be a far better semantic fit. What's a good strategy for handling this?
Update to the `stiging` branch and create a new branch off of it. Then close the old branch. In summary: ``` hg update stiging hg branch staging hg commit -m"Changing stiging branch to staging." hg update stiging hg commit --close-branch -m"This was a typo; use staging instead." hg push --new-branch ```
4957721
Discard all and get clean copy of latest revision?
177
2011-02-10 13:35:24
<p>I'm moving a build process to use mercurial and want to get the working directory back to the state of the tip revision. Earlier runs of the build process will have modified some files and added some files that I don't want to commit, so I have local changes and files that aren't added to the repository. </p> <p>Wh...
182,556
8,479
2019-04-09 11:20:15
4,957,794
227
2011-02-10 13:42:00
267
2011-02-10 13:42:00
https://stackoverflow.com/q/4957721
https://stackoverflow.com/a/4957794
<p>Those steps <em>should</em> be able to be shortened down to:</p> <pre><code>hg pull hg update -r MY_BRANCH -C </code></pre> <p>The <code>-C</code> flag tells the update command to discard all local changes before updating.</p> <p>However, this might still leave untracked files in your repository. It sounds like y...
<p>Those steps <em>should</em> be able to be shortened down to:</p> <pre><code>hg pull hg update -r MY_BRANCH -C </code></pre> <p>The <code>-C</code> flag tells the update command to discard all local changes before updating.</p> <p>However, this might still leave untracked files in your repository. It sounds like y...
802, 4860
mercurial, pull
<h1>Discard all and get clean copy of latest revision?</h1> <p>I'm moving a build process to use mercurial and want to get the working directory back to the state of the tip revision. Earlier runs of the build process will have modified some files and added some files that I don't want to commit, so I have local change...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,789
mercurial
# Discard all and get clean copy of latest revision? I'm moving a build process to use mercurial and want to get the working directory back to the state of the tip revision. Earlier runs of the build process will have modified some files and added some files that I don't want to commit, so I have local changes and fil...
Those steps *should* be able to be shortened down to: ``` hg pull hg update -r MY_BRANCH -C ``` The `-C` flag tells the update command to discard all local changes before updating. However, this might still leave untracked files in your repository. It sounds like you want to get rid of those as well, so I would use ...
2237222
How to correctly close a feature branch in Mercurial?
243
2010-02-10 13:50:29
<p>I've finished working on a feature branch <code>feature-x</code>. I want to merge results back to the <code>default</code> branch and close <code>feature-x</code> in order to get rid of it in the output of <code>hg branches</code>.</p> <p>I came up with the following scenario, but it has some issues:</p> <pre><cod...
103,679
187,103
2015-12-01 23:23:17
2,239,306
220
2010-02-10 18:20:25
187,103
2014-02-02 19:04:23
https://stackoverflow.com/q/2237222
https://stackoverflow.com/a/2239306
<p>One way is to just leave merged feature branches open (and inactive):</p> <pre><code>$ hg up default $ hg merge feature-x $ hg ci -m merge $ hg heads (1 head) $ hg branches default 43:... feature-x 41:... (2 branches) $ hg branches -a default 43:... (1 branch) </code></pre> <p>Another way is ...
<p>One way is to just leave merged feature branches open (and inactive):</p> <pre><code>$ hg up default $ hg merge feature-x $ hg ci -m merge $ hg heads (1 head) $ hg branches default 43:... feature-x 41:... (2 branches) $ hg branches -a default 43:... (1 branch) </code></pre> <p>Another way is ...
717, 802, 1879, 112861
branch, hg-merge, mercurial, merge
<h1>How to correctly close a feature branch in Mercurial?</h1> <p>I've finished working on a feature branch <code>feature-x</code>. I want to merge results back to the <code>default</code> branch and close <code>feature-x</code> in order to get rid of it in the output of <code>hg branches</code>.</p> <p>I came up with...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,790
mercurial
# How to correctly close a feature branch in Mercurial? I've finished working on a feature branch `feature-x`. I want to merge results back to the `default` branch and close `feature-x` in order to get rid of it in the output of `hg branches`. I came up with the following scenario, but it has some issues: ``` $ hg u...
One way is to just leave merged feature branches open (and inactive): ``` $ hg up default $ hg merge feature-x $ hg ci -m merge $ hg heads (1 head) $ hg branches default 43:... feature-x 41:... (2 branches) $ hg branches -a default 43:... (1 branch) ``` Another way is to close a feature branch b...
2485651
Print Current Mercurial Revision Hash?
140
2010-03-21 02:30:51
<p>Is there a better way extract the current revision hash in Mercurial than</p> <p><code>hg log -l1|grep changeset|cut -d: -f3</code></p> <p>?</p> <p>Part of my webapp deployment script "tags" the uploaded app tarball with its unique revision hash.</p>
61,971
5,260
2018-07-24 16:32:36
2,485,923
214
2010-03-21 04:25:51
8,992
2010-03-21 04:25:51
https://stackoverflow.com/q/2485651
https://stackoverflow.com/a/2485923
<p>Try:</p> <pre><code>hg id -i </code></pre> <p>Example:</p> <pre><code>$ hg id -i adc56745e928 </code></pre>
<p>Try:</p> <pre><code>hg id -i </code></pre> <p>Example:</p> <pre><code>$ hg id -i adc56745e928 </code></pre>
581, 802, 1555
hash, mercurial, revision
<h1>Print Current Mercurial Revision Hash?</h1> <p>Is there a better way extract the current revision hash in Mercurial than</p> <p><code>hg log -l1|grep changeset|cut -d: -f3</code></p> <p>?</p> <p>Part of my webapp deployment script "tags" the uploaded app tarball with its unique revision hash.</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,791
mercurial
# Print Current Mercurial Revision Hash? Is there a better way extract the current revision hash in Mercurial than `hg log -l1|grep changeset|cut -d: -f3` ? Part of my webapp deployment script "tags" the uploaded app tarball with its unique revision hash.
Try: ``` hg id -i ``` Example: ``` $ hg id -i adc56745e928 ```
34784
Mercurial .hgignore for Visual Studio 2008 projects
166
2008-08-29 17:17:40
<p>What is a good setup for .hgignore file when working with Visual Studio 2008?</p> <p>I mostly develop on my own, only occasionly I clone the repository for somebody else to work on it.</p> <p>I'm thinking about obj folders, .suo, .sln, .user files etc.. Can they just be included or are there file I shouldn't inclu...
25,592
925
2015-03-11 10:44:45
744,333
209
2009-04-13 15:54:11
73,794
2010-05-21 18:23:20
https://stackoverflow.com/q/34784
https://stackoverflow.com/a/744333
<p>Here's my standard .hgignore file for use with VS2008 that was originally modified from a Git ignore file:</p> <pre><code># Ignore file for Visual Studio 2008 # use glob syntax syntax: glob # Ignore Visual Studio 2008 files *.obj *.exe *.pdb *.user *.aps *.pch *.vspscc *_i.c *_p.c *.ncb *.suo *.tlb *.tlh *.bak *....
<p>Here's my standard .hgignore file for use with VS2008 that was originally modified from a Git ignore file:</p> <pre><code># Ignore file for Visual Studio 2008 # use glob syntax syntax: glob # Ignore Visual Studio 2008 files *.obj *.exe *.pdb *.user *.aps *.pch *.vspscc *_i.c *_p.c *.ncb *.suo *.tlb *.tlh *.bak *....
802, 31419, 32472, 33953
hgignore, mercurial, visual-studio, visual-studio-2008
<h1>Mercurial .hgignore for Visual Studio 2008 projects</h1> <p>What is a good setup for .hgignore file when working with Visual Studio 2008?</p> <p>I mostly develop on my own, only occasionly I clone the repository for somebody else to work on it.</p> <p>I'm thinking about obj folders, .suo, .sln, .user files etc.. ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,792
mercurial
# Mercurial .hgignore for Visual Studio 2008 projects What is a good setup for .hgignore file when working with Visual Studio 2008? I mostly develop on my own, only occasionly I clone the repository for somebody else to work on it. I'm thinking about obj folders, .suo, .sln, .user files etc.. Can they just be includ...
Here's my standard .hgignore file for use with VS2008 that was originally modified from a Git ignore file: ``` # Ignore file for Visual Studio 2008 # use glob syntax syntax: glob # Ignore Visual Studio 2008 files *.obj *.exe *.pdb *.user *.aps *.pch *.vspscc *_i.c *_p.c *.ncb *.suo *.tlb *.tlh *.bak *.cache *.ilk *....
2159623
How can I switch to a tag/branch in hg?
139
2010-01-29 03:03:29
<p>I followed the documentation in <a href="https://developer.mozilla.org/En/Developer_Guide/Source_Code/Mercurial" rel="noreferrer">https://developer.mozilla.org/En/Developer_Guide/Source_Code/Mercurial</a> and downloaded FF source with:</p> <pre><code>hg clone http://hg.mozilla.org/mozilla-central/ src </code></pre>...
140,473
125,440
2014-10-18 17:59:07
2,338,185
205
2010-02-25 22:34:07
225,801
2014-10-18 17:56:58
https://stackoverflow.com/q/2159623
https://stackoverflow.com/a/2338185
<p>Once you have cloned the repo, you have everything: you can then <code>hg up branchname</code> or <code>hg up tagname</code> to update your working copy.</p> <p>UP: <code>hg up</code> is a shortcut of <code>hg update</code>, which also has <code>hg checkout</code> alias for people with <code>git</code> habits.</p>
<p>Once you have cloned the repo, you have everything: you can then <code>hg up branchname</code> or <code>hg up tagname</code> to update your working copy.</p> <p>UP: <code>hg up</code> is a shortcut of <code>hg update</code>, which also has <code>hg checkout</code> alias for people with <code>git</code> habits.</p>
802
mercurial
<h1>How can I switch to a tag/branch in hg?</h1> <p>I followed the documentation in <a href="https://developer.mozilla.org/En/Developer_Guide/Source_Code/Mercurial" rel="noreferrer">https://developer.mozilla.org/En/Developer_Guide/Source_Code/Mercurial</a> and downloaded FF source with:</p> <pre><code>hg clone http://...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,793
mercurial
# How can I switch to a tag/branch in hg? I followed the documentation in <https://developer.mozilla.org/En/Developer_Guide/Source_Code/Mercurial> and downloaded FF source with: ``` hg clone http://hg.mozilla.org/mozilla-central/ src ``` How can I switch to the FF3.6 'branch' or 'tag'? The documentation said ``` hg...
Once you have cloned the repo, you have everything: you can then `hg up branchname` or `hg up tagname` to update your working copy. UP: `hg up` is a shortcut of `hg update`, which also has `hg checkout` alias for people with `git` habits.
15544736
Resolving conflicts: how to accept "their" changes automatically?
107
2013-03-21 10:19:42
<p>When merging conflicting changes using <code>hg merge</code>, Mercurial inserts a set of markers into the files to be merged in my working copy like this:</p> <pre><code>&lt;&lt;&lt;&lt;&lt;&lt;&lt; local version = 0.2 ======= version = 0.1 &gt;&gt;&gt;&gt;&gt;&gt;&gt; other </code></pre> <p>Then I manually ed...
54,658
215,571
2022-05-27 00:55:20
15,545,836
189
2013-03-21 11:10:10
427,141
2013-03-21 11:10:10
https://stackoverflow.com/q/15544736
https://stackoverflow.com/a/15545836
<p>Use </p> <pre><code>hg resolve -t internal:other --all </code></pre> <p>to accept <code>theirs</code> and</p> <pre><code>hg resolve -t internal:local --all </code></pre> <p>to accept <code>yours</code></p>
<p>Use </p> <pre><code>hg resolve -t internal:other --all </code></pre> <p>to accept <code>theirs</code> and</p> <pre><code>hg resolve -t internal:local --all </code></pre> <p>to accept <code>yours</code></p>
802
mercurial
<h1>Resolving conflicts: how to accept "their" changes automatically?</h1> <p>When merging conflicting changes using <code>hg merge</code>, Mercurial inserts a set of markers into the files to be merged in my working copy like this:</p> <pre><code>&lt;&lt;&lt;&lt;&lt;&lt;&lt; local version = 0.2 ======= version = ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,795
mercurial
# Resolving conflicts: how to accept "their" changes automatically? When merging conflicting changes using `hg merge`, Mercurial inserts a set of markers into the files to be merged in my working copy like this: ``` <<<<<<< local version = 0.2 ======= version = 0.1 >>>>>>> other ``` Then I manually edit all file...
Use ``` hg resolve -t internal:other --all ``` to accept `theirs` and ``` hg resolve -t internal:local --all ``` to accept `yours`
3688263
Abandoning changes without deleting from history
182
2010-09-10 20:52:36
<p>There is a commit that just didn't work, so I want to abandon it <em>without deleting it from history</em>.</p> <p>I have updated from an earlier revision and committed, thus creating a new head.</p> <hr> <p>I don't have branches, I don't want branches, I just want to simply go on with the new head exactly as it ...
55,836
207,655
2019-10-03 16:58:58
3,688,320
184
2010-09-10 21:02:46
19,465
2019-10-03 16:58:58
https://stackoverflow.com/q/3688263
https://stackoverflow.com/a/3688320
<p>Update your repository to the head with the revision that you want to forget about, then use <code>hg commit --close-branch</code> to mark that (anonymous) branch as closed. Then update to the head of the branch that you <em>do</em> want, and continue working.</p> <p>You can still see the closed branch if you use ...
<p>Update your repository to the head with the revision that you want to forget about, then use <code>hg commit --close-branch</code> to mark that (anonymous) branch as closed. Then update to the head of the branch that you <em>do</em> want, and continue working.</p> <p>You can still see the closed branch if you use ...
802
mercurial
<h1>Abandoning changes without deleting from history</h1> <p>There is a commit that just didn't work, so I want to abandon it <em>without deleting it from history</em>.</p> <p>I have updated from an earlier revision and committed, thus creating a new head.</p> <hr> <p>I don't have branches, I don't want branches, I ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,796
mercurial
# Abandoning changes without deleting from history There is a commit that just didn't work, so I want to abandon it *without deleting it from history*. I have updated from an earlier revision and committed, thus creating a new head. --- I don't have branches, I don't want branches, I just want to simply go on with ...
Update your repository to the head with the revision that you want to forget about, then use `hg commit --close-branch` to mark that (anonymous) branch as closed. Then update to the head of the branch that you *do* want, and continue working. You can still see the closed branch if you use the `-c` option to `hg heads`...
254002
How can I ignore everything under a folder in Mercurial
154
2008-10-31 15:55:25
<p>I am looking for an expression for the .hgignore file, to ignore all files beneath a specified folder.</p> <p>eg: I would like to ignore all files and folders beneath bin</p> <p>Actually any advice on how the expressions are formed would be great</p>
71,506
4,642
2017-11-09 21:11:29
255,094
179
2008-10-31 22:05:03
8,992
2008-10-31 22:05:03
https://stackoverflow.com/q/254002
https://stackoverflow.com/a/255094
<p>Alternately:</p> <pre><code>syntax: glob bin/** </code></pre>
<p>Alternately:</p> <pre><code>syntax: glob bin/** </code></pre>
456, 802, 31419
hgignore, mercurial, version-control
<h1>How can I ignore everything under a folder in Mercurial</h1> <p>I am looking for an expression for the .hgignore file, to ignore all files beneath a specified folder.</p> <p>eg: I would like to ignore all files and folders beneath bin</p> <p>Actually any advice on how the expressions are formed would be great</p>...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,797
mercurial
# How can I ignore everything under a folder in Mercurial I am looking for an expression for the .hgignore file, to ignore all files beneath a specified folder. eg: I would like to ignore all files and folders beneath bin Actually any advice on how the expressions are formed would be great
Alternately: ``` syntax: glob bin/** ```
2024510
Generating a list of which files changed between hg versions
123
2010-01-07 23:35:40
<p>I want to generate a list of which files changed between two revisions in a given directory in Mercurial.</p> <p>In particular, I am not interested in <em>what</em> changed, but <em>which files</em> changed in that directory.</p> <p>E.g., supposing that between <code>then</code> and <code>otherthen</code>, only 2 ...
36,545
26,227
2016-04-15 19:42:38
2,024,591
173
2010-01-07 23:56:00
231,224
2014-04-08 18:23:21
https://stackoverflow.com/q/2024510
https://stackoverflow.com/a/2024591
<pre><code>hg status --rev x:y </code></pre> <p>where <code>x</code> and <code>y</code> are desired revision numbers (or tag or branch names).</p> <p>If you are using the terminal in windows add <code>hg status --rev x:y</code><strong><code>&gt; your-file.txt</code></strong> to save the list to a file.</p>
<pre><code>hg status --rev x:y </code></pre> <p>where <code>x</code> and <code>y</code> are desired revision numbers (or tag or branch names).</p> <p>If you are using the terminal in windows add <code>hg status --rev x:y</code><strong><code>&gt; your-file.txt</code></strong> to save the list to a file.</p>
456, 802
mercurial, version-control
<h1>Generating a list of which files changed between hg versions</h1> <p>I want to generate a list of which files changed between two revisions in a given directory in Mercurial.</p> <p>In particular, I am not interested in <em>what</em> changed, but <em>which files</em> changed in that directory.</p> <p>E.g., suppos...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,798
mercurial
# Generating a list of which files changed between hg versions I want to generate a list of which files changed between two revisions in a given directory in Mercurial. In particular, I am not interested in *what* changed, but *which files* changed in that directory. E.g., supposing that between `then` and `otherthe...
``` hg status --rev x:y ``` where `x` and `y` are desired revision numbers (or tag or branch names). If you are using the terminal in windows add `hg status --rev x:y`**`> your-file.txt`** to save the list to a file.
8188605
Mercurial (hg) commit only certain files
137
2010-03-09 18:33:45
<p>I'm trying to commit only certain files with Mercurial. Because of of hg having auto-add whenever I try to commit a change it wants to commit all files. But I don't want that because certain files are not "ready" yet.</p> <p>There is</p> <pre><code>hg commit -I thefile.foo </code></pre> <p>but this is only for on...
75,318
null
2018-02-22 09:51:33
8,341,651
172
2011-12-01 12:48:26
110,204
2018-02-22 09:51:33
https://stackoverflow.com/q/8188605
https://stackoverflow.com/a/8341651
<p>You can specify the files on the command line, as tonfa writes:</p> <pre><code>$ hg commit foo.c foo.h dir/ </code></pre> <p>That just works and that's what I do all the time. You can also use the <code>--include</code> flag that you've found, and you can use it several times like this:</p> <pre><code>$ hg commit...
<p>You can specify the files on the command line, as tonfa writes:</p> <pre><code>$ hg commit foo.c foo.h dir/ </code></pre> <p>That just works and that's what I do all the time. You can also use the <code>--include</code> flag that you've found, and you can use it several times like this:</p> <pre><code>$ hg commit...
456, 802, 5597
commit, mercurial, version-control
<h1>Mercurial (hg) commit only certain files</h1> <p>I'm trying to commit only certain files with Mercurial. Because of of hg having auto-add whenever I try to commit a change it wants to commit all files. But I don't want that because certain files are not "ready" yet.</p> <p>There is</p> <pre><code>hg commit -I the...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,799
mercurial
# Mercurial (hg) commit only certain files I'm trying to commit only certain files with Mercurial. Because of of hg having auto-add whenever I try to commit a change it wants to commit all files. But I don't want that because certain files are not "ready" yet. There is ``` hg commit -I thefile.foo ``` but this is o...
You can specify the files on the command line, as tonfa writes: ``` $ hg commit foo.c foo.h dir/ ``` That just works and that's what I do all the time. You can also use the `--include` flag that you've found, and you can use it several times like this: ``` $ hg commit -I foo.c -I "**/*.h" ``` You can even use a [fi...
4095696
Mercurial .hgignore for Visual Studio 2010 projects
119
2010-11-04 10:26:13
<p>Not to be confused with <a href="https://stackoverflow.com/questions/34784/mercurial-hgignore-for-visual-studio-2008-projects">Mercurial .hgignore for Visual Studio 2008 projects</a></p> <p>I was asking whether if that same file can be reused for Visual Studio 2010, or some other extensions, etc should be added to ...
14,857
406,464
2013-08-21 07:05:58
4,095,783
171
2010-11-04 10:35:42
null
2013-01-31 05:45:23
https://stackoverflow.com/q/4095696
https://stackoverflow.com/a/4095783
<p>The new things are related to MSTest stuff. This is the one that I use:</p> <pre><code># use glob syntax syntax: glob *.obj *.pdb *.user *.aps *.pch *.vspscc *.vssscc *_i.c *_p.c *.ncb *.suo *.tlb *.tlh *.bak *.[Cc]ache *.ilk *.log *.lib *.sbr *.scc *.DotSettings [Bb]in [Dd]ebug*/** obj/ [Rr]elease*/** _ReSharper*...
<p>The new things are related to MSTest stuff. This is the one that I use:</p> <pre><code># use glob syntax syntax: glob *.obj *.pdb *.user *.aps *.pch *.vspscc *.vssscc *_i.c *_p.c *.ncb *.suo *.tlb *.tlh *.bak *.[Cc]ache *.ilk *.log *.lib *.sbr *.scc *.DotSettings [Bb]in [Dd]ebug*/** obj/ [Rr]elease*/** _ReSharper*...
802, 14456, 31419, 33953
hgignore, mercurial, visual-studio, visual-studio-2010
<h1>Mercurial .hgignore for Visual Studio 2010 projects</h1> <p>Not to be confused with <a href="https://stackoverflow.com/questions/34784/mercurial-hgignore-for-visual-studio-2008-projects">Mercurial .hgignore for Visual Studio 2008 projects</a></p> <p>I was asking whether if that same file can be reused for Visual S...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,800
mercurial
# Mercurial .hgignore for Visual Studio 2010 projects Not to be confused with [Mercurial .hgignore for Visual Studio 2008 projects](https://stackoverflow.com/questions/34784/mercurial-hgignore-for-visual-studio-2008-projects) I was asking whether if that same file can be reused for Visual Studio 2010, or some other e...
The new things are related to MSTest stuff. This is the one that I use: ``` # use glob syntax syntax: glob *.obj *.pdb *.user *.aps *.pch *.vspscc *.vssscc *_i.c *_p.c *.ncb *.suo *.tlb *.tlh *.bak *.[Cc]ache *.ilk *.log *.lib *.sbr *.scc *.DotSettings [Bb]in [Dd]ebug*/** obj/ [Rr]elease*/** _ReSharper*/** NDependOut...
4099345
Is it possible to reopen a closed branch in Mercurial?
136
2010-11-04 17:20:50
<p>I understand that it is possible to close a named branch in Mercurial, so that it will not appear in the <code>hg branches</code> list:</p> <pre><code>hg commit --close-branch -m 'close badbranch, this approach never worked' </code></pre> <p>Is it possible to later re-open the branch if need be?</p>
36,512
104,894
2016-07-28 19:27:44
4,101,279
168
2010-11-04 20:53:49
479,199
2010-11-04 20:53:49
https://stackoverflow.com/q/4099345
https://stackoverflow.com/a/4101279
<p>You can just <code>hg update</code> to the closed branch then do another <code>hg commit</code> and it will automatically reopen.</p> <p>The <code>closed</code> flag is just used to filter out closed branches from <code>hg branches</code> and <code>hg heads</code> unless you use the <code>--closed</code> option - i...
<p>You can just <code>hg update</code> to the closed branch then do another <code>hg commit</code> and it will automatically reopen.</p> <p>The <code>closed</code> flag is just used to filter out closed branches from <code>hg branches</code> and <code>hg heads</code> unless you use the <code>--closed</code> option - i...
802
mercurial
<h1>Is it possible to reopen a closed branch in Mercurial?</h1> <p>I understand that it is possible to close a named branch in Mercurial, so that it will not appear in the <code>hg branches</code> list:</p> <pre><code>hg commit --close-branch -m 'close badbranch, this approach never worked' </code></pre> <p>Is it pos...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,801
mercurial
# Is it possible to reopen a closed branch in Mercurial? I understand that it is possible to close a named branch in Mercurial, so that it will not appear in the `hg branches` list: ``` hg commit --close-branch -m 'close badbranch, this approach never worked' ``` Is it possible to later re-open the branch if need be...
You can just `hg update` to the closed branch then do another `hg commit` and it will automatically reopen. The `closed` flag is just used to filter out closed branches from `hg branches` and `hg heads` unless you use the `--closed` option - it doesn't prevent you from using the branches.
2107330
How to get a specific version of a file in Mercurial?
127
2010-01-21 06:33:19
<p>I am new to Mercurial. Just cannot find the right command. Tried update/checkout with no luck. I am using local repository. Thanks</p>
50,749
155,253
2018-09-18 16:47:59
2,109,936
168
2010-01-21 14:32:16
158,226
2012-08-17 13:42:37
https://stackoverflow.com/q/2107330
https://stackoverflow.com/a/2109936
<p>I think you want <code>hg revert -r&lt;rev&gt; &lt;file&gt;</code> (this will change that file to be as it was at the given revision).</p>
<p>I think you want <code>hg revert -r&lt;rev&gt; &lt;file&gt;</code> (this will change that file to be as it was at the given revision).</p>
802
mercurial
<h1>How to get a specific version of a file in Mercurial?</h1> <p>I am new to Mercurial. Just cannot find the right command. Tried update/checkout with no luck. I am using local repository. Thanks</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,802
mercurial
# How to get a specific version of a file in Mercurial? I am new to Mercurial. Just cannot find the right command. Tried update/checkout with no luck. I am using local repository. Thanks
I think you want `hg revert -r<rev> <file>` (this will change that file to be as it was at the given revision).
3227988
Closing Hg Branches
111
2010-07-12 11:19:48
<p>When using <code>hg branch FeatureBranchName</code> and publishing it to a central repo that is shared amongst developers, is there a way to eventually close the <code>FeatureBranchName</code> when its development has officially been merged with the default branch?</p> <p>It would also be helpful if the <code>Featu...
92,066
11,760
2019-03-20 18:48:36
3,228,023
168
2010-07-12 11:23:48
6,309
2017-06-20 16:45:42
https://stackoverflow.com/q/3227988
https://stackoverflow.com/a/3228023
<pre><code>hg commit --close-branch </code></pre> <p>should be enough to mark a branch close. (see <a href="http://www.selenic.com/mercurial/hg.1.html#commit" rel="noreferrer"><code>hg commit</code></a>)</p> <pre><code>--close-branch </code></pre> <blockquote> <p>mark a branch as closed, hiding it from the branch ...
<pre><code>hg commit --close-branch </code></pre> <p>should be enough to mark a branch close. (see <a href="http://www.selenic.com/mercurial/hg.1.html#commit" rel="noreferrer"><code>hg commit</code></a>)</p> <pre><code>--close-branch </code></pre> <blockquote> <p>mark a branch as closed, hiding it from the branch ...
802
mercurial
<h1>Closing Hg Branches</h1> <p>When using <code>hg branch FeatureBranchName</code> and publishing it to a central repo that is shared amongst developers, is there a way to eventually close the <code>FeatureBranchName</code> when its development has officially been merged with the default branch?</p> <p>It would also ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,803
mercurial
# Closing Hg Branches When using `hg branch FeatureBranchName` and publishing it to a central repo that is shared amongst developers, is there a way to eventually close the `FeatureBranchName` when its development has officially been merged with the default branch? It would also be helpful if the `FeatureBranchName` ...
``` hg commit --close-branch ``` should be enough to mark a branch close. (see [`hg commit`](http://www.selenic.com/mercurial/hg.1.html#commit)) ``` --close-branch ``` > mark a branch as closed, hiding it from the branch list. See also [this thread](https://www.mercurial-scm.org/pipermail/mercurial/2009-July/026693...
3804102
How set the default repository
112
2010-09-27 13:11:41
<p>How can I set default remote repository for mercurial local repository?</p>
43,295
205,270
2020-11-19 15:40:10
3,804,165
164
2010-09-27 13:20:44
8,368
2020-11-19 15:40:10
https://stackoverflow.com/q/3804102
https://stackoverflow.com/a/3804165
<p>It's in the .hg/hgrc file.</p> <pre><code>[paths] default = https://myserver/hg/repo1 default:pushurl = /home/me/mytestrepo </code></pre>
<p>It's in the .hg/hgrc file.</p> <pre><code>[paths] default = https://myserver/hg/repo1 default:pushurl = /home/me/mytestrepo </code></pre>
802
mercurial
<h1>How set the default repository</h1> <p>How can I set default remote repository for mercurial local repository?</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,804
mercurial
# How set the default repository How can I set default remote repository for mercurial local repository?
It's in the .hg/hgrc file. ``` [paths] default = https://myserver/hg/repo1 default:pushurl = /home/me/mytestrepo ```
2175427
How can I recover a removed file in Mercurial (if at all)?
107
2010-02-01 08:28:12
<p>Accidentally, by using a GUI as opposed to CLI, I removed every file in a Mercurial project.</p> <p>I recovered with Revert ok and lost some work, which as I have time machine I could easily get back. But is there a way of un-remove/undelete such files? Trawled through the manual and googled but cannot see anything...
55,635
2,477,178
2018-02-20 12:38:31
3,174,414
158
2010-07-04 10:54:15
205,821
2010-07-04 10:54:15
https://stackoverflow.com/q/2175427
https://stackoverflow.com/a/3174414
<p>First, use <code>hg grep</code> to find the deleted file you wish to recover. The output of this command will show you the last revision for which the file was present, and the path to the deleted file. Second, run <code>hg revert -r &lt;revision number&gt; &lt;path to deleted file&gt;</code> The deleted file will ...
<p>First, use <code>hg grep</code> to find the deleted file you wish to recover. The output of this command will show you the last revision for which the file was present, and the path to the deleted file. Second, run <code>hg revert -r &lt;revision number&gt; &lt;path to deleted file&gt;</code> The deleted file will ...
802
mercurial
<h1>How can I recover a removed file in Mercurial (if at all)?</h1> <p>Accidentally, by using a GUI as opposed to CLI, I removed every file in a Mercurial project.</p> <p>I recovered with Revert ok and lost some work, which as I have time machine I could easily get back. But is there a way of un-remove/undelete such f...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,805
mercurial
# How can I recover a removed file in Mercurial (if at all)? Accidentally, by using a GUI as opposed to CLI, I removed every file in a Mercurial project. I recovered with Revert ok and lost some work, which as I have time machine I could easily get back. But is there a way of un-remove/undelete such files? Trawled th...
First, use `hg grep` to find the deleted file you wish to recover. The output of this command will show you the last revision for which the file was present, and the path to the deleted file. Second, run `hg revert -r <revision number> <path to deleted file>` The deleted file will now be in your working copy, ready to ...
3789442
Mercurial - all files that changed in a changeset?
105
2010-09-24 17:15:05
<p>How can you determine all the files that changed in a given changeset? </p> <p>I'm not looking for a diff in this case, just a list of add/remove/modifications.</p> <p><code>hg log -vprX</code> does a list of diffs but I just want the files.</p>
67,691
47,281
2018-05-15 17:27:34
3,789,516
157
2010-09-24 17:27:16
432,745
2010-09-24 17:27:16
https://stackoverflow.com/q/3789442
https://stackoverflow.com/a/3789516
<p>If you want to list only files that have changed then you should be using "status command" The following will list the changes to files in revision REV</p> <pre><code>hg status --change REV </code></pre>
<p>If you want to list only files that have changed then you should be using "status command" The following will list the changes to files in revision REV</p> <pre><code>hg status --change REV </code></pre>
606, 802, 20848
changeset, diff, mercurial
<h1>Mercurial - all files that changed in a changeset?</h1> <p>How can you determine all the files that changed in a given changeset? </p> <p>I'm not looking for a diff in this case, just a list of add/remove/modifications.</p> <p><code>hg log -vprX</code> does a list of diffs but I just want the files.</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,806
mercurial
# Mercurial - all files that changed in a changeset? How can you determine all the files that changed in a given changeset? I'm not looking for a diff in this case, just a list of add/remove/modifications. `hg log -vprX` does a list of diffs but I just want the files.
If you want to list only files that have changed then you should be using "status command" The following will list the changes to files in revision REV ``` hg status --change REV ```
4665549
Mercurial move changes to a new branch
126
2011-01-12 05:11:58
<p>I have a number of changes that I committed to my local repository, but have not yet been pushed. Since on a feature is taking longer than expected, I want to swap these changes onto a named branch before I push. How can I do this?</p>
35,802
165,495
2018-02-22 10:24:49
4,673,148
156
2011-01-12 19:31:42
151,299
2017-09-25 08:33:58
https://stackoverflow.com/q/4665549
https://stackoverflow.com/a/4673148
<p>As suggested by Mark, the <em>MqExtension</em> is one solution for you problem. IMHO a simpler workflow is to use the <a href="https://www.mercurial-scm.org/wiki/RebaseExtension" rel="noreferrer">rebase extension</a>. Suppose you have a history like this:</p> <pre><code>@ changeset: 2:81b92083cb1d | tag: ...
<p>As suggested by Mark, the <em>MqExtension</em> is one solution for you problem. IMHO a simpler workflow is to use the <a href="https://www.mercurial-scm.org/wiki/RebaseExtension" rel="noreferrer">rebase extension</a>. Suppose you have a history like this:</p> <pre><code>@ changeset: 2:81b92083cb1d | tag: ...
802, 1879
branch, mercurial
<h1>Mercurial move changes to a new branch</h1> <p>I have a number of changes that I committed to my local repository, but have not yet been pushed. Since on a feature is taking longer than expected, I want to swap these changes onto a named branch before I push. How can I do this?</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,807
mercurial
# Mercurial move changes to a new branch I have a number of changes that I committed to my local repository, but have not yet been pushed. Since on a feature is taking longer than expected, I want to swap these changes onto a named branch before I push. How can I do this?
As suggested by Mark, the *MqExtension* is one solution for you problem. IMHO a simpler workflow is to use the [rebase extension](https://www.mercurial-scm.org/wiki/RebaseExtension). Suppose you have a history like this: ``` @ changeset: 2:81b92083cb1d | tag: tip | summary: my new feature: edit file a...
2540454
Mercurial — revert back to old version and continue from there
255
2010-03-29 18:53:43
<p>I'm using Mercurial locally for a project (it's the only repo there's no pushing/pulling to/from anywhere else).</p> <p>To date it's got a linear history. However, the current thing I'm working on I've now realized is a terrible approach and I want to go back to the version before I started it and implement it a d...
185,530
223,806
2018-02-01 11:05:42
2,540,480
152
2010-03-29 18:56:50
99,594
2010-03-29 18:56:50
https://stackoverflow.com/q/2540454
https://stackoverflow.com/a/2540480
<pre><code>hg update [-r REV] </code></pre> <p>If later you commit, you will effectively create a new branch. Then you might continue working only on this branch or eventually merge the existing one into it.</p>
<pre><code>hg update [-r REV] </code></pre> <p>If later you commit, you will effectively create a new branch. Then you might continue working only on this branch or eventually merge the existing one into it.</p>
456, 802, 1879, 3346, 12309
branch, dvcs, mercurial, revert, version-control
<h1>Mercurial — revert back to old version and continue from there</h1> <p>I'm using Mercurial locally for a project (it's the only repo there's no pushing/pulling to/from anywhere else).</p> <p>To date it's got a linear history. However, the current thing I'm working on I've now realized is a terrible approach and I...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,808
mercurial
# Mercurial — revert back to old version and continue from there I'm using Mercurial locally for a project (it's the only repo there's no pushing/pulling to/from anywhere else). To date it's got a linear history. However, the current thing I'm working on I've now realized is a terrible approach and I want to go back ...
``` hg update [-r REV] ``` If later you commit, you will effectively create a new branch. Then you might continue working only on this branch or eventually merge the existing one into it.
860761
Changing Mercurial "Default" Parent URL
126
2009-05-13 22:31:30
<p>Let's say I have a Mercurial repository and I'm pulling from a default parent URL (the source I cloned it from).</p> <p>Now I want to change the default parent URL (hostname change, or it was copied to another machine, etc.). Is there a way to do this, or do I have to re-clone from the new URL?</p>
29,251
79
2016-07-12 19:41:15
872,144
150
2009-05-16 10:29:11
107,349
2009-05-16 10:29:11
https://stackoverflow.com/q/860761
https://stackoverflow.com/a/872144
<p>You can even add multiple entries in the [paths] section of your .hg/hgrc file.</p> <pre><code>[paths] default = /repo_store/hg/project1 sandbox = /repo_store/hg/project1_experimental </code></pre> <p>And then can specify its alias in the mercurial commands. default repo need not be specified but others have to be...
<p>You can even add multiple entries in the [paths] section of your .hg/hgrc file.</p> <pre><code>[paths] default = /repo_store/hg/project1 sandbox = /repo_store/hg/project1_experimental </code></pre> <p>And then can specify its alias in the mercurial commands. default repo need not be specified but others have to be...
802
mercurial
<h1>Changing Mercurial "Default" Parent URL</h1> <p>Let's say I have a Mercurial repository and I'm pulling from a default parent URL (the source I cloned it from).</p> <p>Now I want to change the default parent URL (hostname change, or it was copied to another machine, etc.). Is there a way to do this, or do I have t...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,809
mercurial
# Changing Mercurial "Default" Parent URL Let's say I have a Mercurial repository and I'm pulling from a default parent URL (the source I cloned it from). Now I want to change the default parent URL (hostname change, or it was copied to another machine, etc.). Is there a way to do this, or do I have to re-clone from ...
You can even add multiple entries in the [paths] section of your .hg/hgrc file. ``` [paths] default = /repo_store/hg/project1 sandbox = /repo_store/hg/project1_experimental ``` And then can specify its alias in the mercurial commands. default repo need not be specified but others have to be like, ``` hg in ...
14771946
How to get the remote server hg path?
103
2013-02-08 11:52:07
<p>I have created a remote repo to push my local changes over ssl. I did <code>hg showconfig --debug</code> to find my remote hg path but it's output is messy. Can someone point me how to exactly find it?</p>
49,359
1,109,196
2022-12-19 07:12:50
14,780,184
150
2013-02-08 19:46:19
479,199
2013-02-08 19:46:19
https://stackoverflow.com/q/14771946
https://stackoverflow.com/a/14780184
<p><code>hg paths</code> gives the relationship between each path name and its url.</p> <pre><code>&gt; hg paths default = ssh://hg@example.org/repo local = /local/path/to/repo </code></pre> <p><code>hg paths &lt;name&gt;</code> gives the url for the name.</p> <pre><code>&gt; hg paths default ssh://hg@example.org/re...
<p><code>hg paths</code> gives the relationship between each path name and its url.</p> <pre><code>&gt; hg paths default = ssh://hg@example.org/repo local = /local/path/to/repo </code></pre> <p><code>hg paths &lt;name&gt;</code> gives the url for the name.</p> <pre><code>&gt; hg paths default ssh://hg@example.org/re...
802, 34046, 135055
hg-paths, hgrc, mercurial
<h1>How to get the remote server hg path?</h1> <p>I have created a remote repo to push my local changes over ssl. I did <code>hg showconfig --debug</code> to find my remote hg path but it's output is messy. Can someone point me how to exactly find it?</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,810
mercurial
# How to get the remote server hg path? I have created a remote repo to push my local changes over ssl. I did `hg showconfig --debug` to find my remote hg path but it's output is messy. Can someone point me how to exactly find it?
`hg paths` gives the relationship between each path name and its url. ``` > hg paths default = ssh://hg@example.org/repo local = /local/path/to/repo ``` `hg paths <name>` gives the url for the name. ``` > hg paths default ssh://hg@example.org/repo > hg paths local /local/path/to/repo ``` BTW, to get just the path ...
4956346
How can I add remote repositories in Mercurial?
107
2011-02-10 11:13:14
<p>I am working with Git repositories in the following way:</p> <ul> <li>I have the master repository and several remotes on the different production machines. </li> <li>I am pushing the production code to the remotes and restart the services for the changes to take effect. </li> </ul> <p>I am about to switch from Gi...
40,038
226,394
2022-02-12 13:34:47
4,959,205
137
2011-02-10 15:42:44
8,992
2011-02-10 15:42:44
https://stackoverflow.com/q/4956346
https://stackoverflow.com/a/4959205
<p>You add entries to the <code>[paths]</code> section of your local clone's <code>.hg/hgrc</code> file. Here's an example of a section that would go in the <code>.hg/hgrc</code> file:</p> <pre><code>[paths] remote1 = http://path/to/remote1 remote2 = http://path/to/remote2 </code></pre> <p>You can then use commands ...
<p>You add entries to the <code>[paths]</code> section of your local clone's <code>.hg/hgrc</code> file. Here's an example of a section that would go in the <code>.hg/hgrc</code> file:</p> <pre><code>[paths] remote1 = http://path/to/remote1 remote2 = http://path/to/remote2 </code></pre> <p>You can then use commands ...
802, 7330, 135055
hg-paths, mercurial, repository
<h1>How can I add remote repositories in Mercurial?</h1> <p>I am working with Git repositories in the following way:</p> <ul> <li>I have the master repository and several remotes on the different production machines. </li> <li>I am pushing the production code to the remotes and restart the services for the changes to ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,811
mercurial
# How can I add remote repositories in Mercurial? I am working with Git repositories in the following way: - I have the master repository and several remotes on the different production machines. - I am pushing the production code to the remotes and restart the services for the changes to take effect. I am about to ...
You add entries to the `[paths]` section of your local clone's `.hg/hgrc` file. Here's an example of a section that would go in the `.hg/hgrc` file: ``` [paths] remote1 = http://path/to/remote1 remote2 = http://path/to/remote2 ``` You can then use commands like `hg push remote1` to send changesets to that repo. If yo...
9586346
Virtualenv and source version control
100
2012-03-06 15:11:49
<p>I recently started a Django project and I quickly realized that virtualenv will be really useful for many reasons. I set up the virtualenv and my project, but now I wonder what file I should add to my source control (in my case, Mercurial). Should I add all the files under the venv folder? How do I make sure a colle...
23,293
42,024
2016-06-10 09:13:49
9,586,604
136
2012-03-06 15:26:29
654,031
2012-03-06 15:26:29
https://stackoverflow.com/q/9586346
https://stackoverflow.com/a/9586604
<p>You generate a "requirements" file (usually <code>requirements.txt</code>) that you commit with your project:</p> <pre><code>pip freeze &gt; requirements.txt </code></pre> <p>Then, each developer will set up their own virtualenv and run:</p> <pre><code>pip install -r requirements.txt </code></pre>
<p>You generate a "requirements" file (usually <code>requirements.txt</code>) that you commit with your project:</p> <pre><code>pip freeze &gt; requirements.txt </code></pre> <p>Then, each developer will set up their own virtualenv and run:</p> <pre><code>pip install -r requirements.txt </code></pre>
16, 243, 802, 14529
django, mercurial, python, virtualenv
<h1>Virtualenv and source version control</h1> <p>I recently started a Django project and I quickly realized that virtualenv will be really useful for many reasons. I set up the virtualenv and my project, but now I wonder what file I should add to my source control (in my case, Mercurial). Should I add all the files un...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,812
mercurial
# Virtualenv and source version control I recently started a Django project and I quickly realized that virtualenv will be really useful for many reasons. I set up the virtualenv and my project, but now I wonder what file I should add to my source control (in my case, Mercurial). Should I add all the files under the v...
You generate a "requirements" file (usually `requirements.txt`) that you commit with your project: ``` pip freeze > requirements.txt ``` Then, each developer will set up their own virtualenv and run: ``` pip install -r requirements.txt ```
3459161
How to view revision history for Mercurial file?
112
2010-08-11 14:08:09
<p>For a given file in a Mercurial repository, how can you see the revision history?</p> <p>And how can you diff two revisions of the file? </p> <p>Ideally doing all this with visual tools (we use ExamDiff to do some other diffs).</p> <p>I'd say this is basic source control functionality but I can't seem to figure ...
85,953
47,281
2018-02-22 10:36:56
3,459,300
135
2010-08-11 14:21:10
251,311
2010-08-11 14:21:10
https://stackoverflow.com/q/3459161
https://stackoverflow.com/a/3459300
<pre><code>hg log file hg diff -r 10 -r 20 file </code></pre>
<pre><code>hg log file hg diff -r 10 -r 20 file </code></pre>
606, 802, 1555
diff, mercurial, revision
<h1>How to view revision history for Mercurial file?</h1> <p>For a given file in a Mercurial repository, how can you see the revision history?</p> <p>And how can you diff two revisions of the file? </p> <p>Ideally doing all this with visual tools (we use ExamDiff to do some other diffs).</p> <p>I'd say this is basi...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,813
mercurial
# How to view revision history for Mercurial file? For a given file in a Mercurial repository, how can you see the revision history? And how can you diff two revisions of the file? Ideally doing all this with visual tools (we use ExamDiff to do some other diffs). I'd say this is basic source control functionality b...
``` hg log file hg diff -r 10 -r 20 file ```
4313944
What is TortoiseHg Overlay Icon Server
57
2010-11-30 12:50:29
<p>I just install TortoiseHg, to act as Mercurial client tool.</p> <p>However, in my Vista, whenever I start, there is a <code>TortoiseHg Overlay Icon Server</code> at my notification bar.</p> <p>Is quite annoying. What is the purpose of that? Can I disable it?</p>
16,397
72,437
2012-10-31 13:16:29
5,690,948
134
2011-04-17 01:55:17
365,102
2011-08-29 00:05:34
https://stackoverflow.com/q/4313944
https://stackoverflow.com/a/5690948
<p>The notification icon is part of a service* which gives us those handy <a href="http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-dug-wcstatus.html#tsvn-dug-wcstatus-1" rel="noreferrer">icons</a> on the corner of version-controlled files/folders. (The little icons demonstrate whether the file is "up-to-date", ...
<p>The notification icon is part of a service* which gives us those handy <a href="http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-dug-wcstatus.html#tsvn-dug-wcstatus-1" rel="noreferrer">icons</a> on the corner of version-controlled files/folders. (The little icons demonstrate whether the file is "up-to-date", ...
8122
tortoisehg
<h1>What is TortoiseHg Overlay Icon Server</h1> <p>I just install TortoiseHg, to act as Mercurial client tool.</p> <p>However, in my Vista, whenever I start, there is a <code>TortoiseHg Overlay Icon Server</code> at my notification bar.</p> <p>Is quite annoying. What is the purpose of that? Can I disable it?</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,814
mercurial
# What is TortoiseHg Overlay Icon Server I just install TortoiseHg, to act as Mercurial client tool. However, in my Vista, whenever I start, there is a `TortoiseHg Overlay Icon Server` at my notification bar. Is quite annoying. What is the purpose of that? Can I disable it?
The notification icon is part of a service* which gives us those handy [icons](http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-dug-wcstatus.html#tsvn-dug-wcstatus-1) on the corner of version-controlled files/folders. (The little icons demonstrate whether the file is "up-to-date", modified, etc.) --- If you wa...
2228188
Finding the author of a line of code in Mercurial
120
2010-02-09 10:05:32
<p>How do I find out who is responsible for a specific line of code? I know the linenumber and the filename but I would like Mercurial to tell me the author(s) of that specific line of code. Is there a command for that?</p>
44,984
17,500
2024-04-30 07:14:47
2,228,395
132
2010-02-09 10:44:39
158,226
2013-03-18 14:21:40
https://stackoverflow.com/q/2228188
https://stackoverflow.com/a/2228395
<p>On the command-line, you'd want to use <code>hg annotate -u</code> (<code>-u</code> can be combined with <code>-n</code> to get the local revision number, which might come in useful). Check <code>hg help anno</code> for more options.</p>
<p>On the command-line, you'd want to use <code>hg annotate -u</code> (<code>-u</code> can be combined with <code>-n</code> to get the local revision number, which might come in useful). Check <code>hg help anno</code> for more options.</p>
802
mercurial
<h1>Finding the author of a line of code in Mercurial</h1> <p>How do I find out who is responsible for a specific line of code? I know the linenumber and the filename but I would like Mercurial to tell me the author(s) of that specific line of code. Is there a command for that?</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,815
mercurial
# Finding the author of a line of code in Mercurial How do I find out who is responsible for a specific line of code? I know the linenumber and the filename but I would like Mercurial to tell me the author(s) of that specific line of code. Is there a command for that?
On the command-line, you'd want to use `hg annotate -u` (`-u` can be combined with `-n` to get the local revision number, which might come in useful). Check `hg help anno` for more options.
2139165
Delete all local changesets and revert to tree
95
2010-01-26 11:58:06
<p>I'm using Mercurial and I've got into a terrible mess locally, with three heads. I can't push, and I just want to delete all my local changes and commits and start again with totally clean code and a clean history.</p> <p>In other words, I want to end up with (a) exactly the same code locally as exists in the tip o...
40,770
194,000
2018-12-17 19:42:48
2,143,711
132
2010-01-27 00:18:10
209,605
2018-12-17 19:42:48
https://stackoverflow.com/q/2139165
https://stackoverflow.com/a/2143711
<p>When the simplest way (a new <code>hg clone</code>) isn't practical, I use <code>hg strip</code>:</p> <pre><code>% hg outgoing -l 1 % hg strip $rev # replace $rev with the revision number from outgoing </code></pre> <p>Repeat until <code>hg outgoing</code> stays quiet. Note that <code>hg strip $rev</code> oblitera...
<p>When the simplest way (a new <code>hg clone</code>) isn't practical, I use <code>hg strip</code>:</p> <pre><code>% hg outgoing -l 1 % hg strip $rev # replace $rev with the revision number from outgoing </code></pre> <p>Repeat until <code>hg outgoing</code> stays quiet. Note that <code>hg strip $rev</code> oblitera...
456, 802, 3346, 17492
dvcs, head, mercurial, version-control
<h1>Delete all local changesets and revert to tree</h1> <p>I'm using Mercurial and I've got into a terrible mess locally, with three heads. I can't push, and I just want to delete all my local changes and commits and start again with totally clean code and a clean history.</p> <p>In other words, I want to end up with ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,816
mercurial
# Delete all local changesets and revert to tree I'm using Mercurial and I've got into a terrible mess locally, with three heads. I can't push, and I just want to delete all my local changes and commits and start again with totally clean code and a clean history. In other words, I want to end up with (a) exactly the ...
When the simplest way (a new `hg clone`) isn't practical, I use `hg strip`: ``` % hg outgoing -l 1 % hg strip $rev # replace $rev with the revision number from outgoing ``` Repeat until `hg outgoing` stays quiet. Note that `hg strip $rev` obliterates `$rev` and all its descendants. Note that you may have to [first e...
2570087
How to abandon an uncommitted hg merge?
139
2010-04-03 02:58:42
<p>I'm new to collaborating with Mercurial. My situation:</p> <ul> <li>Another programmer changed rev 1 of a file to replace 4-space indents with 2-space indent. (I.e. changed every line.) Call that rev 2, pushed to the remote repo.</li> <li>I've committed substantive changes rev 1 with various code changes in my loca...
87,713
167,531
2024-01-30 18:03:29
2,570,202
130
2010-04-03 04:14:55
46,642
2010-04-03 04:23:20
https://stackoverflow.com/q/2570087
https://stackoverflow.com/a/2570202
<p>You can discard uncommitted changes with the -C (or --clean) flag:</p> <pre><code>hg update -C -r 3 </code></pre> <p>BEWARE: Everything that was not committed will be gone!</p> <p>After that you should probably use some kind of code formatter tool to do the entire operation, or at least some find and replace with...
<p>You can discard uncommitted changes with the -C (or --clean) flag:</p> <pre><code>hg update -C -r 3 </code></pre> <p>BEWARE: Everything that was not committed will be gone!</p> <p>After that you should probably use some kind of code formatter tool to do the entire operation, or at least some find and replace with...
717, 802
mercurial, merge
<h1>How to abandon an uncommitted hg merge?</h1> <p>I'm new to collaborating with Mercurial. My situation:</p> <ul> <li>Another programmer changed rev 1 of a file to replace 4-space indents with 2-space indent. (I.e. changed every line.) Call that rev 2, pushed to the remote repo.</li> <li>I've committed substantive c...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,817
mercurial
# How to abandon an uncommitted hg merge? I'm new to collaborating with Mercurial. My situation: - Another programmer changed rev 1 of a file to replace 4-space indents with 2-space indent. (I.e. changed every line.) Call that rev 2, pushed to the remote repo. - I've committed substantive changes rev 1 with various c...
You can discard uncommitted changes with the -C (or --clean) flag: ``` hg update -C -r 3 ``` BEWARE: Everything that was not committed will be gone! After that you should probably use some kind of code formatter tool to do the entire operation, or at least some find and replace with regular expressions. Something as...
890723
Named Branches vs Multiple Repositories
130
2009-05-20 23:20:48
<p>We're currently using subversion on a relatively large codebase. Each release gets its own branch, and fixes are performed against the trunk and migrated into release branches using <code>svnmerge.py</code></p> <p>I believe the time has come to move on to better source control, and I've been toying with Mercurial f...
20,281
66,713
2019-02-07 09:54:45
890,892
129
2009-05-21 00:27:38
110,204
2018-02-22 09:52:09
https://stackoverflow.com/q/890723
https://stackoverflow.com/a/890892
<p>The biggest difference is how the branch names are recorded in the history. With named branches the branch name is <em>embedded</em> in each changeset and will thus become an immutable part of the history. With clones there will be <em>no permanent</em> record of where a particular changeset came from.</p> <p>This ...
<p>The biggest difference is how the branch names are recorded in the history. With named branches the branch name is <em>embedded</em> in each changeset and will thus become an immutable part of the history. With clones there will be <em>no permanent</em> record of where a particular changeset came from.</p> <p>This ...
456, 802, 1879, 3346
branch, dvcs, mercurial, version-control
<h1>Named Branches vs Multiple Repositories</h1> <p>We're currently using subversion on a relatively large codebase. Each release gets its own branch, and fixes are performed against the trunk and migrated into release branches using <code>svnmerge.py</code></p> <p>I believe the time has come to move on to better sour...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,818
mercurial
# Named Branches vs Multiple Repositories We're currently using subversion on a relatively large codebase. Each release gets its own branch, and fixes are performed against the trunk and migrated into release branches using `svnmerge.py` I believe the time has come to move on to better source control, and I've been t...
The biggest difference is how the branch names are recorded in the history. With named branches the branch name is *embedded* in each changeset and will thus become an immutable part of the history. With clones there will be *no permanent* record of where a particular changeset came from. This means that clones are gr...
1401803
How do you set the username that Mercurial uses for commits?
88
2009-09-09 20:08:32
<p>When I commit something in Mercurial like this:</p> <pre><code>hg commit -m "username question" </code></pre> <p>I see this output:</p> <pre><code>No username found, using 'WindowsVistaAdmin@ChunkyMonkey' instead </code></pre> <p><code>ChunkyMonkey</code> is my Windows machine name and obviously <code>WindowsVis...
80,254
170,562
2017-01-17 18:21:37
1,401,819
128
2009-09-09 20:10:37
2,363
2009-09-09 20:10:37
https://stackoverflow.com/q/1401803
https://stackoverflow.com/a/1401819
<p>In your <code>~/.hgrc</code> (*nix) or <code>mercurial.ini</code> (Windows) file:</p> <pre><code>[ui] username = First Last &lt;email@address.com&gt; </code></pre> <p>(<code>mercurial.ini</code> is in <code>C:\Documents and Settings\[username]\</code> for XP and lower, <code>C:\Users\[username]\</code> for Vista a...
<p>In your <code>~/.hgrc</code> (*nix) or <code>mercurial.ini</code> (Windows) file:</p> <pre><code>[ui] username = First Last &lt;email@address.com&gt; </code></pre> <p>(<code>mercurial.ini</code> is in <code>C:\Documents and Settings\[username]\</code> for XP and lower, <code>C:\Users\[username]\</code> for Vista a...
802
mercurial
<h1>How do you set the username that Mercurial uses for commits?</h1> <p>When I commit something in Mercurial like this:</p> <pre><code>hg commit -m "username question" </code></pre> <p>I see this output:</p> <pre><code>No username found, using 'WindowsVistaAdmin@ChunkyMonkey' instead </code></pre> <p><code>ChunkyM...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,819
mercurial
# How do you set the username that Mercurial uses for commits? When I commit something in Mercurial like this: ``` hg commit -m "username question" ``` I see this output: ``` No username found, using 'WindowsVistaAdmin@ChunkyMonkey' instead ``` `ChunkyMonkey` is my Windows machine name and obviously `WindowsVistaA...
In your `~/.hgrc` (*nix) or `mercurial.ini` (Windows) file: ``` [ui] username = First Last <email@address.com> ``` (`mercurial.ini` is in `C:\Documents and Settings\[username]\` for XP and lower, `C:\Users\[username]\` for Vista and higher. You can also run `hgtk userconfig` if you have TortoiseHg installed and do it...
9598704
Consequences of using graft in Mercurial
97
2012-03-07 09:24:09
<p>There've been several questions recently about skipping changes when maintaining release branches in Mercurial. For example:</p> <ul> <li><a href="https://stackoverflow.com/questions/9532823/mercurial-branch-specific-changes-keep-coming-back-after-dummy-merge">Mercurial: Branch specific changes keep coming back aft...
20,747
309,760
2014-12-04 14:26:07
9,605,306
118
2012-03-07 16:24:43
110,204
2014-12-04 14:26:07
https://stackoverflow.com/q/9598704
https://stackoverflow.com/a/9605306
<p>When you update to <code>D</code> and graft <code>F::J</code>, Mercurial runs a number of merges. It will start with this merge:</p> <pre><code>M = three_way_merge(local=D, other=F, base=E) </code></pre> <p>If we write <code>+d</code> for the delta between the states <code>C</code> and <code>D</code>, then we star...
<p>When you update to <code>D</code> and graft <code>F::J</code>, Mercurial runs a number of merges. It will start with this merge:</p> <pre><code>M = three_way_merge(local=D, other=F, base=E) </code></pre> <p>If we write <code>+d</code> for the delta between the states <code>C</code> and <code>D</code>, then we star...
456, 802, 1879, 3346, 36489
branch, cherry-pick, dvcs, mercurial, version-control
<h1>Consequences of using graft in Mercurial</h1> <p>There've been several questions recently about skipping changes when maintaining release branches in Mercurial. For example:</p> <ul> <li><a href="https://stackoverflow.com/questions/9532823/mercurial-branch-specific-changes-keep-coming-back-after-dummy-merge">Mercu...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,820
mercurial
# Consequences of using graft in Mercurial There've been several questions recently about skipping changes when maintaining release branches in Mercurial. For example: - [Mercurial: Branch specific changes keep coming back after dummy merge](https://stackoverflow.com/questions/9532823/mercurial-branch-specific-change...
When you update to `D` and graft `F::J`, Mercurial runs a number of merges. It will start with this merge: ``` M = three_way_merge(local=D, other=F, base=E) ``` If we write `+d` for the delta between the states `C` and `D`, then we start with: ``` +d +e +f ---- C ---- D ---- E ---- F ---- ``` Turn t...
5627414
Correct way to install Mercurial on Ubuntu
64
2011-04-11 20:50:32
<p>I am kind of new to both, Mercurial and Ubuntu.</p> <p>I seem to have awkwardly installed a few other software packages already, so I wanted to see how others would go about doing this.</p> <p>Should I use the apt-get command? If so, how would I use it in this case? Where is the best place to install Mercurial on ...
77,312
478,573
2025-04-05 00:55:12
5,627,441
117
2011-04-11 20:53:23
null
2013-12-10 13:38:57
https://stackoverflow.com/q/5627414
https://stackoverflow.com/a/5627441
<p>Just use: </p> <pre><code>sudo apt-get install mercurial </code></pre> <p>It should install it in the default folder and update your environment variables correctly. then you should be able to use 'hg' from the command line, just like svn, although Hg is a much better source control tool. </p>
<p>Just use: </p> <pre><code>sudo apt-get install mercurial </code></pre> <p>It should install it in the default folder and update your environment variables correctly. then you should be able to use 'hg' from the command line, just like svn, although Hg is a much better source control tool. </p>
456, 549, 802
mercurial, ubuntu, version-control
<h1>Correct way to install Mercurial on Ubuntu</h1> <p>I am kind of new to both, Mercurial and Ubuntu.</p> <p>I seem to have awkwardly installed a few other software packages already, so I wanted to see how others would go about doing this.</p> <p>Should I use the apt-get command? If so, how would I use it in this ca...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,821
mercurial
# Correct way to install Mercurial on Ubuntu I am kind of new to both, Mercurial and Ubuntu. I seem to have awkwardly installed a few other software packages already, so I wanted to see how others would go about doing this. Should I use the apt-get command? If so, how would I use it in this case? Where is the best p...
Just use: ``` sudo apt-get install mercurial ``` It should install it in the default folder and update your environment variables correctly. then you should be able to use 'hg' from the command line, just like svn, although Hg is a much better source control tool.
3981043
How to abort a merge in mercurial?
92
2010-10-20 18:24:00
<p>I goofed up a merge. I'd like to revert then try again.<br> Is there a way to revert a merge before it is committed?</p> <p><code>hg revert</code> doesn't do what I'd like, it only reverts the text of the files. Mercurial aborts my second attempt at merging and complains original merge is still uncommitted.</p> ...
35,139
28,817
2021-12-22 15:31:41
3,981,068
114
2010-10-20 18:28:03
167,958
2010-10-20 18:28:03
https://stackoverflow.com/q/3981043
https://stackoverflow.com/a/3981068
<p><code>hg update -C &lt;one of the two merge changesets&gt;</code></p>
<p><code>hg update -C &lt;one of the two merge changesets&gt;</code></p>
456, 717, 802, 3346, 5766
dvcs, mercurial, merge, undo, version-control
<h1>How to abort a merge in mercurial?</h1> <p>I goofed up a merge. I'd like to revert then try again.<br> Is there a way to revert a merge before it is committed?</p> <p><code>hg revert</code> doesn't do what I'd like, it only reverts the text of the files. Mercurial aborts my second attempt at merging and complain...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,823
mercurial
# How to abort a merge in mercurial? I goofed up a merge. I'd like to revert then try again. Is there a way to revert a merge before it is committed? `hg revert` doesn't do what I'd like, it only reverts the text of the files. Mercurial aborts my second attempt at merging and complains original merge is still uncom...
`hg update -C <one of the two merge changesets>`
5164804
Get certificate fingerprint of HTTPS server from command line?
63
2011-03-02 07:56:40
<p>Recently Mercurial has <a href="https://www.mercurial-scm.org/wiki/CACertificates#Changes_in_Mercurial_1.7.x" rel="noreferrer">added</a> certificate validation when connecting to HTTPS servers. I'm trying to clone the wiki repository for a googlecode project at <code>https://wiki.pydlnadms.googlecode.com/hg/</code>,...
106,734
149,482
2020-01-07 10:09:43
5,165,073
114
2011-03-02 08:30:02
319,906
2011-03-02 08:30:02
https://stackoverflow.com/q/5164804
https://stackoverflow.com/a/5165073
<p>The page at <a href="http://wiki.debuntu.org/wiki/OpenSSL#Retrieving_certificate_informations">http://wiki.debuntu.org/wiki/OpenSSL#Retrieving_certificate_informations</a> lists the command lines for that (and printing out the relevant information). From that page and some of the man pages, it seems like what you w...
<p>The page at <a href="http://wiki.debuntu.org/wiki/OpenSSL#Retrieving_certificate_informations">http://wiki.debuntu.org/wiki/OpenSSL#Retrieving_certificate_informations</a> lists the command lines for that (and printing out the relevant information). From that page and some of the man pages, it seems like what you w...
642, 802, 1231, 3682, 5954
certificate, command-line, google-code, https, mercurial
<h1>Get certificate fingerprint of HTTPS server from command line?</h1> <p>Recently Mercurial has <a href="https://www.mercurial-scm.org/wiki/CACertificates#Changes_in_Mercurial_1.7.x" rel="noreferrer">added</a> certificate validation when connecting to HTTPS servers. I'm trying to clone the wiki repository for a googl...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,824
mercurial
# Get certificate fingerprint of HTTPS server from command line? Recently Mercurial has [added](https://www.mercurial-scm.org/wiki/CACertificates#Changes_in_Mercurial_1.7.x) certificate validation when connecting to HTTPS servers. I'm trying to clone the wiki repository for a googlecode project at `https://wiki.pydlna...
The page at <http://wiki.debuntu.org/wiki/OpenSSL#Retrieving_certificate_informations> lists the command lines for that (and printing out the relevant information). From that page and some of the man pages, it seems like what you want is (for bash): ``` openssl s_client -connect <host>:<port> < /dev/null 2>/dev/null |...
14151655
hg strip vs hg backout and hg revert
87
2013-01-04 05:38:26
<p>What is the difference between the mercurial commands, </p> <ul> <li><code>hg strip</code></li> <li><code>hg backout</code></li> <li><code>hg revert</code></li> </ul> <p>All these commands basically are used to revert/undo the effects of an earlier changeset. </p>
55,108
509,134
2019-01-17 16:12:41
14,156,416
112
2013-01-04 11:35:50
501,710
2013-05-29 15:28:25
https://stackoverflow.com/q/14151655
https://stackoverflow.com/a/14156416
<p><code>hg strip</code> removes the changeset and all its descendants from the repository. It will be as if the changes never existed. Be careful when using this on <code>public</code> changesets as it will not remove it from any other repository and you'll get them back next time you pull.</p> <p><code>hg backout<...
<p><code>hg strip</code> removes the changeset and all its descendants from the repository. It will be as if the changes never existed. Be careful when using this on <code>public</code> changesets as it will not remove it from any other repository and you'll get them back next time you pull.</p> <p><code>hg backout<...
802, 8122
mercurial, tortoisehg
<h1>hg strip vs hg backout and hg revert</h1> <p>What is the difference between the mercurial commands, </p> <ul> <li><code>hg strip</code></li> <li><code>hg backout</code></li> <li><code>hg revert</code></li> </ul> <p>All these commands basically are used to revert/undo the effects of an earlier changeset. </p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,825
mercurial
# hg strip vs hg backout and hg revert What is the difference between the mercurial commands, - `hg strip` - `hg backout` - `hg revert` All these commands basically are used to revert/undo the effects of an earlier changeset.
`hg strip` removes the changeset and all its descendants from the repository. It will be as if the changes never existed. Be careful when using this on `public` changesets as it will not remove it from any other repository and you'll get them back next time you pull. `hg backout` creates a new changeset to reverse the...
10299988
How do I diff one branch with my default branch
74
2012-04-24 14:26:12
<p>I switched to a branch on my local repo and noticed it gave me message showing x files updated. This surprised me as I didn't know there were any differences on that branch. How do I compare that branch with the default branch to see what has changed?</p>
33,948
306,098
2018-07-27 15:29:36
10,300,105
112
2012-04-24 14:32:00
19,465
2013-12-11 12:45:04
https://stackoverflow.com/q/10299988
https://stackoverflow.com/a/10300105
<p>Use <code>hg diff -r BRANCH1:BRANCH2</code>, where BRANCH1 and BRANCH2 are the names of the branches. This will show you the differences between the heads of the two branches.</p> <p>You got the message about "x files updated" because there were files changed on the original branch, not necessarily because there w...
<p>Use <code>hg diff -r BRANCH1:BRANCH2</code>, where BRANCH1 and BRANCH2 are the names of the branches. This will show you the differences between the heads of the two branches.</p> <p>You got the message about "x files updated" because there were files changed on the original branch, not necessarily because there w...
802
mercurial
<h1>How do I diff one branch with my default branch</h1> <p>I switched to a branch on my local repo and noticed it gave me message showing x files updated. This surprised me as I didn't know there were any differences on that branch. How do I compare that branch with the default branch to see what has changed?</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,826
mercurial
# How do I diff one branch with my default branch I switched to a branch on my local repo and noticed it gave me message showing x files updated. This surprised me as I didn't know there were any differences on that branch. How do I compare that branch with the default branch to see what has changed?
Use `hg diff -r BRANCH1:BRANCH2`, where BRANCH1 and BRANCH2 are the names of the branches. This will show you the differences between the heads of the two branches. You got the message about "x files updated" because there were files changed on the original branch, not necessarily because there were files changed on t...
4547251
Mercurial clone from a branch
57
2010-12-28 15:49:17
<p>We have a repository with three named branches, I wanted to clone one of the branches. Is there a mercurial command to do that? If I provide the path (of branch) with hg clone I get 404 error.</p>
49,103
411,709
2017-03-01 06:54:29
4,547,260
110
2010-12-28 15:50:42
2,354
2010-12-28 15:50:42
https://stackoverflow.com/q/4547251
https://stackoverflow.com/a/4547260
<p><code>hg clone http://your/repo -r branchname</code> should do the trick.</p>
<p><code>hg clone http://your/repo -r branchname</code> should do the trick.</p>
802, 1879, 3050
branch, clone, mercurial
<h1>Mercurial clone from a branch</h1> <p>We have a repository with three named branches, I wanted to clone one of the branches. Is there a mercurial command to do that? If I provide the path (of branch) with hg clone I get 404 error.</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,828
mercurial
# Mercurial clone from a branch We have a repository with three named branches, I wanted to clone one of the branches. Is there a mercurial command to do that? If I provide the path (of branch) with hg clone I get 404 error.
`hg clone http://your/repo -r branchname` should do the trick.
2762383
How to remove changes in a file in hg
80
2010-05-04 02:07:34
<p>Can you please tell me how can I remove change I made locally?</p> <p>In git , I can do <code>git checkout -- aFile.cpp</code>, how can I do the same thing with <code>hg</code>?</p>
39,546
286,802
2018-01-23 14:06:02
2,762,389
104
2010-05-04 02:09:57
148,870
2010-05-04 02:09:57
https://stackoverflow.com/q/2762383
https://stackoverflow.com/a/2762389
<pre><code>hg revert &lt;filename&gt; </code></pre> <p>More detail on available <code>hg</code> commands is available on the <a href="http://www.selenic.com/mercurial/hg.1.html#commands" rel="noreferrer">man page</a>.</p> <p>(Note that this is not the same as <code>git revert</code> - git's revert command is for reve...
<pre><code>hg revert &lt;filename&gt; </code></pre> <p>More detail on available <code>hg</code> commands is available on the <a href="http://www.selenic.com/mercurial/hg.1.html#commands" rel="noreferrer">man page</a>.</p> <p>(Note that this is not the same as <code>git revert</code> - git's revert command is for reve...
802
mercurial
<h1>How to remove changes in a file in hg</h1> <p>Can you please tell me how can I remove change I made locally?</p> <p>In git , I can do <code>git checkout -- aFile.cpp</code>, how can I do the same thing with <code>hg</code>?</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,829
mercurial
# How to remove changes in a file in hg Can you please tell me how can I remove change I made locally? In git , I can do `git checkout -- aFile.cpp`, how can I do the same thing with `hg`?
``` hg revert <filename> ``` More detail on available `hg` commands is available on the [man page](http://www.selenic.com/mercurial/hg.1.html#commands). (Note that this is not the same as `git revert` - git's revert command is for reverting commits, hg's revert command is for reverting local changes. Also, the comman...
6644174
Mercurial: Globally Ignore Files
63
2011-07-10 22:31:43
<p>I know about <code>.hgignore</code> and how I can ignore files on a project-by-project basis. I want to ignore stuff for all Mercurial repositories.</p> <p>Is there something I can stick in <code>.hgrc</code>? Or put a <code>.hgignore</code> in my <code>$HOME</code> path (I tried that already but maybe I did someth...
11,901
131,320
2015-05-28 16:04:04
6,644,205
104
2011-07-10 22:39:08
22,211
2011-07-10 22:44:44
https://stackoverflow.com/q/6644174
https://stackoverflow.com/a/6644205
<p>You can add a path to a global or per-user ignore file in the <a href="http://www.selenic.com/mercurial/hgrc.5.html#ui" rel="noreferrer"><code>[ui]</code> section</a> of your global/user <code>hgrc</code> or <code>Mercurial.ini</code>:</p> <pre><code>[ui] ignore = ~/.hgignore </code></pre> <p>On Windows:</p> <pre...
<p>You can add a path to a global or per-user ignore file in the <a href="http://www.selenic.com/mercurial/hgrc.5.html#ui" rel="noreferrer"><code>[ui]</code> section</a> of your global/user <code>hgrc</code> or <code>Mercurial.ini</code>:</p> <pre><code>[ui] ignore = ~/.hgignore </code></pre> <p>On Windows:</p> <pre...
802, 31419, 34046
hgignore, hgrc, mercurial
<h1>Mercurial: Globally Ignore Files</h1> <p>I know about <code>.hgignore</code> and how I can ignore files on a project-by-project basis. I want to ignore stuff for all Mercurial repositories.</p> <p>Is there something I can stick in <code>.hgrc</code>? Or put a <code>.hgignore</code> in my <code>$HOME</code> path (I...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,830
mercurial
# Mercurial: Globally Ignore Files I know about `.hgignore` and how I can ignore files on a project-by-project basis. I want to ignore stuff for all Mercurial repositories. Is there something I can stick in `.hgrc`? Or put a `.hgignore` in my `$HOME` path (I tried that already but maybe I did something wrong).
You can add a path to a global or per-user ignore file in the [`[ui]` section](http://www.selenic.com/mercurial/hgrc.5.html#ui) of your global/user `hgrc` or `Mercurial.ini`: ``` [ui] ignore = ~/.hgignore ``` On Windows: ``` [ui] ignore = %USERPROFILE%\.hgignore ```
12690557
Mercurial / hg - abort: outstanding uncommitted merges
55
2012-10-02 12:47:45
<p>I have a master repo on host1 and made an update to a repo on host2. I <code>hg push</code>ed the changes from host2 to host1 with</p> <pre><code>[mpenning@host2 login]$ hg push ssh://host1//opt/python/login </code></pre> <p>However, when I try to update or merge, I get</p> <pre><code>[mpenning@host1 login]$ hg...
52,330
667,301
2017-08-31 18:23:46
12,690,559
104
2012-10-02 12:47:45
667,301
2012-10-02 12:47:45
https://stackoverflow.com/q/12690557
https://stackoverflow.com/a/12690559
<p><code>hg update --clean -r tip</code> resolved the problem...</p> <pre><code>[mpenning@host1 login]$ hg update --clean -r tip resolving manifests getting Protocol.py getting Session.py getting mp_getconf.py getting mp_runcmd.py 4 files updated, 0 files merged, 0 files removed, 0 files unresolved [mpenning@host1 log...
<p><code>hg update --clean -r tip</code> resolved the problem...</p> <pre><code>[mpenning@host1 login]$ hg update --clean -r tip resolving manifests getting Protocol.py getting Session.py getting mp_getconf.py getting mp_runcmd.py 4 files updated, 0 files merged, 0 files removed, 0 files unresolved [mpenning@host1 log...
802
mercurial
<h1>Mercurial / hg - abort: outstanding uncommitted merges</h1> <p>I have a master repo on host1 and made an update to a repo on host2. I <code>hg push</code>ed the changes from host2 to host1 with</p> <pre><code>[mpenning@host2 login]$ hg push ssh://host1//opt/python/login </code></pre> <p>However, when I try to u...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,831
mercurial
# Mercurial / hg - abort: outstanding uncommitted merges I have a master repo on host1 and made an update to a repo on host2. I `hg push`ed the changes from host2 to host1 with ``` [mpenning@host2 login]$ hg push ssh://host1//opt/python/login ``` However, when I try to update or merge, I get ``` [mpenning@host1 lo...
`hg update --clean -r tip` resolved the problem... ``` [mpenning@host1 login]$ hg update --clean -r tip resolving manifests getting Protocol.py getting Session.py getting mp_getconf.py getting mp_runcmd.py 4 files updated, 0 files merged, 0 files removed, 0 files unresolved [mpenning@host1 login]$ hg up resolving mani...
410756
Is it possible to browse the source of OpenJDK online?
87
2009-01-04 09:41:23
<p>Is it possible to browse the source code of OpenJDK online, just like I can do with SourceForge's projects? I never used Mercury before, so I felt confused.</p> <p>(Note: I don't want to download the source. I just want to browse it online, to see how some methods are implemented.)</p>
29,685
41,283
2021-10-18 08:15:00
410,780
101
2009-01-04 10:05:31
5,542
2021-10-18 08:15:00
https://stackoverflow.com/q/410756
https://stackoverflow.com/a/410780
<p>OpenJDK is now on GitHub: <a href="https://github.com/openjdk/jdk" rel="noreferrer">https://github.com/openjdk/jdk</a></p> <p>It is a large project, but you will find the implementations of the core classes under <a href="https://github.com/openjdk/jdk/blob/master/src/java.base/share/classes" rel="noreferrer">jdk/sr...
<p>OpenJDK is now on GitHub: <a href="https://github.com/openjdk/jdk" rel="noreferrer">https://github.com/openjdk/jdk</a></p> <p>It is a large project, but you will find the implementations of the core classes under <a href="https://github.com/openjdk/jdk/blob/master/src/java.base/share/classes" rel="noreferrer">jdk/sr...
17, 802
java, mercurial
<h1>Is it possible to browse the source of OpenJDK online?</h1> <p>Is it possible to browse the source code of OpenJDK online, just like I can do with SourceForge's projects? I never used Mercury before, so I felt confused.</p> <p>(Note: I don't want to download the source. I just want to browse it online, to see how ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,833
mercurial
# Is it possible to browse the source of OpenJDK online? Is it possible to browse the source code of OpenJDK online, just like I can do with SourceForge's projects? I never used Mercury before, so I felt confused. (Note: I don't want to download the source. I just want to browse it online, to see how some methods are...
OpenJDK is now on GitHub: <https://github.com/openjdk/jdk> It is a large project, but you will find the implementations of the core classes under [jdk/src/java.base/share/classes](https://github.com/openjdk/jdk/blob/master/src/java.base/share/classes). For instance you can find [the implementation of `java.util.List`...
2672454
How do I git reset --hard HEAD on Mercurial?
83
2010-04-20 04:03:05
<p>I'm a Git user trying to use Mercurial.</p> <p>Here's what happened: I did a <code>hg backout</code> on a changeset I wanted to revert. That created a new head, so hg instructed me to merge (back to "default", I assume). After the merge, it told me I still had to commit. Then I noticed something I did wrong when re...
67,523
105,132
2022-04-29 10:20:00
2,672,512
101
2010-04-20 04:21:56
8,992
2010-04-20 04:21:56
https://stackoverflow.com/q/2672454
https://stackoverflow.com/a/2672512
<p>If you've not yet commited, and it sounds like you haven't you can undo all the merge work with <code>hg update --clean</code>.</p> <p>However, in newer mercurial's there's a handy command to re-merge a single file: <code>hg resolve path/to/file.ext</code>. From the <code>hg help resolve</code>:</p> <blockquote> ...
<p>If you've not yet commited, and it sounds like you haven't you can undo all the merge work with <code>hg update --clean</code>.</p> <p>However, in newer mercurial's there's a handy command to re-merge a single file: <code>hg resolve path/to/file.ext</code>. From the <code>hg help resolve</code>:</p> <blockquote> ...
119, 717, 802, 3346
dvcs, git, mercurial, merge
<h1>How do I git reset --hard HEAD on Mercurial?</h1> <p>I'm a Git user trying to use Mercurial.</p> <p>Here's what happened: I did a <code>hg backout</code> on a changeset I wanted to revert. That created a new head, so hg instructed me to merge (back to "default", I assume). After the merge, it told me I still had t...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,834
mercurial
# How do I git reset --hard HEAD on Mercurial? I'm a Git user trying to use Mercurial. Here's what happened: I did a `hg backout` on a changeset I wanted to revert. That created a new head, so hg instructed me to merge (back to "default", I assume). After the merge, it told me I still had to commit. Then I noticed so...
If you've not yet commited, and it sounds like you haven't you can undo all the merge work with `hg update --clean`. However, in newer mercurial's there's a handy command to re-merge a single file: `hg resolve path/to/file.ext`. From the `hg help resolve`: > ``` > The available actions are: ... > > 4) discard your c...
1869040
What are the best and must-have hg / mercurial extensions?
77
2009-12-08 18:47:49
<p>I've been dabbling with hg / mercurial lately, namely in conjunction with Fogcreek's Kiln, and I'm trying to figure out what the must-have extensions are. Its a little tricky sifting through their extension list because I'm not interested in testing any buggy or impractical extensions, even if their description sou...
14,302
93,933
2017-06-19 09:23:14
1,907,190
101
2009-12-15 12:44:40
172,642
2012-08-26 01:35:29
https://stackoverflow.com/q/1869040
https://stackoverflow.com/a/1907190
<p>My own hit list:</p> <p>The simple ones you must have:</p> <ol> <li><code>color</code>: colorize output from commands like <code>diff</code> and <code>status</code>, which makes it easier to assess.</li> <li><code>pager</code>: browse long output a page at a time.</li> <li><code>fetch</code>: pull, update and merg...
<p>My own hit list:</p> <p>The simple ones you must have:</p> <ol> <li><code>color</code>: colorize output from commands like <code>diff</code> and <code>status</code>, which makes it easier to assess.</li> <li><code>pager</code>: browse long output a page at a time.</li> <li><code>fetch</code>: pull, update and merg...
802
mercurial
<h1>What are the best and must-have hg / mercurial extensions?</h1> <p>I've been dabbling with hg / mercurial lately, namely in conjunction with Fogcreek's Kiln, and I'm trying to figure out what the must-have extensions are. Its a little tricky sifting through their extension list because I'm not interested in testin...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,835
mercurial
# What are the best and must-have hg / mercurial extensions? I've been dabbling with hg / mercurial lately, namely in conjunction with Fogcreek's Kiln, and I'm trying to figure out what the must-have extensions are. Its a little tricky sifting through their extension list because I'm not interested in testing any bugg...
My own hit list: The simple ones you must have: 1. `color`: colorize output from commands like `diff` and `status`, which makes it easier to assess. 2. `pager`: browse long output a page at a time. 3. `fetch`: pull, update and merge from another repo in one step. 4. `graphlog`: display revision graphs in your shell, ...
34795050
How do I list all of my Jenkins credentials in the script console?
29
2016-01-14 16:44:59
<p>I'm trying to get Jenkins to clone my mercurial project from BitBucket. It won't, because it <em>says</em> there's a problem with the credentials - well, bitbucket is refusing whatever it is that Jenkins is providing.</p> <p>I'm almost 100% sure that Jenkins is not providing what it should be providing, because whe...
94,988
344,286
2024-12-12 10:22:22
57,952,857
101
2019-09-16 08:16:04
334,395
2022-10-28 07:02:36
https://stackoverflow.com/q/34795050
https://stackoverflow.com/a/57952857
<p>This works very well for me...</p> <pre><code>import java.nio.charset.StandardCharsets; def creds = com.cloudbees.plugins.credentials.CredentialsProvider.lookupCredentials( com.cloudbees.plugins.credentials.Credentials.class ) for (c in creds) { println(c.id) if (c.properties.description) { println(&q...
<p>This works very well for me...</p> <pre><code>import java.nio.charset.StandardCharsets; def creds = com.cloudbees.plugins.credentials.CredentialsProvider.lookupCredentials( com.cloudbees.plugins.credentials.Credentials.class ) for (c in creds) { println(c.id) if (c.properties.description) { println(&q...
802, 849, 64999
groovy, jenkins, mercurial
<h1>How do I list all of my Jenkins credentials in the script console?</h1> <p>I'm trying to get Jenkins to clone my mercurial project from BitBucket. It won't, because it <em>says</em> there's a problem with the credentials - well, bitbucket is refusing whatever it is that Jenkins is providing.</p> <p>I'm almost 100%...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,836
mercurial
# How do I list all of my Jenkins credentials in the script console? I'm trying to get Jenkins to clone my mercurial project from BitBucket. It won't, because it *says* there's a problem with the credentials - well, bitbucket is refusing whatever it is that Jenkins is providing. I'm almost 100% sure that Jenkins is n...
This works very well for me... ``` import java.nio.charset.StandardCharsets; def creds = com.cloudbees.plugins.credentials.CredentialsProvider.lookupCredentials( com.cloudbees.plugins.credentials.Credentials.class ) for (c in creds) { println(c.id) if (c.properties.description) { println(" description...
20470874
How do you "rollback" last commit on Mercurial?
75
2013-12-09 12:37:24
<p>I have a Mercurial repository that I use in local only... It's for my personal usage (so I don't "push" anywhere).</p> <p>I made a commit with 3 files, but after that I understood that I should do commit 4 files...</p> <p>Is there a way to "rollback" my <strong>last</strong> (latest, only one) commit, and "recommi...
116,684
185,593
2018-05-08 22:41:09
20,471,145
100
2013-12-09 12:51:07
777,939
2017-01-13 11:30:02
https://stackoverflow.com/q/20470874
https://stackoverflow.com/a/20471145
<p>You just need this command:</p> <pre><code>hg rollback </code></pre> <p>See: <a href="http://hgbook.red-bean.com/read/finding-and-fixing-mistakes.html" rel="noreferrer">http://hgbook.red-bean.com/read/finding-and-fixing-mistakes.html</a>.</p> <p>(Technically, this is deprecated as of version 2.7, August 2013, but...
<p>You just need this command:</p> <pre><code>hg rollback </code></pre> <p>See: <a href="http://hgbook.red-bean.com/read/finding-and-fixing-mistakes.html" rel="noreferrer">http://hgbook.red-bean.com/read/finding-and-fixing-mistakes.html</a>.</p> <p>(Technically, this is deprecated as of version 2.7, August 2013, but...
802, 5597, 12196
commit, mercurial, rollback
<h1>How do you "rollback" last commit on Mercurial?</h1> <p>I have a Mercurial repository that I use in local only... It's for my personal usage (so I don't "push" anywhere).</p> <p>I made a commit with 3 files, but after that I understood that I should do commit 4 files...</p> <p>Is there a way to "rollback" my <str...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,838
mercurial
# How do you "rollback" last commit on Mercurial? I have a Mercurial repository that I use in local only... It's for my personal usage (so I don't "push" anywhere). I made a commit with 3 files, but after that I understood that I should do commit 4 files... Is there a way to "rollback" my **last** (latest, only one)...
You just need this command: ``` hg rollback ``` See: <http://hgbook.red-bean.com/read/finding-and-fixing-mistakes.html>. (Technically, this is deprecated as of version 2.7, August 2013, but I've yet to see an alternative that does exactly the same thing.)
3214035
Mercurial: How do you undo changes?
69
2010-07-09 15:22:21
<p>When using Mercurial, how do you undo all changes in the working directory since the last commit? It seems like this would be a simple thing, but it's escaping me.</p> <p>For example, let's say I have 4 commits. Then, I make some changes to my code. Then I decide that my changes are bad and I just want to go back t...
76,104
387,875
2013-01-30 02:49:03
3,214,065
99
2010-07-09 15:25:10
26,227
2010-07-09 15:31:08
https://stackoverflow.com/q/3214035
https://stackoverflow.com/a/3214065
<p><a href="http://www.selenic.com/mercurial/hg.1.html#revert" rel="noreferrer"><code>hg revert</code></a> will do the trick.</p> <p>It will revert you to the last commit. </p> <p><code>--all</code> will revert all files.</p> <p>See the link for the Man Page description of it.</p> <p><code>hg update</code> is usual...
<p><a href="http://www.selenic.com/mercurial/hg.1.html#revert" rel="noreferrer"><code>hg revert</code></a> will do the trick.</p> <p>It will revert you to the last commit. </p> <p><code>--all</code> will revert all files.</p> <p>See the link for the Man Page description of it.</p> <p><code>hg update</code> is usual...
456, 802
mercurial, version-control
<h1>Mercurial: How do you undo changes?</h1> <p>When using Mercurial, how do you undo all changes in the working directory since the last commit? It seems like this would be a simple thing, but it's escaping me.</p> <p>For example, let's say I have 4 commits. Then, I make some changes to my code. Then I decide that my...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,839
mercurial
# Mercurial: How do you undo changes? When using Mercurial, how do you undo all changes in the working directory since the last commit? It seems like this would be a simple thing, but it's escaping me. For example, let's say I have 4 commits. Then, I make some changes to my code. Then I decide that my changes are bad...
[`hg revert`](http://www.selenic.com/mercurial/hg.1.html#revert) will do the trick. It will revert you to the last commit. `--all` will revert all files. See the link for the Man Page description of it. `hg update` is usually used to refresh your working directory after you pull from a different repo or swap branch...
4158726
How can I remove the working copy from a Mercurial clone?
62
2010-11-11 20:00:12
<p>When cloning a repository with mercurial you can pass the -U/--noupdate flag to create a clone with no working copy. Can I remove the working copy if I forget to pass this flag at clone time? And if so, how?</p> <p>This is conceptually similar to <a href="https://stackoverflow.com/questions/2199897/git-convert-norm...
10,033
4,596
2020-01-24 15:56:14
4,158,903
95
2010-11-11 20:21:43
432,745
2020-01-24 15:56:14
https://stackoverflow.com/q/4158726
https://stackoverflow.com/a/4158903
<p>Documentation at Mercurial wiki says following about bare repositories:</p> <blockquote> <p>"<em>Although this is a minor issue, Mercurial can obviously handle a bare repository; that is, a repository without a working copy. In Git you need a configuration option for that, whereas in Hg you only need to che...
<p>Documentation at Mercurial wiki says following about bare repositories:</p> <blockquote> <p>"<em>Although this is a minor issue, Mercurial can obviously handle a bare repository; that is, a repository without a working copy. In Git you need a configuration option for that, whereas in Hg you only need to che...
802, 3050, 7330, 19697, 30922
bare, clone, mercurial, repository, working-copy
<h1>How can I remove the working copy from a Mercurial clone?</h1> <p>When cloning a repository with mercurial you can pass the -U/--noupdate flag to create a clone with no working copy. Can I remove the working copy if I forget to pass this flag at clone time? And if so, how?</p> <p>This is conceptually similar to <a...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,841
mercurial
# How can I remove the working copy from a Mercurial clone? When cloning a repository with mercurial you can pass the -U/--noupdate flag to create a clone with no working copy. Can I remove the working copy if I forget to pass this flag at clone time? And if so, how? This is conceptually similar to [this git question...
Documentation at Mercurial wiki says following about bare repositories: > "*Although this is a minor issue, Mercurial can obviously handle a > bare repository; that is, a repository without a working copy. In Git > you need a configuration option for that, whereas in Hg you only need > to check out the null revision, ...
10841212
Telling Mercurial about the moved files after a major re-organization
35
2012-05-31 21:02:08
<p>We recently re-organized a very unorganized site on our server at work. This website is version controlled using Mercurial. We re-organized everything. Thousands of files. Now when I do a <code>hg status</code> it shows a ton of new untracked files represented by a <code>?</code> and tons of missing files, which are...
14,549
762,889
2020-10-04 22:15:42
10,841,485
95
2012-05-31 21:22:59
1,429,465
2012-06-01 00:00:43
https://stackoverflow.com/q/10841212
https://stackoverflow.com/a/10841485
<p>You can use <code>hg mv --after</code> to signify you have already moved the file.</p>
<p>You can use <code>hg mv --after</code> to signify you have already moved the file.</p>
802
mercurial
<h1>Telling Mercurial about the moved files after a major re-organization</h1> <p>We recently re-organized a very unorganized site on our server at work. This website is version controlled using Mercurial. We re-organized everything. Thousands of files. Now when I do a <code>hg status</code> it shows a ton of new untra...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,842
mercurial
# Telling Mercurial about the moved files after a major re-organization We recently re-organized a very unorganized site on our server at work. This website is version controlled using Mercurial. We re-organized everything. Thousands of files. Now when I do a `hg status` it shows a ton of new untracked files represent...
You can use `hg mv --after` to signify you have already moved the file.
850213
How to migrate/convert from SVN to Mercurial (hg) on windows
120
2009-05-11 21:37:48
<p>I'm looking for a tool to migrate a couple of SVN repositories to Mercurial, with history, labels and so on.</p> <p>I'm using TortoiseHg (Windows x32), so ConvertExtensions are discarded. There's some info on how to do this process on a Linux box (<a href="http://pypi.python.org/pypi/hgsvn" rel="noreferrer">hgsvn</...
29,063
6,359
2018-09-19 09:47:35
1,174,923
93
2009-07-23 22:48:00
65,843
2017-06-20 08:36:50
https://stackoverflow.com/q/850213
https://stackoverflow.com/a/1174923
<p>I just had to tackle this problem myself. I have a windows XP machine with a separate windows server hosting <a href="http://www.visualsvn.com/server/" rel="nofollow noreferrer">VisualSVN Server</a>.</p> <p>I also have <a href="https://tortoisehg.bitbucket.io/" rel="nofollow noreferrer">TortoiseHG</a> installed as...
<p>I just had to tackle this problem myself. I have a windows XP machine with a separate windows server hosting <a href="http://www.visualsvn.com/server/" rel="nofollow noreferrer">VisualSVN Server</a>.</p> <p>I also have <a href="https://tortoisehg.bitbucket.io/" rel="nofollow noreferrer">TortoiseHG</a> installed as...
63, 97, 456, 802, 60753
hgsvn, mercurial, migration, svn, version-control
<h1>How to migrate/convert from SVN to Mercurial (hg) on windows</h1> <p>I'm looking for a tool to migrate a couple of SVN repositories to Mercurial, with history, labels and so on.</p> <p>I'm using TortoiseHg (Windows x32), so ConvertExtensions are discarded. There's some info on how to do this process on a Linux box...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,843
mercurial
# How to migrate/convert from SVN to Mercurial (hg) on windows I'm looking for a tool to migrate a couple of SVN repositories to Mercurial, with history, labels and so on. I'm using TortoiseHg (Windows x32), so ConvertExtensions are discarded. There's some info on how to do this process on a Linux box ([hgsvn](http:/...
I just had to tackle this problem myself. I have a windows XP machine with a separate windows server hosting [VisualSVN Server](http://www.visualsvn.com/server/). I also have [TortoiseHG](https://tortoisehg.bitbucket.io/) installed as well as the [CollabNet Subversion Command-Line Client](http://www.open.collab.net/do...
2329023
Mercurial error: abort no username supplied
116
2010-02-24 19:56:05
<p>Problem on WindowsXP (likely will happen on all Win installs), first time using Mercurial. I found the answer in an inobvious place so I'm asking/answering the question myself so others don't have to search like I did.</p> <p>First time using Mercurial on machine.</p> <p>Add new repoz:</p> <pre><code>c:\bla\&gt;h...
52,150
73,482
2022-06-22 09:07:11
2,331,596
93
2010-02-25 04:16:39
73,482
2022-06-22 09:02:17
https://stackoverflow.com/q/2329023
https://stackoverflow.com/a/2331596
<p>Solution:</p> <p>On my Windows install, the <code>Mercurial.ini</code> did not get propagated. It also needs a user email added to it.</p> <p>Take the default <code>Mercurial.ini</code> file found at in the Mercurial executable install directory (<code>C:\Program Files\Mercurial\Mercurial.ini</code> on my machine) a...
<p>Solution:</p> <p>On my Windows install, the <code>Mercurial.ini</code> did not get propagated. It also needs a user email added to it.</p> <p>Take the default <code>Mercurial.ini</code> file found at in the Mercurial executable install directory (<code>C:\Program Files\Mercurial\Mercurial.ini</code> on my machine) a...
456, 802
mercurial, version-control
<h1>Mercurial error: abort no username supplied</h1> <p>Problem on WindowsXP (likely will happen on all Win installs), first time using Mercurial. I found the answer in an inobvious place so I'm asking/answering the question myself so others don't have to search like I did.</p> <p>First time using Mercurial on machine...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,844
mercurial
# Mercurial error: abort no username supplied Problem on WindowsXP (likely will happen on all Win installs), first time using Mercurial. I found the answer in an inobvious place so I'm asking/answering the question myself so others don't have to search like I did. First time using Mercurial on machine. Add new repoz...
Solution: On my Windows install, the `Mercurial.ini` did not get propagated. It also needs a user email added to it. Take the default `Mercurial.ini` file found at in the Mercurial executable install directory (`C:\Program Files\Mercurial\Mercurial.ini` on my machine) and copy it to your user home dir (`C:\Documents ...
4152480
How can I back out a merge in Mercurial and later remerge with that branch?
55
2010-11-11 08:18:00
<p>I have two branches, default and branch1. By mistake one person in our team merged branch1 with default. The content in branch1 is not yet ready to merge with default (it contains a major rework of the build &amp; deploy environment).</p> <p>We did an experiment with 'hg backout', backing out the merge (not sure th...
23,432
230,809
2018-09-18 23:01:31
4,152,625
91
2010-11-11 08:40:49
267
2010-11-11 09:46:54
https://stackoverflow.com/q/4152480
https://stackoverflow.com/a/4152625
<p>There are many scenarios here where you might want to do this, I'll make each scenario a headline, so that you can find the scenario that fits your case. Note that I'm still learning Mercurial, and I'd like pointers if something I say is wrong, using the wrong terminology, could be done better, etc.</p> <h1>No furt...
<p>There are many scenarios here where you might want to do this, I'll make each scenario a headline, so that you can find the scenario that fits your case. Note that I'm still learning Mercurial, and I'd like pointers if something I say is wrong, using the wrong terminology, could be done better, etc.</p> <h1>No furt...
456, 802, 3346
dvcs, mercurial, version-control
<h1>How can I back out a merge in Mercurial and later remerge with that branch?</h1> <p>I have two branches, default and branch1. By mistake one person in our team merged branch1 with default. The content in branch1 is not yet ready to merge with default (it contains a major rework of the build &amp; deploy environment...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,845
mercurial
# How can I back out a merge in Mercurial and later remerge with that branch? I have two branches, default and branch1. By mistake one person in our team merged branch1 with default. The content in branch1 is not yet ready to merge with default (it contains a major rework of the build & deploy environment). We did an...
There are many scenarios here where you might want to do this, I'll make each scenario a headline, so that you can find the scenario that fits your case. Note that I'm still learning Mercurial, and I'd like pointers if something I say is wrong, using the wrong terminology, could be done better, etc. # No further chang...
4064516
Add all not tracked files at once
52
2010-10-31 18:39:21
<pre><code>$ hg status M ... M ... M ... ? ... ? ... ? ... </code></pre> <p>I need to add all not tracked (? marked) files. Is it possible? I can do "hg add *" but I will get many messages unwanted 'file already tracked'.</p>
28,803
205,270
2020-02-15 20:15:56
4,064,526
91
2010-10-31 18:41:54
364,327
2020-02-15 20:15:56
https://stackoverflow.com/q/4064516
https://stackoverflow.com/a/4064526
<p>Just use <code>hg add</code> with no <code>*</code>.</p> <p>When no files are given, it adds all untracked files, that is, all files with <code>?</code> in front of the output of <code>hg status</code>.</p> <p>Files that are ignored because of <code>.hgignore</code> will not be added by <code>hg add</code> without...
<p>Just use <code>hg add</code> with no <code>*</code>.</p> <p>When no files are given, it adds all untracked files, that is, all files with <code>?</code> in front of the output of <code>hg status</code>.</p> <p>Files that are ignored because of <code>.hgignore</code> will not be added by <code>hg add</code> without...
802
mercurial
<h1>Add all not tracked files at once</h1> <pre><code>$ hg status M ... M ... M ... ? ... ? ... ? ... </code></pre> <p>I need to add all not tracked (? marked) files. Is it possible? I can do "hg add *" but I will get many messages unwanted 'file already tracked'.</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,846
mercurial
# Add all not tracked files at once ``` $ hg status M ... M ... M ... ? ... ? ... ? ... ``` I need to add all not tracked (? marked) files. Is it possible? I can do "hg add *" but I will get many messages unwanted 'file already tracked'.
Just use `hg add` with no `*`. When no files are given, it adds all untracked files, that is, all files with `?` in front of the output of `hg status`. Files that are ignored because of `.hgignore` will not be added by `hg add` without filenames.
18777041
Remove file from a commit in Mercurial
55
2013-09-13 01:54:26
<p>I have a commit onto which I have amended some files. Some of these files that were part of the amend I do not want in this commit. Is there a way in Mercurial to remove certain files from the commit without losing the changes I have made to them? Thank you.</p> <p>Steps:</p> <ol> <li>Made some changes</li> <li>hg...
29,053
2,012,383
2020-09-10 02:35:45
18,825,283
90
2013-09-16 10:02:33
507,706
2014-05-13 00:01:32
https://stackoverflow.com/q/18777041
https://stackoverflow.com/a/18825283
<p>Try out:</p> <pre><code>hg forget somefile.txt hg commit --amend </code></pre> <p>If the file was new (i.e. you had used hg add).</p> <p>If that file already existed try:</p> <pre><code>cp somefile.txt somefile.txt.bak hg revert somefile.txt --rev .~1 hg commit --amend </code></pre> <p>Which is basically tellin...
<p>Try out:</p> <pre><code>hg forget somefile.txt hg commit --amend </code></pre> <p>If the file was new (i.e. you had used hg add).</p> <p>If that file already existed try:</p> <pre><code>cp somefile.txt somefile.txt.bak hg revert somefile.txt --rev .~1 hg commit --amend </code></pre> <p>Which is basically tellin...
802
mercurial
<h1>Remove file from a commit in Mercurial</h1> <p>I have a commit onto which I have amended some files. Some of these files that were part of the amend I do not want in this commit. Is there a way in Mercurial to remove certain files from the commit without losing the changes I have made to them? Thank you.</p> <p>St...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,847
mercurial
# Remove file from a commit in Mercurial I have a commit onto which I have amended some files. Some of these files that were part of the amend I do not want in this commit. Is there a way in Mercurial to remove certain files from the commit without losing the changes I have made to them? Thank you. Steps: 1. Made so...
Try out: ``` hg forget somefile.txt hg commit --amend ``` If the file was new (i.e. you had used hg add). If that file already existed try: ``` cp somefile.txt somefile.txt.bak hg revert somefile.txt --rev .~1 hg commit --amend ``` Which is basically telling mercurial to `revert` the file (`somefile.txt`) back to ...
1013550
Find deleted files in Mercurial repository history, quickly?
65
2009-06-18 15:58:57
<p>You can use <code>hg grep</code>, but it searches the contents of all files.</p> <p>What if I just want to search the file names of deleted files to recover one?</p> <p>I tried <code>hg grep -I &lt;file-name-pattern&gt; &lt;pattern&gt;</code> but this seems to return no results.</p>
18,046
27,579
2021-04-09 07:30:27
1,013,628
88
2009-06-18 16:12:48
89,266
2009-06-18 16:12:48
https://stackoverflow.com/q/1013550
https://stackoverflow.com/a/1013628
<p>using <a href="http://hgbook.red-bean.com/read/customizing-the-output-of-mercurial.html" rel="noreferrer">templates is simple</a>:</p> <pre><code>$ hg log --template "{rev}: {file_dels}\n" </code></pre>
<p>using <a href="http://hgbook.red-bean.com/read/customizing-the-output-of-mercurial.html" rel="noreferrer">templates is simple</a>:</p> <pre><code>$ hg log --template "{rev}: {file_dels}\n" </code></pre>
456, 802
mercurial, version-control
<h1>Find deleted files in Mercurial repository history, quickly?</h1> <p>You can use <code>hg grep</code>, but it searches the contents of all files.</p> <p>What if I just want to search the file names of deleted files to recover one?</p> <p>I tried <code>hg grep -I &lt;file-name-pattern&gt; &lt;pattern&gt;</code> but ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,849
mercurial
# Find deleted files in Mercurial repository history, quickly? You can use `hg grep`, but it searches the contents of all files. What if I just want to search the file names of deleted files to recover one? I tried `hg grep -I <file-name-pattern> <pattern>` but this seems to return no results.
using [templates is simple](http://hgbook.red-bean.com/read/customizing-the-output-of-mercurial.html): ``` $ hg log --template "{rev}: {file_dels}\n" ```
2951011
How to let TortoiseHg (Mercurial) on Windows use the Private Key file generated (by Puttygen)?
60
2010-06-01 15:24:12
<p>I have used Puttygen to create a public and a private key, and then is ready to let TortoiseHg on Windows 7 do a clone by going to </p> <pre><code>ssh://somebody@code.somewhere.com/somecode </code></pre> <p>but there seems to be no where to add the private key to TortoiseHg? (or even just the mercurial command li...
31,643
325,418
2024-12-29 07:18:47
2,952,371
87
2010-06-01 18:45:32
54,499
2024-12-29 07:18:47
https://stackoverflow.com/q/2951011
https://stackoverflow.com/a/2952371
<p>Either add the following to the <code>[ui]</code> section of the mercurial.ini in your home directory (assuming your key is in &quot;C:\Users\UserName\mykey.ppk&quot;):</p> <p>TortoiseHg 3.5 and newer (thanks to <a href="https://stackoverflow.com/users/732673/josh-noe">Josh Noe</a> for <a href="https://stackoverflow...
<p>Either add the following to the <code>[ui]</code> section of the mercurial.ini in your home directory (assuming your key is in &quot;C:\Users\UserName\mykey.ppk&quot;):</p> <p>TortoiseHg 3.5 and newer (thanks to <a href="https://stackoverflow.com/users/732673/josh-noe">Josh Noe</a> for <a href="https://stackoverflow...
386, 802, 8122, 57931
mercurial, public-key, ssh, tortoisehg
<h1>How to let TortoiseHg (Mercurial) on Windows use the Private Key file generated (by Puttygen)?</h1> <p>I have used Puttygen to create a public and a private key, and then is ready to let TortoiseHg on Windows 7 do a clone by going to </p> <pre><code>ssh://somebody@code.somewhere.com/somecode </code></pre> <p>but ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,850
mercurial
# How to let TortoiseHg (Mercurial) on Windows use the Private Key file generated (by Puttygen)? I have used Puttygen to create a public and a private key, and then is ready to let TortoiseHg on Windows 7 do a clone by going to ``` ssh://somebody@code.somewhere.com/somecode ``` but there seems to be no where to add ...
Either add the following to the `[ui]` section of the mercurial.ini in your home directory (assuming your key is in "C:\Users\UserName\mykey.ppk"): TortoiseHg 3.5 and newer (thanks to [Josh Noe](https://stackoverflow.com/users/732673/josh-noe) for [pointing out in the comments](https://stackoverflow.com/questions/2951...
13112280
Mercurial (hg) equivalent of git reset (--mixed or --soft)
54
2012-10-28 19:36:12
<p>what would be an equivalent mercurial command (or workflow) for </p> <pre><code>git reset --mixed HEAD^ </code></pre> <p>or </p> <pre><code>git reset --soft HEAD^ </code></pre> <p>i.e. I want leave the working tree intact but get the repository back into the state it was before the last commit. Surprisingly I d...
22,165
371,137
2020-10-12 17:14:16
19,064,016
87
2013-09-28 06:21:59
1,418,918
2013-09-28 18:58:27
https://stackoverflow.com/q/13112280
https://stackoverflow.com/a/19064016
<p>The right way to replicate <code>git reset --soft HEAD^</code> (undo the current commit but keep changes in the working copy) is:</p> <pre><code>hg strip --keep -r . </code></pre> <p><code>-1</code> will only work if the commit you want to strip is the very last commit that entered the repository. <code>.</code> r...
<p>The right way to replicate <code>git reset --soft HEAD^</code> (undo the current commit but keep changes in the working copy) is:</p> <pre><code>hg strip --keep -r . </code></pre> <p><code>-1</code> will only work if the commit you want to strip is the very last commit that entered the repository. <code>.</code> r...
802
mercurial
<h1>Mercurial (hg) equivalent of git reset (--mixed or --soft)</h1> <p>what would be an equivalent mercurial command (or workflow) for </p> <pre><code>git reset --mixed HEAD^ </code></pre> <p>or </p> <pre><code>git reset --soft HEAD^ </code></pre> <p>i.e. I want leave the working tree intact but get the repository...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,851
mercurial
# Mercurial (hg) equivalent of git reset (--mixed or --soft) what would be an equivalent mercurial command (or workflow) for ``` git reset --mixed HEAD^ ``` or ``` git reset --soft HEAD^ ``` i.e. I want leave the working tree intact but get the repository back into the state it was before the last commit. Surpris...
The right way to replicate `git reset --soft HEAD^` (undo the current commit but keep changes in the working copy) is: ``` hg strip --keep -r . ``` `-1` will only work if the commit you want to strip is the very last commit that entered the repository. `.` refers to the currently checked out commit, which is the clos...
4822129
Mercurial: "untracked file in working directory differs from file in requested revision"?
87
2011-01-27 21:33:46
<p>Can anyone tell me what this Mercurial error means?</p> <blockquote> <p>untracked file in working directory differs from file in requested revision</p> </blockquote> <p>This occurred when doing an hg fetch: </p> <pre><code>C:\myapp&gt;hg fetch ssh://hg/myapp-v1 pulling from ssh://hg/myapp-v1 searching for c...
58,961
47,281
2020-06-08 19:29:36
4,822,322
86
2011-01-27 21:50:49
8,992
2011-01-27 21:50:49
https://stackoverflow.com/q/4822129
https://stackoverflow.com/a/4822322
<p>It's telling you you already have a file named <code>a/b/c/d.java</code> in your local working directory of the myapp repo, but it hasn't been added (tracked), and fetch isn't willing to overwrite it when updating/merging.</p> <p>Things you can do are ether:</p> <ul> <li>Move your copy of <code>a/b/c/d.java</code>...
<p>It's telling you you already have a file named <code>a/b/c/d.java</code> in your local working directory of the myapp repo, but it hasn't been added (tracked), and fetch isn't willing to overwrite it when updating/merging.</p> <p>Things you can do are ether:</p> <ul> <li>Move your copy of <code>a/b/c/d.java</code>...
717, 802
mercurial, merge
<h1>Mercurial: "untracked file in working directory differs from file in requested revision"?</h1> <p>Can anyone tell me what this Mercurial error means?</p> <blockquote> <p>untracked file in working directory differs from file in requested revision</p> </blockquote> <p>This occurred when doing an hg fetch: </p...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,852
mercurial
# Mercurial: "untracked file in working directory differs from file in requested revision"? Can anyone tell me what this Mercurial error means? > untracked file in working directory > differs from file in requested > revision This occurred when doing an hg fetch: ``` C:\myapp>hg fetch ssh://hg/myapp-v1 pulling from...
It's telling you you already have a file named `a/b/c/d.java` in your local working directory of the myapp repo, but it hasn't been added (tracked), and fetch isn't willing to overwrite it when updating/merging. Things you can do are ether: - Move your copy of `a/b/c/d.java` out of the way and then do the pull/update...
4520697
How to remove certain changesets from a specific Mercurial clone?
53
2010-12-23 16:41:01
<p>I have a clone of a central repo at rev 2048. I want to remove the last 10 changesets on my local repo as if I was back in time two weeks ago. I suppose I could delete my local repo and do <code>"hg clone -rev 2038"</code> but that would be long (cloning the repo takes several minutes). Is there a way to just "unpul...
50,977
121,445
2018-12-18 09:21:14
4,520,926
86
2010-12-23 17:10:55
52,626
2018-03-08 09:48:42
https://stackoverflow.com/q/4520697
https://stackoverflow.com/a/4520926
<p>Use the strip command:</p> <pre><code>hg strip -r 2039 </code></pre> <p>This command is provided by the <a href="https://www.mercurial-scm.org/wiki/StripExtension" rel="noreferrer">StripExtension</a>. It is distributed as part of Mercurial 2.8 and later, but you do need to enable it first by adding the following l...
<p>Use the strip command:</p> <pre><code>hg strip -r 2039 </code></pre> <p>This command is provided by the <a href="https://www.mercurial-scm.org/wiki/StripExtension" rel="noreferrer">StripExtension</a>. It is distributed as part of Mercurial 2.8 and later, but you do need to enable it first by adding the following l...
802
mercurial
<h1>How to remove certain changesets from a specific Mercurial clone?</h1> <p>I have a clone of a central repo at rev 2048. I want to remove the last 10 changesets on my local repo as if I was back in time two weeks ago. I suppose I could delete my local repo and do <code>"hg clone -rev 2038"</code> but that would be l...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,853
mercurial
# How to remove certain changesets from a specific Mercurial clone? I have a clone of a central repo at rev 2048. I want to remove the last 10 changesets on my local repo as if I was back in time two weeks ago. I suppose I could delete my local repo and do `"hg clone -rev 2038"` but that would be long (cloning the rep...
Use the strip command: ``` hg strip -r 2039 ``` This command is provided by the [StripExtension](https://www.mercurial-scm.org/wiki/StripExtension). It is distributed as part of Mercurial 2.8 and later, but you do need to enable it first by adding the following lines to your .hgrc or Mercurial.ini: ``` [extensions] ...
4760684
Mercurial undo last commit
133
2011-01-21 15:42:46
<p>How can I undo my last accidentally commited (not pushed) change in Mercurial?</p> <p>If possible, a way to do so with TortoiseHg would be prefered.</p> <p><strong>Update</strong></p> <p>In my concrete case I commited a changeset (not pushed). Then I pulled and updated from the server. With these new updates I de...
152,355
135,441
2021-04-12 21:52:44
4,760,763
85
2011-01-21 15:50:11
6,309
2018-02-22 10:04:30
https://stackoverflow.com/q/4760684
https://stackoverflow.com/a/4760763
<p>One way would be <del><a href="http://www.selenic.com/mercurial/hg.1.html#rollback" rel="noreferrer"><strong><code>hg rollback</code></strong></a></del> (deprecated as of Hg2.7, August 2013)</p> <blockquote> <p>Please use <a href="http://www.selenic.com/mercurial/hg.1.html#commit" rel="noreferrer"><code>hg commit...
<p>One way would be <del><a href="http://www.selenic.com/mercurial/hg.1.html#rollback" rel="noreferrer"><strong><code>hg rollback</code></strong></a></del> (deprecated as of Hg2.7, August 2013)</p> <blockquote> <p>Please use <a href="http://www.selenic.com/mercurial/hg.1.html#commit" rel="noreferrer"><code>hg commit...
802, 8122, 127564
mercurial, mercurial-commit, tortoisehg
<h1>Mercurial undo last commit</h1> <p>How can I undo my last accidentally commited (not pushed) change in Mercurial?</p> <p>If possible, a way to do so with TortoiseHg would be prefered.</p> <p><strong>Update</strong></p> <p>In my concrete case I commited a changeset (not pushed). Then I pulled and updated from the...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,854
mercurial
# Mercurial undo last commit How can I undo my last accidentally commited (not pushed) change in Mercurial? If possible, a way to do so with TortoiseHg would be prefered. **Update** In my concrete case I commited a changeset (not pushed). Then I pulled and updated from the server. With these new updates I decided, ...
One way would be ~~[**`hg rollback`**](http://www.selenic.com/mercurial/hg.1.html#rollback)~~ (deprecated as of Hg2.7, August 2013) > Please use [`hg commit --amend`](http://www.selenic.com/mercurial/hg.1.html#commit) instead of `rollback` to correct mistakes in the last commit. > > Roll back the last transaction in a...
732819
Can I change the username on a mercurial changeset?
76
2009-04-09 04:37:58
<p>I didn't set the username on my development computer and made a few commits. Can I retroactively change the username so it's clear who committed these changesets?</p>
23,469
23,427
2018-02-27 14:25:36
757,604
85
2009-04-16 19:09:56
24,762
2009-04-16 19:09:56
https://stackoverflow.com/q/732819
https://stackoverflow.com/a/757604
<p>If you've not published your repository then this shouldn't be too hard. You need to use the <a href="http://www.selenic.com/mercurial/wiki/index.cgi/ConvertExtension" rel="noreferrer">Convert extension</a> to Mercurial, which will let you 'filter' your existing repository to create a new one. the --authors switch...
<p>If you've not published your repository then this shouldn't be too hard. You need to use the <a href="http://www.selenic.com/mercurial/wiki/index.cgi/ConvertExtension" rel="noreferrer">Convert extension</a> to Mercurial, which will let you 'filter' your existing repository to create a new one. the --authors switch...
802
mercurial
<h1>Can I change the username on a mercurial changeset?</h1> <p>I didn't set the username on my development computer and made a few commits. Can I retroactively change the username so it's clear who committed these changesets?</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,855
mercurial
# Can I change the username on a mercurial changeset? I didn't set the username on my development computer and made a few commits. Can I retroactively change the username so it's clear who committed these changesets?
If you've not published your repository then this shouldn't be too hard. You need to use the [Convert extension](http://www.selenic.com/mercurial/wiki/index.cgi/ConvertExtension) to Mercurial, which will let you 'filter' your existing repository to create a new one. the --authors switch lets you edit the author for eac...
475970
Mercurial: multiline commit message on the command line?
60
2009-01-24 12:40:37
<p>How can I specify a multiline commit message for mercurial on the command line?</p> <pre><code>hg commit -m "* add foo\n* fix bar" </code></pre> <p>does not work. The log shows:</p> <pre><code>changeset: 13:f2c6526e5911 tag: tip date: Fri Jan 23 23:22:36 2009 +0100 files: foobar.cpp descri...
36,804
52,986
2018-03-17 09:02:46
475,974
84
2009-01-24 12:45:43
2,603
2009-01-24 12:45:43
https://stackoverflow.com/q/475970
https://stackoverflow.com/a/475974
<blockquote> <p>Mercurial: multiline commit message on the command line?</p> </blockquote> <p>Hit enter.</p> <pre><code>$ hg commit -m "Did some work &gt; Now I'm done" </code></pre> <p>One of the things is that only the first line shows up in hg log:</p> <pre><code>$ hg log changeset: 0:d2dc019450a2 tag: ...
<blockquote> <p>Mercurial: multiline commit message on the command line?</p> </blockquote> <p>Hit enter.</p> <pre><code>$ hg commit -m "Did some work &gt; Now I'm done" </code></pre> <p>One of the things is that only the first line shows up in hg log:</p> <pre><code>$ hg log changeset: 0:d2dc019450a2 tag: ...
802, 1231
command-line, mercurial
<h1>Mercurial: multiline commit message on the command line?</h1> <p>How can I specify a multiline commit message for mercurial on the command line?</p> <pre><code>hg commit -m "* add foo\n* fix bar" </code></pre> <p>does not work. The log shows:</p> <pre><code>changeset: 13:f2c6526e5911 tag: tip date: ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,856
mercurial
# Mercurial: multiline commit message on the command line? How can I specify a multiline commit message for mercurial on the command line? ``` hg commit -m "* add foo\n* fix bar" ``` does not work. The log shows: ``` changeset: 13:f2c6526e5911 tag: tip date: Fri Jan 23 23:22:36 2009 +0100 files: ...
> Mercurial: multiline commit message on > the command line? Hit enter. ``` $ hg commit -m "Did some work > Now I'm done" ``` One of the things is that only the first line shows up in hg log: ``` $ hg log changeset: 0:d2dc019450a2 tag: tip user: Aaron Maenpaa <zacherates@gmail.com> date: Sat...
491554
How do I convert a git repository to mercurial?
109
2009-01-29 13:21:33
<p>I've been developing a java application using git as source code repository. I'd like to share the project with other java developers and hg seems to be most used by them. </p> <p>My question is how do I convert a git repository to hg?</p> <p>If I tried googling "convert git to hg" and every search hit is about co...
31,280
3,713
2017-09-02 07:01:55
491,892
83
2009-01-29 14:53:04
3,713
2017-09-02 07:01:55
https://stackoverflow.com/q/491554
https://stackoverflow.com/a/491892
<p>The <a href="https://www.mercurial-scm.org/wiki/ConvertExtension" rel="noreferrer"><code>hg convert</code></a> utility isn't on by default after installation. In order to set it as such add the following to your <code>.hgrc</code> file.</p> <pre><code>[extensions] hgext.convert= </code></pre> <p>If you're using <a...
<p>The <a href="https://www.mercurial-scm.org/wiki/ConvertExtension" rel="noreferrer"><code>hg convert</code></a> utility isn't on by default after installation. In order to set it as such add the following to your <code>.hgrc</code> file.</p> <pre><code>[extensions] hgext.convert= </code></pre> <p>If you're using <a...
119, 456, 802, 8122
git, mercurial, tortoisehg, version-control
<h1>How do I convert a git repository to mercurial?</h1> <p>I've been developing a java application using git as source code repository. I'd like to share the project with other java developers and hg seems to be most used by them. </p> <p>My question is how do I convert a git repository to hg?</p> <p>If I tried goog...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,857
mercurial
# How do I convert a git repository to mercurial? I've been developing a java application using git as source code repository. I'd like to share the project with other java developers and hg seems to be most used by them. My question is how do I convert a git repository to hg? If I tried googling "convert git to hg"...
The [`hg convert`](https://www.mercurial-scm.org/wiki/ConvertExtension) utility isn't on by default after installation. In order to set it as such add the following to your `.hgrc` file. ``` [extensions] hgext.convert= ``` If you're using [TortoiseHg](https://tortoisehg.bitbucket.io/) on Windows then this file reside...
8535866
Not trusting file .hg/hgrc from untrusted user root, group dev
51
2011-12-16 14:53:48
<p>The repository is owned by user root, and group dev</p> <p>Another user is running <code>hg update</code> on the repository and getting the following messages:</p> <pre><code>Not trusting file /dev/.hg/hgrc from untrusted user root, group dev Not trusting file .hg/hgrc from untrusted user root, group dev Not trust...
32,392
157,837
2022-03-25 10:55:05
8,536,055
83
2011-12-16 15:08:24
110,204
2017-01-30 18:57:48
https://stackoverflow.com/q/8535866
https://stackoverflow.com/a/8536055
<p>Please read the <a href="http://www.mercurial-scm.org/wiki/Trust" rel="noreferrer">help on trust in Mercurial</a> and make sure that you've added the trust settings <em>on the server</em>. When you connect over SSH, it does not matter who you trust or don't trust locally — it's the <code>hg</code> binary that you ru...
<p>Please read the <a href="http://www.mercurial-scm.org/wiki/Trust" rel="noreferrer">help on trust in Mercurial</a> and make sure that you've added the trust settings <em>on the server</em>. When you connect over SSH, it does not matter who you trust or don't trust locally — it's the <code>hg</code> binary that you ru...
359, 386, 802, 7330
mercurial, permissions, repository, ssh
<h1>Not trusting file .hg/hgrc from untrusted user root, group dev</h1> <p>The repository is owned by user root, and group dev</p> <p>Another user is running <code>hg update</code> on the repository and getting the following messages:</p> <pre><code>Not trusting file /dev/.hg/hgrc from untrusted user root, group dev ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,858
mercurial
# Not trusting file .hg/hgrc from untrusted user root, group dev The repository is owned by user root, and group dev Another user is running `hg update` on the repository and getting the following messages: ``` Not trusting file /dev/.hg/hgrc from untrusted user root, group dev Not trusting file .hg/hgrc from untrus...
Please read the [help on trust in Mercurial](http://www.mercurial-scm.org/wiki/Trust) and make sure that you've added the trust settings *on the server*. When you connect over SSH, it does not matter who you trust or don't trust locally — it's the `hg` binary that you run on the server (via the SSH tunnel) that needs t...
13915467
Mercurial: Easy way to see changes from last commit
67
2012-12-17 13:52:29
<p>In Mercurial, I can see my current (uncommitted) changes by running</p> <pre><code>$ hg diff </code></pre> <p>Fine. But after commit, I sometimes want to see this diff again (i.e., the diff of the <em>last changeset</em>). I know I can achieve this by </p> <pre><code>$ hg log -l 1 changeset: 1234 tag ... $ hg...
55,268
384,689
2019-10-24 21:31:55
13,915,553
82
2012-12-17 13:58:29
72,312
2012-12-17 19:12:22
https://stackoverflow.com/q/13915467
https://stackoverflow.com/a/13915553
<p>Use <code>hg diff -c tip</code>, or <code>hg tip -p</code> (shorter, but works only for tip). </p> <p>This will work until you pull something, since <code>tip</code> is an alias for the most recent revision to appear in the repo, either by local commit or pull/push from remote repositories.</p>
<p>Use <code>hg diff -c tip</code>, or <code>hg tip -p</code> (shorter, but works only for tip). </p> <p>This will work until you pull something, since <code>tip</code> is an alias for the most recent revision to appear in the repo, either by local commit or pull/push from remote repositories.</p>
802
mercurial
<h1>Mercurial: Easy way to see changes from last commit</h1> <p>In Mercurial, I can see my current (uncommitted) changes by running</p> <pre><code>$ hg diff </code></pre> <p>Fine. But after commit, I sometimes want to see this diff again (i.e., the diff of the <em>last changeset</em>). I know I can achieve this by </...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,859
mercurial
# Mercurial: Easy way to see changes from last commit In Mercurial, I can see my current (uncommitted) changes by running ``` $ hg diff ``` Fine. But after commit, I sometimes want to see this diff again (i.e., the diff of the *last changeset*). I know I can achieve this by ``` $ hg log -l 1 changeset: 1234 tag ...
Use `hg diff -c tip`, or `hg tip -p` (shorter, but works only for tip). This will work until you pull something, since `tip` is an alias for the most recent revision to appear in the repo, either by local commit or pull/push from remote repositories.
14218390
How to resolve "abandoned transaction" when I use "hg push"?
43
2013-01-08 15:30:00
<p>We work with a <em>sourceforge</em> project. When we try to push, then mercurial abort :</p> <pre><code>$ hg push pushing to ssh://&lt;user&gt;@hg.code.sf.net/p/loremipsum/code searching for changes remote: abort: abandoned transaction found - run hg recover! abort: unexpected response: empty string </code></pre> ...
31,476
1,810,567
2020-06-30 10:50:55
18,352,191
82
2013-08-21 08:15:50
6,461
2020-06-30 10:50:55
https://stackoverflow.com/q/14218390
https://stackoverflow.com/a/18352191
<p>In my case I had to run</p> <pre><code>hg recover </code></pre> <p>on the <strong>remote</strong> machine to which I was pushing to. It fixed the problems and I could push the changes from my machine.</p>
<p>In my case I had to run</p> <pre><code>hg recover </code></pre> <p>on the <strong>remote</strong> machine to which I was pushing to. It fixed the problems and I could push the changes from my machine.</p>
802, 1840
mercurial, sourceforge
<h1>How to resolve "abandoned transaction" when I use "hg push"?</h1> <p>We work with a <em>sourceforge</em> project. When we try to push, then mercurial abort :</p> <pre><code>$ hg push pushing to ssh://&lt;user&gt;@hg.code.sf.net/p/loremipsum/code searching for changes remote: abort: abandoned transaction found - r...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,860
mercurial
# How to resolve "abandoned transaction" when I use "hg push"? We work with a *sourceforge* project. When we try to push, then mercurial abort : ``` $ hg push pushing to ssh://<user>@hg.code.sf.net/p/loremipsum/code searching for changes remote: abort: abandoned transaction found - run hg recover! abort: unexpected ...
In my case I had to run ``` hg recover ``` on the **remote** machine to which I was pushing to. It fixed the problems and I could push the changes from my machine.
1670076
How do I cherry-pick a single revision in Mercurial?
71
2009-11-03 20:54:51
<p>In Mercurial/TortoiseHg, given the following example, what is the easiest way to merge revision "G" into repo A without taking D,E and F (Assume that G has no dependency on D,E or F). </p> <pre><code>Repo A: A - B - C Repo B (Clone of A) A - B - C - D - E - F - G </code></pre> <p>Is a patch the best bet?</p>
39,710
100,964
2022-11-13 21:17:04
1,671,679
79
2009-11-04 04:32:09
8,992
2018-02-22 10:03:14
https://stackoverflow.com/q/1670076
https://stackoverflow.com/a/1671679
<p>Tonfa is right. What you're describing isn't 'merging' (or 'pushing' or 'pulling'); it's 'cherry-picking'. A push or a pull moves all the changesets from one repo to another that aren't already in that repo. A 'merge' takes two 'heads' and merges them down to a new changeset that's the combination of both.</p> ...
<p>Tonfa is right. What you're describing isn't 'merging' (or 'pushing' or 'pulling'); it's 'cherry-picking'. A push or a pull moves all the changesets from one repo to another that aren't already in that repo. A 'merge' takes two 'heads' and merges them down to a new changeset that's the combination of both.</p> ...
802, 8122, 36489
cherry-pick, mercurial, tortoisehg
<h1>How do I cherry-pick a single revision in Mercurial?</h1> <p>In Mercurial/TortoiseHg, given the following example, what is the easiest way to merge revision "G" into repo A without taking D,E and F (Assume that G has no dependency on D,E or F). </p> <pre><code>Repo A: A - B - C Repo B (Clone of A) A - B - C - D ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,861
mercurial
# How do I cherry-pick a single revision in Mercurial? In Mercurial/TortoiseHg, given the following example, what is the easiest way to merge revision "G" into repo A without taking D,E and F (Assume that G has no dependency on D,E or F). ``` Repo A: A - B - C Repo B (Clone of A) A - B - C - D - E - F - G ``` Is a ...
Tonfa is right. What you're describing isn't 'merging' (or 'pushing' or 'pulling'); it's 'cherry-picking'. A push or a pull moves all the changesets from one repo to another that aren't already in that repo. A 'merge' takes two 'heads' and merges them down to a new changeset that's the combination of both. If you real...
18724300
Push creates new remote heads! (did you forget to merge? use push -f to force)
76
2013-09-10 16:28:55
<p>Ok I've had a little google and can't find a solution as i've stumbled across the same message but different ways in which people have got it. I'm new to mecurial and want to make sure i'm doing this correctly.</p> <p>So i'm getting the error message as above. I have a dev site and a live site and i'm trying to pus...
108,336
1,256,637
2019-05-22 05:40:57
18,732,460
77
2013-09-11 04:02:48
8,992
2013-09-11 04:02:48
https://stackoverflow.com/q/18724300
https://stackoverflow.com/a/18732460
<p>This isn't an "error" message; it's a totally normal situation. That message is saying "hey, other people pushed new work to that repository while you were doing your work, you should probably integrate theirs into your so they don't have to integrate yours into theirs?"</p> <p>So first do a:</p> <pre><code>hg pu...
<p>This isn't an "error" message; it's a totally normal situation. That message is saying "hey, other people pushed new work to that repository while you were doing your work, you should probably integrate theirs into your so they don't have to integrate yours into theirs?"</p> <p>So first do a:</p> <pre><code>hg pu...
802
mercurial
<h1>Push creates new remote heads! (did you forget to merge? use push -f to force)</h1> <p>Ok I've had a little google and can't find a solution as i've stumbled across the same message but different ways in which people have got it. I'm new to mecurial and want to make sure i'm doing this correctly.</p> <p>So i'm get...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,862
mercurial
# Push creates new remote heads! (did you forget to merge? use push -f to force) Ok I've had a little google and can't find a solution as i've stumbled across the same message but different ways in which people have got it. I'm new to mecurial and want to make sure i'm doing this correctly. So i'm getting the error m...
This isn't an "error" message; it's a totally normal situation. That message is saying "hey, other people pushed new work to that repository while you were doing your work, you should probably integrate theirs into your so they don't have to integrate yours into theirs?" So first do a: ``` hg pull ``` and then a: `...
5376642
Mercurial: diffs in a particular changeset?
54
2011-03-21 10:54:36
<p>This is almost exactly a duplicate of <a href="https://stackoverflow.com/questions/2550721/examining-a-single-changeset-in-mercurial">Examining a single changeset in Mercurial</a>, and without doubt a duplicate of another question I can't find on SO through Google alone. </p> <p>I'm looking back through a Mercurial...
36,965
267,831
2019-04-04 21:07:50
5,379,027
77
2011-03-21 14:28:01
8,992
2011-03-21 14:28:01
https://stackoverflow.com/q/5376642
https://stackoverflow.com/a/5379027
<p>Revision 2580 isn't necessasrily the parent revision of 2581. It's easy to check if it is, of course, but easier yet is to just do:</p> <pre><code>hg log -p -r 2581 </code></pre> <p>That compares 2581 to its (first) parent revision no matter what it is, and most clearly encompasses the answer to the question <em>...
<p>Revision 2580 isn't necessasrily the parent revision of 2581. It's easy to check if it is, of course, but easier yet is to just do:</p> <pre><code>hg log -p -r 2581 </code></pre> <p>That compares 2581 to its (first) parent revision no matter what it is, and most clearly encompasses the answer to the question <em>...
802
mercurial
<h1>Mercurial: diffs in a particular changeset?</h1> <p>This is almost exactly a duplicate of <a href="https://stackoverflow.com/questions/2550721/examining-a-single-changeset-in-mercurial">Examining a single changeset in Mercurial</a>, and without doubt a duplicate of another question I can't find on SO through Google...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,863
mercurial
# Mercurial: diffs in a particular changeset? This is almost exactly a duplicate of [Examining a single changeset in Mercurial](https://stackoverflow.com/questions/2550721/examining-a-single-changeset-in-mercurial), and without doubt a duplicate of another question I can't find on SO through Google alone. I'm looking...
Revision 2580 isn't necessasrily the parent revision of 2581. It's easy to check if it is, of course, but easier yet is to just do: ``` hg log -p -r 2581 ``` That compares 2581 to its (first) parent revision no matter what it is, and most clearly encompasses the answer to the question *"what the hell did 2581 do?"*
7866582
Generating patches in Mercurial
47
2011-10-23 14:08:11
<p>I've looked for that in the manual, but I can't generate a patch for the last commit. I tried</p> <pre><code>hg qnew patch_name </code></pre> <p>but it does only file with</p> <pre><code># HG changeset patch # Parent a6a8e225d16ff5970a8926ee8d24272a1c099f9c </code></pre> <p>I also tried</p> <pre><code>hg export...
60,496
771,517
2015-12-13 15:08:00
7,866,993
77
2011-10-23 15:17:28
75,761
2011-10-23 15:17:28
https://stackoverflow.com/q/7866582
https://stackoverflow.com/a/7866993
<p>The command to do this is <code>export</code>:</p> <pre><code>$ hg export -o FILE -r REV </code></pre> <p>It doesn't require redirection and will thus work correctly on any platform/shell.</p>
<p>The command to do this is <code>export</code>:</p> <pre><code>$ hg export -o FILE -r REV </code></pre> <p>It doesn't require redirection and will thus work correctly on any platform/shell.</p>
802
mercurial
<h1>Generating patches in Mercurial</h1> <p>I've looked for that in the manual, but I can't generate a patch for the last commit. I tried</p> <pre><code>hg qnew patch_name </code></pre> <p>but it does only file with</p> <pre><code># HG changeset patch # Parent a6a8e225d16ff5970a8926ee8d24272a1c099f9c </code></pre> ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,864
mercurial
# Generating patches in Mercurial I've looked for that in the manual, but I can't generate a patch for the last commit. I tried ``` hg qnew patch_name ``` but it does only file with ``` # HG changeset patch # Parent a6a8e225d16ff5970a8926ee8d24272a1c099f9c ``` I also tried ``` hg export tip ``` but it doesn't do...
The command to do this is `export`: ``` $ hg export -o FILE -r REV ``` It doesn't require redirection and will thus work correctly on any platform/shell.
4523918
how to view previous version of a file in Mercurial
53
2010-12-24 02:53:57
<p>I am using mercurial for version control of a few files in a directory. Suppose I have 10 commits (10 changesets or revisions). I want to just view how a particular file, say thisFile.py, looked in its 7th revision. I don't want to revert back to this older version. I don't want to go and make any changes or fix any...
17,150
316,357
2013-11-15 13:05:34
4,523,927
73
2010-12-24 02:57:41
4
2013-01-27 14:04:54
https://stackoverflow.com/q/4523918
https://stackoverflow.com/a/4523927
<p>Use the <code>hg cat</code> command with the <code>-r</code> (revision) argument.</p> <pre><code>hg cat path_to/myfile.cpp -r 46 </code></pre> <p>where 46 is the revision number (use <code>hg log</code> to see revision history)</p>
<p>Use the <code>hg cat</code> command with the <code>-r</code> (revision) argument.</p> <pre><code>hg cat path_to/myfile.cpp -r 46 </code></pre> <p>where 46 is the revision number (use <code>hg log</code> to see revision history)</p>
802
mercurial
<h1>how to view previous version of a file in Mercurial</h1> <p>I am using mercurial for version control of a few files in a directory. Suppose I have 10 commits (10 changesets or revisions). I want to just view how a particular file, say thisFile.py, looked in its 7th revision. I don't want to revert back to this olde...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,867
mercurial
# how to view previous version of a file in Mercurial I am using mercurial for version control of a few files in a directory. Suppose I have 10 commits (10 changesets or revisions). I want to just view how a particular file, say thisFile.py, looked in its 7th revision. I don't want to revert back to this older version...
Use the `hg cat` command with the `-r` (revision) argument. ``` hg cat path_to/myfile.cpp -r 46 ``` where 46 is the revision number (use `hg log` to see revision history)
9037876
hg force update to new files
39
2012-01-27 18:01:43
<p>I am using hg version 1.9.1. Problem is whenever I use hg update, I get an option of updating changed files. Do we have an option for forcefully updating all files to their new versions in the latest commit. Sorry but i did not find any useful information in hg manual.</p>
39,468
950,238
2012-01-27 18:11:44
9,038,006
73
2012-01-27 18:11:44
54,937
2012-01-27 18:11:44
https://stackoverflow.com/q/9037876
https://stackoverflow.com/a/9038006
<pre><code>hg update --clean </code></pre> <p>This will update your working directory with the newest version of files in the current branch. Please note that this command will discard all existing changes in your working directory.</p> <p>If you meant "can I get a fresh copy of each and every file from the repositor...
<pre><code>hg update --clean </code></pre> <p>This will update your working directory with the newest version of files in the current branch. Please note that this command will discard all existing changes in your working directory.</p> <p>If you meant "can I get a fresh copy of each and every file from the repositor...
802
mercurial
<h1>hg force update to new files</h1> <p>I am using hg version 1.9.1. Problem is whenever I use hg update, I get an option of updating changed files. Do we have an option for forcefully updating all files to their new versions in the latest commit. Sorry but i did not find any useful information in hg manual.</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,868
mercurial
# hg force update to new files I am using hg version 1.9.1. Problem is whenever I use hg update, I get an option of updating changed files. Do we have an option for forcefully updating all files to their new versions in the latest commit. Sorry but i did not find any useful information in hg manual.
``` hg update --clean ``` This will update your working directory with the newest version of files in the current branch. Please note that this command will discard all existing changes in your working directory. If you meant "can I get a fresh copy of each and every file from the repository" just delete all files in...
1997601
Store password in TortoiseHg
203
2010-01-04 05:04:50
<p>Is there a way to configure <a href="http://tortoisehg.bitbucket.io/" rel="noreferrer">TortoiseHg</a> to store my password?</p> <p>I have a project hosted on <a href="http://code.google.com/" rel="noreferrer">Google Code</a> that I access using TortoiseHg. Whenever I want to push changes to Google Code TortoiseHg p...
80,240
111,327
2020-05-26 18:47:33
1,997,611
72
2010-01-04 05:10:20
237,349
2017-09-15 10:30:11
https://stackoverflow.com/q/1997601
https://stackoverflow.com/a/1997611
<p><strong>Security warning</strong></p> <p>Although this answer is accepted as of 2017-09-15, it is <em>not</em> a recommended solution. You should never store your passwords in plain text. Use the <code>mercurial_keyring</code> extension instead. See <a href="https://stackoverflow.com/a/3326448/56145">another answer...
<p><strong>Security warning</strong></p> <p>Although this answer is accepted as of 2017-09-15, it is <em>not</em> a recommended solution. You should never store your passwords in plain text. Use the <code>mercurial_keyring</code> extension instead. See <a href="https://stackoverflow.com/a/3326448/56145">another answer...
802, 3682, 8122
google-code, mercurial, tortoisehg
<h1>Store password in TortoiseHg</h1> <p>Is there a way to configure <a href="http://tortoisehg.bitbucket.io/" rel="noreferrer">TortoiseHg</a> to store my password?</p> <p>I have a project hosted on <a href="http://code.google.com/" rel="noreferrer">Google Code</a> that I access using TortoiseHg. Whenever I want to pu...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,869
mercurial
# Store password in TortoiseHg Is there a way to configure [TortoiseHg](http://tortoisehg.bitbucket.io/) to store my password? I have a project hosted on [Google Code](http://code.google.com/) that I access using TortoiseHg. Whenever I want to push changes to Google Code TortoiseHg prompts me for a username and passw...
**Security warning** Although this answer is accepted as of 2017-09-15, it is *not* a recommended solution. You should never store your passwords in plain text. Use the `mercurial_keyring` extension instead. See [another answer](https://stackoverflow.com/a/3326448/56145) here. --- You can change your push URL to <ht...
3000095
How to list all files in a repository in Mercurial (hg)?
76
2010-06-08 18:20:01
<p>Is there a command in mercurial that will list all files currently under source control? </p> <p>I can do a <code>dir /s</code> to list all files in my folder and subfolders, but I have no idea which have been added to my repository. I have a variety of excluded file types and folders and I want verify that none ...
29,410
16,183
2016-10-07 15:14:01
3,000,128
72
2010-06-08 18:24:54
14,343
2016-01-28 16:33:13
https://stackoverflow.com/q/3000095
https://stackoverflow.com/a/3000128
<p><code>hg status --all</code> will list all the files in the tree, with a letter indicating its status: M for modified, C for clean (owned by hg), and I for ignored.</p> <p>For just <strong>ignored</strong> files, use <code>hg status -i</code>. For just files that will be <strong>added</strong> on the next commit, u...
<p><code>hg status --all</code> will list all the files in the tree, with a letter indicating its status: M for modified, C for clean (owned by hg), and I for ignored.</p> <p>For just <strong>ignored</strong> files, use <code>hg status -i</code>. For just files that will be <strong>added</strong> on the next commit, u...
802, 31419
hgignore, mercurial
<h1>How to list all files in a repository in Mercurial (hg)?</h1> <p>Is there a command in mercurial that will list all files currently under source control? </p> <p>I can do a <code>dir /s</code> to list all files in my folder and subfolders, but I have no idea which have been added to my repository. I have a varie...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,870
mercurial
# How to list all files in a repository in Mercurial (hg)? Is there a command in mercurial that will list all files currently under source control? I can do a `dir /s` to list all files in my folder and subfolders, but I have no idea which have been added to my repository. I have a variety of excluded file types and ...
`hg status --all` will list all the files in the tree, with a letter indicating its status: M for modified, C for clean (owned by hg), and I for ignored. For just **ignored** files, use `hg status -i`. For just files that will be **added** on the next commit, use `hg status -a`. These show only what you need to know a...
4330631
How can I find my working revision in mercurial
64
2010-12-02 00:41:23
<p>In a mercurial repo I can run <code>hg up {revision}</code> to change the revision of my working directory, but what command can I run to discover what revision I'm looking at?</p>
28,085
35,247
2016-05-13 03:41:38
4,330,657
72
2010-12-02 00:45:45
251,311
2010-12-02 00:45:45
https://stackoverflow.com/q/4330631
https://stackoverflow.com/a/4330657
<p>This command:</p> <pre><code>hg parent </code></pre>
<p>This command:</p> <pre><code>hg parent </code></pre>
802
mercurial
<h1>How can I find my working revision in mercurial</h1> <p>In a mercurial repo I can run <code>hg up {revision}</code> to change the revision of my working directory, but what command can I run to discover what revision I'm looking at?</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,871
mercurial
# How can I find my working revision in mercurial In a mercurial repo I can run `hg up {revision}` to change the revision of my working directory, but what command can I run to discover what revision I'm looking at?
This command: ``` hg parent ```
238183
Is possible to change the default diff tool in Mercurial?
63
2008-10-26 16:14:44
<p>Every time I do an <code>hg diff file.ext</code> I end up using a console diff application. I would like to use Kdiff3 or WinMerge (I'm using Windows).</p> <p>Is there a way to change that? I can't find a reference in Mercurial documentation (<strong>I'm not talking about merge!</strong>). </p>
25,081
4,386
2024-03-09 16:27:52
241,018
71
2008-10-27 18:45:54
4,386
2008-10-27 18:45:54
https://stackoverflow.com/q/238183
https://stackoverflow.com/a/241018
<p>I've solved this using a Mercurial built-in extension... I just have to add the following lines to Mercurial.ini (on Mercurial folder):</p> <pre><code>[extensions] hgext.extdiff= [extdiff] cmd.vdiff = kdiff3 </code></pre> <p>When I want to use kdiff3 instead of diff I only have to use:</p> <pre><code>hg vdiff fi...
<p>I've solved this using a Mercurial built-in extension... I just have to add the following lines to Mercurial.ini (on Mercurial folder):</p> <pre><code>[extensions] hgext.extdiff= [extdiff] cmd.vdiff = kdiff3 </code></pre> <p>When I want to use kdiff3 instead of diff I only have to use:</p> <pre><code>hg vdiff fi...
606, 725, 802
configuration, diff, mercurial
<h1>Is possible to change the default diff tool in Mercurial?</h1> <p>Every time I do an <code>hg diff file.ext</code> I end up using a console diff application. I would like to use Kdiff3 or WinMerge (I'm using Windows).</p> <p>Is there a way to change that? I can't find a reference in Mercurial documentation (<stron...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,872
mercurial
# Is possible to change the default diff tool in Mercurial? Every time I do an `hg diff file.ext` I end up using a console diff application. I would like to use Kdiff3 or WinMerge (I'm using Windows). Is there a way to change that? I can't find a reference in Mercurial documentation (**I'm not talking about merge!**)...
I've solved this using a Mercurial built-in extension... I just have to add the following lines to Mercurial.ini (on Mercurial folder): ``` [extensions] hgext.extdiff= [extdiff] cmd.vdiff = kdiff3 ``` When I want to use kdiff3 instead of diff I only have to use: ``` hg vdiff file.ext ```
1067680
How to automatically remove all .orig files in Mercurial working tree?
58
2009-07-01 07:10:20
<p>During merges mercurial leaves .orig file for any unresolved file. But after manually resolving problems and marking a file correct it does not delete the .orig file. Can it be automatically removed by some command?</p> <p>I work on a Mac so I can use something like:</p> <pre><code>find . -iname '*.orig' -exec rm ...
28,992
37,086
2020-05-04 07:55:12
1,067,922
70
2009-07-01 08:19:34
110,204
2016-08-25 19:07:05
https://stackoverflow.com/q/1067680
https://stackoverflow.com/a/1067922
<p>Personally, I use</p> <pre><code>$ rm **/*.orig </code></pre> <p>if I get tired of the <code>.orig</code> files. This works in Zsh and in Bash 4 after you run <code>shopt -s globstar</code>.</p> <p>But if you use another shell or want a built-in solution, then maybe you'll like the <a href="https://www.mercurial-...
<p>Personally, I use</p> <pre><code>$ rm **/*.orig </code></pre> <p>if I get tired of the <code>.orig</code> files. This works in Zsh and in Bash 4 after you run <code>shopt -s globstar</code>.</p> <p>But if you use another shell or want a built-in solution, then maybe you'll like the <a href="https://www.mercurial-...
802, 3346, 22446
dvcs, mercurial, purge
<h1>How to automatically remove all .orig files in Mercurial working tree?</h1> <p>During merges mercurial leaves .orig file for any unresolved file. But after manually resolving problems and marking a file correct it does not delete the .orig file. Can it be automatically removed by some command?</p> <p>I work on a M...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,873
mercurial
# How to automatically remove all .orig files in Mercurial working tree? During merges mercurial leaves .orig file for any unresolved file. But after manually resolving problems and marking a file correct it does not delete the .orig file. Can it be automatically removed by some command? I work on a Mac so I can use ...
Personally, I use ``` $ rm **/*.orig ``` if I get tired of the `.orig` files. This works in Zsh and in Bash 4 after you run `shopt -s globstar`. But if you use another shell or want a built-in solution, then maybe you'll like the [purge extension](https://www.mercurial-scm.org/wiki/PurgeExtension) (link updated 2016...
12843
How to combine two projects in Mercurial?
84
2008-08-15 22:29:44
<p>I have two separate mercurial repositories. At this point it makes sense that they "become one" because I want to work on the two projects simultaneously.</p> <p>I'd really like the two projects to each be a subdirectory in the new repository.</p> <ol> <li>How do I merge the two projects?</li> <li>Is this a good i...
14,966
814
2017-05-31 11:31:52
20,591
69
2008-08-21 17:23:08
814
2017-05-31 11:30:36
https://stackoverflow.com/q/12843
https://stackoverflow.com/a/20591
<p>I was able to combine my two repositories in this way:</p> <ol> <li>Use <code>hg clone first_repository</code> to clone one of the repositories.</li> <li>Use <code>hg pull -f other_repository</code> to pull the code in from the other repository.</li> </ol> <p>The <code>-f</code> (force) flag on the pull is the key...
<p>I was able to combine my two repositories in this way:</p> <ol> <li>Use <code>hg clone first_repository</code> to clone one of the repositories.</li> <li>Use <code>hg pull -f other_repository</code> to pull the code in from the other repository.</li> </ol> <p>The <code>-f</code> (force) flag on the pull is the key...
802
mercurial
<h1>How to combine two projects in Mercurial?</h1> <p>I have two separate mercurial repositories. At this point it makes sense that they "become one" because I want to work on the two projects simultaneously.</p> <p>I'd really like the two projects to each be a subdirectory in the new repository.</p> <ol> <li>How do ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,874
mercurial
# How to combine two projects in Mercurial? I have two separate mercurial repositories. At this point it makes sense that they "become one" because I want to work on the two projects simultaneously. I'd really like the two projects to each be a subdirectory in the new repository. 1. How do I merge the two projects? ...
I was able to combine my two repositories in this way: 1. Use `hg clone first_repository` to clone one of the repositories. 2. Use `hg pull -f other_repository` to pull the code in from the other repository. The `-f` (force) flag on the pull is the key -- it says to ignore the fact that the two repositories are not f...