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
13977814
How do I debug git error: "Your local changes to the following files would be overwritten by checkout" when there's nothing to stash?
11
2012-12-20 17:57:03
<p>I'm using git-svn, and I'm trying to run <code>git svn rebase</code>.</p> <p>I get the error:</p> <pre><code>Your local changes to the following files would be overwritten by checkout: &lt;filename&gt; Please, commit your changes or stash them before you can switch branches. </code></pre> <p>I have previously run...
5,755
1,031,087
2013-07-10 13:55:44
13,977,817
11
2012-12-20 17:57:03
1,031,087
2012-12-20 17:57:03
https://stackoverflow.com/q/13977814
https://stackoverflow.com/a/13977817
<p>It turns out that I had the <code>skip-worktree</code> bit set, so I needed to run</p> <pre><code>git update-index --no-skip-worktree &lt;filename&gt; </code></pre> <p>I found this out by running </p> <pre><code>git ls-files -v | grep "^[^H]" </code></pre> <p>(Or <code>git ls-files -v | where { $_ -match "^[^H]"...
<p>It turns out that I had the <code>skip-worktree</code> bit set, so I needed to run</p> <pre><code>git update-index --no-skip-worktree &lt;filename&gt; </code></pre> <p>I found this out by running </p> <pre><code>git ls-files -v | grep "^[^H]" </code></pre> <p>(Or <code>git ls-files -v | where { $_ -match "^[^H]"...
119, 6452
git, git-svn
<h1>How do I debug git error: "Your local changes to the following files would be overwritten by checkout" when there's nothing to stash?</h1> <p>I'm using git-svn, and I'm trying to run <code>git svn rebase</code>.</p> <p>I get the error:</p> <pre><code>Your local changes to the following files would be overwritten ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,467
git
# How do I debug git error: "Your local changes to the following files would be overwritten by checkout" when there's nothing to stash? I'm using git-svn, and I'm trying to run `git svn rebase`. I get the error: ``` Your local changes to the following files would be overwritten by checkout: <filename> Please, commit...
It turns out that I had the `skip-worktree` bit set, so I needed to run ``` git update-index --no-skip-worktree <filename> ``` I found this out by running ``` git ls-files -v | grep "^[^H]" ``` (Or `git ls-files -v | where { $_ -match "^[^H]"}` with Windows Powershell) Typing `git help ls-files` explained what the...
13954486
Reset remote tracked branch
11
2012-12-19 14:27:28
<p>How can I reset the branch pointer of a remote tracked branch to one of its previous commits, so it looks like I didn't pulled (something similar like reset hard for local branches)?</p>
1,371
209,706
2012-12-19 14:31:26
13,954,558
11
2012-12-19 14:31:26
11,343
2012-12-19 14:31:26
https://stackoverflow.com/q/13954486
https://stackoverflow.com/a/13954558
<p>You can set the reference to any other commit with:</p> <pre><code>git update-ref refs/remotes/origin/master &lt;commit-sha1 or tag&gt; </code></pre> <p>This will make remote branch <code>origin/master</code> point to the commit you specified.</p>
<p>You can set the reference to any other commit with:</p> <pre><code>git update-ref refs/remotes/origin/master &lt;commit-sha1 or tag&gt; </code></pre> <p>This will make remote branch <code>origin/master</code> point to the commit you specified.</p>
119
git
<h1>Reset remote tracked branch</h1> <p>How can I reset the branch pointer of a remote tracked branch to one of its previous commits, so it looks like I didn't pulled (something similar like reset hard for local branches)?</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,468
git
# Reset remote tracked branch How can I reset the branch pointer of a remote tracked branch to one of its previous commits, so it looks like I didn't pulled (something similar like reset hard for local branches)?
You can set the reference to any other commit with: ``` git update-ref refs/remotes/origin/master <commit-sha1 or tag> ``` This will make remote branch `origin/master` point to the commit you specified.
10886784
Updating a git mirror of an SVN repository
11
2012-06-04 19:03:59
<p>I created a git mirror of an SVN repository by doing:</p> <ul> <li>Create a new repo on github</li> <li>mkdir mirror &amp;&amp; cd mirror</li> <li>git svn init [svn url]</li> <li>git svn fetch -rHEAD</li> <li>git remote add origin [github url]</li> <li>git svn rebase</li> <li>git push origin master</li> </ul> <p>T...
4,098
284,529
2024-08-03 17:04:24
12,251,845
11
2012-09-03 17:13:35
1,644,312
2015-11-27 12:52:04
https://stackoverflow.com/q/10886784
https://stackoverflow.com/a/12251845
<p>I had the same need and eventually found an example here:</p> <p><a href="http://rip747.wordpress.com/2009/06/17/reviving-a-git-svn-clone/" rel="noreferrer">http://rip747.wordpress.com/2009/06/17/reviving-a-git-svn-clone/</a></p> <p>To answer in the context of your question:</p> <pre><code>git clone [github url] ...
<p>I had the same need and eventually found an example here:</p> <p><a href="http://rip747.wordpress.com/2009/06/17/reviving-a-git-svn-clone/" rel="noreferrer">http://rip747.wordpress.com/2009/06/17/reviving-a-git-svn-clone/</a></p> <p>To answer in the context of your question:</p> <pre><code>git clone [github url] ...
119, 6452
git, git-svn
<h1>Updating a git mirror of an SVN repository</h1> <p>I created a git mirror of an SVN repository by doing:</p> <ul> <li>Create a new repo on github</li> <li>mkdir mirror &amp;&amp; cd mirror</li> <li>git svn init [svn url]</li> <li>git svn fetch -rHEAD</li> <li>git remote add origin [github url]</li> <li>git svn reb...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,469
git
# Updating a git mirror of an SVN repository I created a git mirror of an SVN repository by doing: - Create a new repo on github - mkdir mirror && cd mirror - git svn init [svn url] - git svn fetch -rHEAD - git remote add origin [github url] - git svn rebase - git push origin master This works great, and I can updat...
I had the same need and eventually found an example here: <http://rip747.wordpress.com/2009/06/17/reviving-a-git-svn-clone/> To answer in the context of your question: ``` git clone [github url] cd repo git svn init [svn url] git update-ref refs/remotes/git-svn refs/remotes/origin/master git svn rebase ```
10302637
Git and Mercurial: what would be equivalent of Git workflow in Mercurial?
11
2012-04-24 17:07:21
<pre><code>#lets get the latest git pull #lets switch to branch and do some work git checkout -b makeSomeBugs #do the work commit git add . git commit -am "introducing some bugs" #push this for my lazy remote friend to see git push origin makeSomeBugs #uh .. changes on master git pull origin master #do some work.....
6,247
911,849
2013-04-22 16:03:15
10,311,758
11
2012-04-25 08:08:58
309,760
2013-04-22 16:03:15
https://stackoverflow.com/q/10302637
https://stackoverflow.com/a/10311758
<p>I might have some bits wrong because I may have misunderstood the git, but assuming you're using a recent version of Mercurial or if not, the <a href="http://mercurial.selenic.com/wiki/Bookmarks" rel="noreferrer">bookmarks extension</a> is enabled...</p> <pre><code># lets get the latest # git pull hg pull # lets ...
<p>I might have some bits wrong because I may have misunderstood the git, but assuming you're using a recent version of Mercurial or if not, the <a href="http://mercurial.selenic.com/wiki/Bookmarks" rel="noreferrer">bookmarks extension</a> is enabled...</p> <pre><code># lets get the latest # git pull hg pull # lets ...
119, 802
git, mercurial
<h1>Git and Mercurial: what would be equivalent of Git workflow in Mercurial?</h1> <pre><code>#lets get the latest git pull #lets switch to branch and do some work git checkout -b makeSomeBugs #do the work commit git add . git commit -am "introducing some bugs" #push this for my lazy remote friend to see git push or...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,470
git
# Git and Mercurial: what would be equivalent of Git workflow in Mercurial? ``` #lets get the latest git pull #lets switch to branch and do some work git checkout -b makeSomeBugs #do the work commit git add . git commit -am "introducing some bugs" #push this for my lazy remote friend to see git push origin makeSome...
I might have some bits wrong because I may have misunderstood the git, but assuming you're using a recent version of Mercurial or if not, the [bookmarks extension](http://mercurial.selenic.com/wiki/Bookmarks) is enabled... ``` # lets get the latest # git pull hg pull # lets switch to branch and do some work # git ch...
9862173
Git. Merging changes from one file to another files WITHIN the same branch
11
2012-03-25 17:08:02
<p>I have two files:</p> <pre><code> master/newsletter1/file.html master/newsletter2/file.html </code></pre> <p>newsletter1/file.html has a lot of new changes that I want to merge into newsletter2/file.html. How can I achieve this? Everything I have read seems to resolve around merging between branches, but t...
10,474
1,012,398
2012-03-25 17:43:35
9,862,211
11
2012-03-25 17:12:32
6,309
2012-03-25 17:43:35
https://stackoverflow.com/q/9862173
https://stackoverflow.com/a/9862211
<p>I would recommend using a third-party diff tool of your choice, in order to do a manual merge between the two files.<br> This is not about source-control (ie managing the history of versions for <em>one</em> file).<br> This is about reporting changes from one files to another (the source-control tool will then pick ...
<p>I would recommend using a third-party diff tool of your choice, in order to do a manual merge between the two files.<br> This is not about source-control (ie managing the history of versions for <em>one</em> file).<br> This is about reporting changes from one files to another (the source-control tool will then pick ...
119, 717
git, merge
<h1>Git. Merging changes from one file to another files WITHIN the same branch</h1> <p>I have two files:</p> <pre><code> master/newsletter1/file.html master/newsletter2/file.html </code></pre> <p>newsletter1/file.html has a lot of new changes that I want to merge into newsletter2/file.html. How can I achieve ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,471
git
# Git. Merging changes from one file to another files WITHIN the same branch I have two files: ``` master/newsletter1/file.html master/newsletter2/file.html ``` newsletter1/file.html has a lot of new changes that I want to merge into newsletter2/file.html. How can I achieve this? Everything I have read seem...
I would recommend using a third-party diff tool of your choice, in order to do a manual merge between the two files. This is not about source-control (ie managing the history of versions for *one* file). This is about reporting changes from one files to another (the source-control tool will then pick up the new ver...
9828076
Retrieve missing files from remote repo?
11
2012-03-22 18:11:52
<p>I accidentally deleted a few files from my local git repo.</p> <p>I have not pushed this change to the remote.</p> <p>Is there a easy way to get these files back from the remote?</p> <p>Normally I would just do a <code>git clone</code> but it seems there should be a better way.</p>
10,005
1,002,260
2019-06-11 23:08:30
9,828,133
11
2012-03-22 18:16:11
1,002,260
2014-11-19 05:50:36
https://stackoverflow.com/q/9828076
https://stackoverflow.com/a/9828133
<pre><code>git checkout . </code></pre> <p><a href="https://stackoverflow.com/q/52704/#52713">How do I discard unstaged changes in Git?</a></p>
<pre><code>git checkout . </code></pre> <p><a href="https://stackoverflow.com/q/52704/#52713">How do I discard unstaged changes in Git?</a></p>
119, 7330, 41346
git, git-remote, repository
<h1>Retrieve missing files from remote repo?</h1> <p>I accidentally deleted a few files from my local git repo.</p> <p>I have not pushed this change to the remote.</p> <p>Is there a easy way to get these files back from the remote?</p> <p>Normally I would just do a <code>git clone</code> but it seems there should be...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,472
git
# Retrieve missing files from remote repo? I accidentally deleted a few files from my local git repo. I have not pushed this change to the remote. Is there a easy way to get these files back from the remote? Normally I would just do a `git clone` but it seems there should be a better way.
``` git checkout . ``` [How do I discard unstaged changes in Git?](https://stackoverflow.com/q/52704/#52713)
7451534
Git clear remote repository
11
2011-09-17 00:07:12
<p>If I push a bad initial commit (or more than one) to a remote repository and want to just clear it / destroy it - can I do it by a command?</p> <p>It's important to totally remove it from server so it doesn't use disk space.</p> <p>E.G. Today I pushed a whole Visual Studio project with included dlls, sdfs and so o...
20,990
672,018
2011-09-17 13:23:12
7,451,586
11
2011-09-17 00:18:17
275,354
2011-09-17 00:24:22
https://stackoverflow.com/q/7451534
https://stackoverflow.com/a/7451586
<p>You can force push the "correct" repo with <code>git push -f</code>. Depending on the host, the loose objects will be cleaned up when <code>git gc</code> is ran. <em>update: According to <a href="http://feedback.assembla.com/forums/5433-feature-requests/suggestions/1016769-allow-git-gc">this</a> you can't force th...
<p>You can force push the "correct" repo with <code>git push -f</code>. Depending on the host, the loose objects will be cleaned up when <code>git gc</code> is ran. <em>update: According to <a href="http://feedback.assembla.com/forums/5433-feature-requests/suggestions/1016769-allow-git-gc">this</a> you can't force th...
119
git
<h1>Git clear remote repository</h1> <p>If I push a bad initial commit (or more than one) to a remote repository and want to just clear it / destroy it - can I do it by a command?</p> <p>It's important to totally remove it from server so it doesn't use disk space.</p> <p>E.G. Today I pushed a whole Visual Studio proj...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,473
git
# Git clear remote repository If I push a bad initial commit (or more than one) to a remote repository and want to just clear it / destroy it - can I do it by a command? It's important to totally remove it from server so it doesn't use disk space. E.G. Today I pushed a whole Visual Studio project with included dlls,...
You can force push the "correct" repo with `git push -f`. Depending on the host, the loose objects will be cleaned up when `git gc` is ran. *update: According to [this](http://feedback.assembla.com/forums/5433-feature-requests/suggestions/1016769-allow-git-gc) you can't force the `git gc` in assembla.* If you want the...
7152607
git force push current working directory
11
2011-08-22 19:35:28
<p>I need to git push to remote, and that push need to be current working copy. Because, pushed source is a web host. So, pushed files need to be currently in use. I am sure no one will edit files at the host :)</p> <p>This question is follow up of these 2 questions, <a href="https://stackoverflow.com/q/7150424/886669...
13,208
886,669
2016-07-14 00:21:54
7,152,800
11
2011-08-22 19:51:12
252,046
2011-08-22 19:51:12
https://stackoverflow.com/q/7152607
https://stackoverflow.com/a/7152800
<p>Here is a step-by-step on how to create a git repo on your web host that will allow direct pushes, set it up as a remote for your local repo, and push changes to it. Note that you need to have ssh access to your web host, and have git installed.</p> <p>On your web host (ssh'd in):</p> <pre><code># create an empty ...
<p>Here is a step-by-step on how to create a git repo on your web host that will allow direct pushes, set it up as a remote for your local repo, and push changes to it. Note that you need to have ssh access to your web host, and have git installed.</p> <p>On your web host (ssh'd in):</p> <pre><code># create an empty ...
119, 28898
git, git-push
<h1>git force push current working directory</h1> <p>I need to git push to remote, and that push need to be current working copy. Because, pushed source is a web host. So, pushed files need to be currently in use. I am sure no one will edit files at the host :)</p> <p>This question is follow up of these 2 questions, <...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,474
git
# git force push current working directory I need to git push to remote, and that push need to be current working copy. Because, pushed source is a web host. So, pushed files need to be currently in use. I am sure no one will edit files at the host :) This question is follow up of these 2 questions, [Is it possible t...
Here is a step-by-step on how to create a git repo on your web host that will allow direct pushes, set it up as a remote for your local repo, and push changes to it. Note that you need to have ssh access to your web host, and have git installed. On your web host (ssh'd in): ``` # create an empty repo on your web hos...
6359332
How can I do a git pull in Maven?
11
2011-06-15 14:28:39
<p>I'm new to both maven and git and wanted to get some help in setting a project.</p> <p>Is there a way to define a goal in the pom to push/pull from git during linked to a maven phase? For example, can I pull from git during the maven install phase?</p> <p>If yes, how can that be accomplished? I would appreciate an...
28,666
786,045
2015-03-10 17:35:26
6,506,326
11
2011-06-28 12:23:57
361,343
2013-04-14 14:15:17
https://stackoverflow.com/q/6359332
https://stackoverflow.com/a/6506326
<p>Good idea or not, here's how you could do a checkout (<del>pull</del> clone from Github) using Maven. Have your pom.xml look like this:</p> <pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 htt...
<p>Good idea or not, here's how you could do a checkout (<del>pull</del> clone from Github) using Maven. Have your pom.xml look like this:</p> <pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 htt...
119, 38469, 40289, 41127
git, maven, maven-scm, pom.xml
<h1>How can I do a git pull in Maven?</h1> <p>I'm new to both maven and git and wanted to get some help in setting a project.</p> <p>Is there a way to define a goal in the pom to push/pull from git during linked to a maven phase? For example, can I pull from git during the maven install phase?</p> <p>If yes, how can ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,475
git
# How can I do a git pull in Maven? I'm new to both maven and git and wanted to get some help in setting a project. Is there a way to define a goal in the pom to push/pull from git during linked to a maven phase? For example, can I pull from git during the maven install phase? If yes, how can that be accomplished? I...
Good idea or not, here's how you could do a checkout (~~pull~~ clone from Github) using Maven. Have your pom.xml look like this: ``` <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/mav...
6131763
Git: Changes keep getting lost due to seemingly random merges
11
2011-05-25 22:33:42
<p>I have a feeling this will be an obvious answer, but I can't seem to work it out.</p> <p>What appears to happen is that I commit/push some changes to the server and everything appears fine on my copy.</p> <p>Another developer then pulls from the server from the same branch (allegedly seeing my changes, as far as I...
4,059
171,703
2016-01-13 08:12:35
6,133,469
11
2011-05-26 03:50:53
193,688
2016-01-13 08:12:35
https://stackoverflow.com/q/6131763
https://stackoverflow.com/a/6133469
<p>In your example, someone is merging f36908d (the first parent; their HEAD at the time of the merge) and 8def6e9 (the second parent; probably the tip of the origin branch at the time of the merge) to produce 326c8fd0.</p> <p>If the merge commit (326c8fd0) is missing significant pieces of content with respect to eith...
<p>In your example, someone is merging f36908d (the first parent; their HEAD at the time of the merge) and 8def6e9 (the second parent; probably the tip of the origin branch at the time of the merge) to produce 326c8fd0.</p> <p>If the merge commit (326c8fd0) is missing significant pieces of content with respect to eith...
119, 456, 31409
git, tortoisegit, version-control
<h1>Git: Changes keep getting lost due to seemingly random merges</h1> <p>I have a feeling this will be an obvious answer, but I can't seem to work it out.</p> <p>What appears to happen is that I commit/push some changes to the server and everything appears fine on my copy.</p> <p>Another developer then pulls from th...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,476
git
# Git: Changes keep getting lost due to seemingly random merges I have a feeling this will be an obvious answer, but I can't seem to work it out. What appears to happen is that I commit/push some changes to the server and everything appears fine on my copy. Another developer then pulls from the server from the same ...
In your example, someone is merging f36908d (the first parent; their HEAD at the time of the merge) and 8def6e9 (the second parent; probably the tip of the origin branch at the time of the merge) to produce 326c8fd0. If the merge commit (326c8fd0) is missing significant pieces of content with respect to either of its ...
5669209
Why do i get "error: failed to push some refs"?
11
2011-04-14 20:23:32
<p>I have a remote git repository and a local one that i work with. Whenever i do any changes locally, i push them to the remote. Then i sometime do a "git commit" on the remote one to store the changes on the remote files.</p> <p>I do not edit the remote repository directly at all. I just commit the changes. And i'm ...
61,936
1,580,201
2020-08-23 08:44:55
5,669,414
11
2011-04-14 20:42:11
69,755
2011-04-14 20:42:11
https://stackoverflow.com/q/5669209
https://stackoverflow.com/a/5669414
<p>What you should be doing is creating the remote repository as a bare repository. A bare repository is just the git repo, without a current checkout (that is, it is like just the contents of the <code>.git</code> dir in a regular Git repo, so it contains objects and refs, but it doesn't have an index or working copy ...
<p>What you should be doing is creating the remote repository as a bare repository. A bare repository is just the git repo, without a current checkout (that is, it is like just the contents of the <code>.git</code> dir in a regular Git repo, so it contains objects and refs, but it doesn't have an index or working copy ...
119
git
<h1>Why do i get "error: failed to push some refs"?</h1> <p>I have a remote git repository and a local one that i work with. Whenever i do any changes locally, i push them to the remote. Then i sometime do a "git commit" on the remote one to store the changes on the remote files.</p> <p>I do not edit the remote reposi...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,477
git
# Why do i get "error: failed to push some refs"? I have a remote git repository and a local one that i work with. Whenever i do any changes locally, i push them to the remote. Then i sometime do a "git commit" on the remote one to store the changes on the remote files. I do not edit the remote repository directly at...
What you should be doing is creating the remote repository as a bare repository. A bare repository is just the git repo, without a current checkout (that is, it is like just the contents of the `.git` dir in a regular Git repo, so it contains objects and refs, but it doesn't have an index or working copy of the file hi...
74493349
Why was `git-subtree` removed from the git-scm book?
10
2022-11-18 17:28:38
<p>When looking for documentation on <code>git-subtree</code> my search engine will show links to <a href="https://git-scm.com/docs/git-subtree" rel="noreferrer">https://git-scm.com/docs/git-subtree</a>, however when I visit that link I'm redirected to <a href="https://git-scm.com/docs" rel="noreferrer">https://git-scm...
2,395
1,254,812
2022-12-02 17:59:36
74,493,855
11
2022-11-18 18:17:43
1,254,812
2022-12-02 17:59:36
https://stackoverflow.com/q/74493349
https://stackoverflow.com/a/74493855
<p><code>git-subtree</code> is a contrib command: <a href="https://github.com/git/git/tree/master/contrib/subtree" rel="noreferrer">https://github.com/git/git/tree/master/contrib/subtree</a>. Therefore it is not part of git's core. The documentation on <a href="https://git-scm.com" rel="noreferrer">https://git-scm.com<...
<p><code>git-subtree</code> is a contrib command: <a href="https://github.com/git/git/tree/master/contrib/subtree" rel="noreferrer">https://github.com/git/git/tree/master/contrib/subtree</a>. Therefore it is not part of git's core. The documentation on <a href="https://git-scm.com" rel="noreferrer">https://git-scm.com<...
119, 68200
git, git-subtree
<h1>Why was `git-subtree` removed from the git-scm book?</h1> <p>When looking for documentation on <code>git-subtree</code> my search engine will show links to <a href="https://git-scm.com/docs/git-subtree" rel="noreferrer">https://git-scm.com/docs/git-subtree</a>, however when I visit that link I'm redirected to <a hr...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,479
git
# Why was `git-subtree` removed from the git-scm book? When looking for documentation on `git-subtree` my search engine will show links to <https://git-scm.com/docs/git-subtree>, however when I visit that link I'm redirected to <https://git-scm.com/docs>. What happened to subtree? Is is deprecated or is this just a m...
`git-subtree` is a contrib command: <https://github.com/git/git/tree/master/contrib/subtree>. Therefore it is not part of git's core. The documentation on <https://git-scm.com> is built from core git and does not include contrib software. This can be slightly confusing since package maintainers often distribute contrib...
71093803
git with Beyond Compare (4) on WSL2 Windows 11 not opening the repo version
10
2022-02-12 16:39:34
<p>Trying to get git and Beyond Compare to place nicely together on WSL. Here is the output from <code>git config --list</code>:</p> <pre><code>diff.tool=bc3 difftool.prompt=false difftool.bc3.path=/mnt/c/Program Files/Beyond Compare 4/BComp.exe merge.tool=bc3 mergetool.prompt=false mergetool.bc3.trustexitcode=true me...
3,772
1,039,860
2025-08-28 23:56:13
71,096,560
11
2022-02-12 22:58:40
6,309
2025-08-28 23:56:13
https://stackoverflow.com/q/71093803
https://stackoverflow.com/a/71096560
<p>Check if <a href="https://forum.scootersoftware.com/forum/beyond-compare-4-discussion/version-control-aa/14411-new-updates-in-windows-wsl?p=82512#post82512" rel="nofollow noreferrer">this configuration</a> might work in your case:</p> <blockquote> <p>I managed to get it working using the built-in <code>wslpath</code...
<p>Check if <a href="https://forum.scootersoftware.com/forum/beyond-compare-4-discussion/version-control-aa/14411-new-updates-in-windows-wsl?p=82512#post82512" rel="nofollow noreferrer">this configuration</a> might work in your case:</p> <blockquote> <p>I managed to get it working using the built-in <code>wslpath</code...
119, 15129, 119526
beyondcompare, git, windows-subsystem-for-linux
<h1>git with Beyond Compare (4) on WSL2 Windows 11 not opening the repo version</h1> <p>Trying to get git and Beyond Compare to place nicely together on WSL. Here is the output from <code>git config --list</code>:</p> <pre><code>diff.tool=bc3 difftool.prompt=false difftool.bc3.path=/mnt/c/Program Files/Beyond Compare ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,480
git
# git with Beyond Compare (4) on WSL2 Windows 11 not opening the repo version Trying to get git and Beyond Compare to place nicely together on WSL. Here is the output from `git config --list`: ``` diff.tool=bc3 difftool.prompt=false difftool.bc3.path=/mnt/c/Program Files/Beyond Compare 4/BComp.exe merge.tool=bc3 merg...
Check if [this configuration](https://forum.scootersoftware.com/forum/beyond-compare-4-discussion/version-control-aa/14411-new-updates-in-windows-wsl?p=82512#post82512) might work in your case: > I managed to get it working using the built-in `wslpath` command which comes with new WSL versions! > > My git config on WS...
63623581
How do I accept git merge conflicts from "their" branch for only a certain directory?
10
2020-08-27 20:15:03
<p>Here's my situation: <code>git merge master</code> results in 50 files with merge conflicts. I want 45 of them to just be accepted from <code>master</code> and be done, and I want to <em>manually resolve</em> conflicts in the remaining 5. All 45 of those files are in directory <code>some/dir</code>. The other 5 are...
7,843
4,561,887
2025-06-10 23:11:11
66,466,786
11
2021-03-04 00:13:21
4,561,887
2025-06-10 23:11:11
https://stackoverflow.com/q/63623581
https://stackoverflow.com/a/66466786
<p>After upvoting and marking correct <a href="https://stackoverflow.com/a/63624168/4561887">this answer</a> 6 months ago, I realized today after a very large and very botched <code>merge</code> where this was needed that that answer is wrong. Let's say you did this, to update your <code>feature_branch</code> with the...
<p>After upvoting and marking correct <a href="https://stackoverflow.com/a/63624168/4561887">this answer</a> 6 months ago, I realized today after a very large and very botched <code>merge</code> where this was needed that that answer is wrong. Let's say you did this, to update your <code>feature_branch</code> with the...
119, 717, 28897
git, git-merge, merge
<h1>How do I accept git merge conflicts from "their" branch for only a certain directory?</h1> <p>Here's my situation: <code>git merge master</code> results in 50 files with merge conflicts. I want 45 of them to just be accepted from <code>master</code> and be done, and I want to <em>manually resolve</em> conflicts in...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,481
git
# How do I accept git merge conflicts from "their" branch for only a certain directory? Here's my situation: `git merge master` results in 50 files with merge conflicts. I want 45 of them to just be accepted from `master` and be done, and I want to *manually resolve* conflicts in the remaining 5. All 45 of those files...
After upvoting and marking correct [this answer](https://stackoverflow.com/a/63624168/4561887) 6 months ago, I realized today after a very large and very botched `merge` where this was needed that that answer is wrong. Let's say you did this, to update your `feature_branch` with the latest changes from `master`: ``` g...
62548768
Match dirs using `**/` in gitattributes
10
2020-06-24 06:13:13
<p>I was expecting <code>**/</code> to match any directory in the git repo, but in fact it matches nothing. <code>man gitattributes</code> says:</p> <blockquote> <p>patterns that match a directory do not recursively match paths inside that directory (so using the trailing-slash path/ syntax is pointless in an attribute...
7,743
418,966
2021-09-23 10:24:50
62,564,526
11
2020-06-24 21:42:10
1,256,452
2021-09-23 10:24:50
https://stackoverflow.com/q/62548768
https://stackoverflow.com/a/62564526
<p>Unlike <code>.gitignore</code>, which <em>does</em> special-case directory handling, it appears that—with one important exception—the <code>.gitattributes</code> code never special-cases a directory. This is in part because Git doesn't really <em>store</em> directories.<sup>1</sup> So each attribute is applied to ...
<p>Unlike <code>.gitignore</code>, which <em>does</em> special-case directory handling, it appears that—with one important exception—the <code>.gitattributes</code> code never special-cases a directory. This is in part because Git doesn't really <em>store</em> directories.<sup>1</sup> So each attribute is applied to ...
119, 56102
git, gitattributes
<h1>Match dirs using `**/` in gitattributes</h1> <p>I was expecting <code>**/</code> to match any directory in the git repo, but in fact it matches nothing. <code>man gitattributes</code> says:</p> <blockquote> <p>patterns that match a directory do not recursively match paths inside that directory (so using the trailin...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,484
git
# Match dirs using `**/` in gitattributes I was expecting `**/` to match any directory in the git repo, but in fact it matches nothing. `man gitattributes` says: > patterns that match a directory do not recursively match paths inside that directory (so using the > trailing-slash path/ syntax is pointless in an attrib...
Unlike `.gitignore`, which *does* special-case directory handling, it appears that—with one important exception—the `.gitattributes` code never special-cases a directory. This is in part because Git doesn't really *store* directories.1 So each attribute is applied to some set of files. Despite this, files *do* reside i...
58337861
Disable hooks for a single git command
10
2019-10-11 09:08:45
<p>Given that I need to use git inside my hook scripts, I would prefer my hook scripts to not trigger hooks themselves. So I want to skip hooks on a per-command basis.</p> <p>i.e. I am looking for an option like:</p> <p><code>git --no-hooks some-git-command</code></p>
5,315
4,669,135
2022-12-20 21:03:22
58,337,862
11
2019-10-11 09:08:45
4,669,135
2019-10-11 09:08:45
https://stackoverflow.com/q/58337861
https://stackoverflow.com/a/58337862
<p>You can use:</p> <p><code>git -c core.hooksPath=/dev/null some-git-command</code></p> <p>If you are not on an Unix (no <code>/dev/null</code>) I suppose that you can use:</p> <p><code>git -c core.hooksPath= some-git-command</code></p>
<p>You can use:</p> <p><code>git -c core.hooksPath=/dev/null some-git-command</code></p> <p>If you are not on an Unix (no <code>/dev/null</code>) I suppose that you can use:</p> <p><code>git -c core.hooksPath= some-git-command</code></p>
119, 853, 11225
command-line-interface, git, hook
<h1>Disable hooks for a single git command</h1> <p>Given that I need to use git inside my hook scripts, I would prefer my hook scripts to not trigger hooks themselves. So I want to skip hooks on a per-command basis.</p> <p>i.e. I am looking for an option like:</p> <p><code>git --no-hooks some-git-command</code></p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,486
git
# Disable hooks for a single git command Given that I need to use git inside my hook scripts, I would prefer my hook scripts to not trigger hooks themselves. So I want to skip hooks on a per-command basis. i.e. I am looking for an option like: `git --no-hooks some-git-command`
You can use: `git -c core.hooksPath=/dev/null some-git-command` If you are not on an Unix (no `/dev/null`) I suppose that you can use: `git -c core.hooksPath= some-git-command`
52542803
Take sha number of commit by tig
10
2018-09-27 18:07:48
<p>I love to use <a href="https://jonas.github.io/tig/" rel="noreferrer">tig</a> client to navigate through git commits.</p> <p>But I'm missing one thing for now.</p> <p>Is there a key binding to take a sha number of a git commit I'm currently staying at?</p>
2,592
458,137
2021-11-30 23:26:28
52,578,478
11
2018-09-30 13:48:48
6,309
2018-10-01 11:54:04
https://stackoverflow.com/q/52542803
https://stackoverflow.com/a/52578478
<p>Check if the command proposed in <a href="https://github.com/jonas/tig/issues/557" rel="noreferrer"><code>jonas/tig</code> issue 557</a> would work for you:</p> <pre><code>bind generic 9 !sh -c "echo -n %(commit) | xclip -selection c &amp;&amp; echo Copied %(commit) to clipboard" </code></pre> <p>That would copy t...
<p>Check if the command proposed in <a href="https://github.com/jonas/tig/issues/557" rel="noreferrer"><code>jonas/tig</code> issue 557</a> would work for you:</p> <pre><code>bind generic 9 !sh -c "echo -n %(commit) | xclip -selection c &amp;&amp; echo Copied %(commit) to clipboard" </code></pre> <p>That would copy t...
119, 10188, 89723
git, sha, tig
<h1>Take sha number of commit by tig</h1> <p>I love to use <a href="https://jonas.github.io/tig/" rel="noreferrer">tig</a> client to navigate through git commits.</p> <p>But I'm missing one thing for now.</p> <p>Is there a key binding to take a sha number of a git commit I'm currently staying at?</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,487
git
# Take sha number of commit by tig I love to use [tig](https://jonas.github.io/tig/) client to navigate through git commits. But I'm missing one thing for now. Is there a key binding to take a sha number of a git commit I'm currently staying at?
Check if the command proposed in [`jonas/tig` issue 557](https://github.com/jonas/tig/issues/557) would work for you: ``` bind generic 9 !sh -c "echo -n %(commit) | xclip -selection c && echo Copied %(commit) to clipboard" ``` That would copy the [current commit SHA1](https://github.com/jonas/tig/blob/d75c51099cb0d7b...
51876769
Should you commit .vscode/symbols file to source control?
10
2018-08-16 12:11:04
<p><a href="https://stackoverflow.com/a/32979933/11236">This popular answers</a> says you should commit the entire <code>.vscode</code> folder into source control ... so one of my team members did just that.</p> <p>However, I'm now finding that a file <code>.vscode/symbols.json</code> is destined to be committed. This...
1,642
11,236
2018-08-16 14:24:42
51,878,982
11
2018-08-16 14:04:24
354,577
2018-08-16 14:24:42
https://stackoverflow.com/q/51876769
https://stackoverflow.com/a/51878982
<p>gitignore.io recommends <a href="https://www.gitignore.io/api/visualstudiocode" rel="noreferrer">ignoring everything but a few files</a>:</p> <pre><code># Created by https://www.gitignore.io/api/visualstudiocode ### VisualStudioCode ### .vscode/* !.vscode/settings.json !.vscode/tasks.json !.vscode/launch.json !.vs...
<p>gitignore.io recommends <a href="https://www.gitignore.io/api/visualstudiocode" rel="noreferrer">ignoring everything but a few files</a>:</p> <pre><code># Created by https://www.gitignore.io/api/visualstudiocode ### VisualStudioCode ### .vscode/* !.vscode/settings.json !.vscode/tasks.json !.vscode/launch.json !.vs...
119, 456, 111608
git, version-control, visual-studio-code
<h1>Should you commit .vscode/symbols file to source control?</h1> <p><a href="https://stackoverflow.com/a/32979933/11236">This popular answers</a> says you should commit the entire <code>.vscode</code> folder into source control ... so one of my team members did just that.</p> <p>However, I'm now finding that a file ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,488
git
# Should you commit .vscode/symbols file to source control? [This popular answers](https://stackoverflow.com/a/32979933/11236) says you should commit the entire `.vscode` folder into source control ... so one of my team members did just that. However, I'm now finding that a file `.vscode/symbols.json` is destined to ...
gitignore.io recommends [ignoring everything but a few files](https://www.gitignore.io/api/visualstudiocode): ``` # Created by https://www.gitignore.io/api/visualstudiocode ### VisualStudioCode ### .vscode/* !.vscode/settings.json !.vscode/tasks.json !.vscode/launch.json !.vscode/extensions.json # End of https://www...
42644792
Verifying jwt tokens [rsa]
10
2017-03-07 09:41:55
<p>A collegue and myself have been trying to understand how jwt tokens verify tokens, but from our reading we seem to be confusing ourselves.</p> <p>Please can someone help confirm whether my thinking is correct</p> <ul> <li>Tokens are signed using the private key. The signature is a combination of the header and pay...
11,771
799,618
2021-02-18 22:49:21
42,646,281
11
2017-03-07 10:50:18
6,371,459
2017-03-07 12:04:20
https://stackoverflow.com/q/42644792
https://stackoverflow.com/a/42646281
<p>Tokens can be digitally signed using a key pair, private and public, or hashed using a secret key:</p> <ul> <li><p><code>RS256</code> :RSA KeyPair with SHA256. Token is signed with private key and verified using the public </p></li> <li><p><code>HS256</code>: HMAC key with SHA256. The key is the same to sign and ve...
<p>Tokens can be digitally signed using a key pair, private and public, or hashed using a secret key:</p> <ul> <li><p><code>RS256</code> :RSA KeyPair with SHA256. Token is signed with private key and verified using the public </p></li> <li><p><code>HS256</code>: HMAC key with SHA256. The key is the same to sign and ve...
2387, 17782, 65223
cryptography, digital-signature, jwt
<h1>Verifying jwt tokens [rsa]</h1> <p>A collegue and myself have been trying to understand how jwt tokens verify tokens, but from our reading we seem to be confusing ourselves.</p> <p>Please can someone help confirm whether my thinking is correct</p> <ul> <li>Tokens are signed using the private key. The signature is...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,491
git
# Verifying jwt tokens [rsa] A collegue and myself have been trying to understand how jwt tokens verify tokens, but from our reading we seem to be confusing ourselves. Please can someone help confirm whether my thinking is correct - Tokens are signed using the private key. The signature is a combination of the heade...
Tokens can be digitally signed using a key pair, private and public, or hashed using a secret key: - `RS256` :RSA KeyPair with SHA256. Token is signed with private key and verified using the public - `HS256`: HMAC key with SHA256. The key is the same to sign and verify A compact JWT looks like this `hhhhh.ppppp.sssss...
30246435
Generate random data with lat-long
10
2015-05-14 20:10:17
<p>I am trying to generate random data with range of specific latitude and longitude. The code below executes with no errors and also generates output but not fully what I am expecting.</p> <p>Program:</p> <pre><code>import random import sys import math latitude = 19.99 longitude = 73.78 output_file = 'filename' de...
16,416
null
2022-07-12 17:43:21
30,247,616
11
2015-05-14 21:24:30
4,663,466
2015-05-14 22:51:23
https://stackoverflow.com/q/30246435
https://stackoverflow.com/a/30247616
<p>I think this is what you are trying to do. I understand you are writing to a file; I took that off here just for the sake of this example.</p> <pre><code>import random import sys import math latitude = 19.99 longitude = 73.78 def generate_random_data(lat, lon, num_rows): for _ in xrange(num_rows): he...
<p>I think this is what you are trying to do. I understand you are writing to a file; I took that off here just for the sake of this example.</p> <pre><code>import random import sys import math latitude = 19.99 longitude = 73.78 def generate_random_data(lat, lon, num_rows): for _ in xrange(num_rows): he...
16, 197, 259, 20301
latitude-longitude, math, python, random
<h1>Generate random data with lat-long</h1> <p>I am trying to generate random data with range of specific latitude and longitude. The code below executes with no errors and also generates output but not fully what I am expecting.</p> <p>Program:</p> <pre><code>import random import sys import math latitude = 19.99 lo...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,492
git
# Generate random data with lat-long I am trying to generate random data with range of specific latitude and longitude. The code below executes with no errors and also generates output but not fully what I am expecting. Program: ``` import random import sys import math latitude = 19.99 longitude = 73.78 output_file...
I think this is what you are trying to do. I understand you are writing to a file; I took that off here just for the sake of this example. ``` import random import sys import math latitude = 19.99 longitude = 73.78 def generate_random_data(lat, lon, num_rows): for _ in xrange(num_rows): hex1 = '%012x' % ...
29935659
Gradle: How to perform git pull through gradle?
10
2015-04-29 06:09:53
<p>I want to pull changes from git repo before compilation begins. I found this <a href="https://stackoverflow.com/questions/13719676/gradle-how-to-clone-a-git-repo-in-a-task">Gradle: how to clone a git repo in a task?</a>, but it clones the repo instead of fetching just the changes. This could be time consuming if th...
10,436
681,671
2015-04-29 14:03:05
29,946,081
11
2015-04-29 14:03:05
624,706
2015-04-29 14:03:05
https://stackoverflow.com/q/29935659
https://stackoverflow.com/a/29946081
<p>You can create <code>Exec</code> task and run any shell/cmd command. No extra plugin dependency required for simple tasks. </p> <pre><code>task gitPull(type: Exec) { description 'Pulls git.' commandLine "git", "pull" } </code></pre> <p>Usage: <code>gradlew gitPull</code></p> <p>You should see smth like th...
<p>You can create <code>Exec</code> task and run any shell/cmd command. No extra plugin dependency required for simple tasks. </p> <pre><code>task gitPull(type: Exec) { description 'Pulls git.' commandLine "git", "pull" } </code></pre> <p>Usage: <code>gradlew gitPull</code></p> <p>You should see smth like th...
17, 119, 5647, 32307
build, git, gradle, java
<h1>Gradle: How to perform git pull through gradle?</h1> <p>I want to pull changes from git repo before compilation begins. I found this <a href="https://stackoverflow.com/questions/13719676/gradle-how-to-clone-a-git-repo-in-a-task">Gradle: how to clone a git repo in a task?</a>, but it clones the repo instead of fetc...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,493
git
# Gradle: How to perform git pull through gradle? I want to pull changes from git repo before compilation begins. I found this [Gradle: how to clone a git repo in a task?](https://stackoverflow.com/questions/13719676/gradle-how-to-clone-a-git-repo-in-a-task), but it clones the repo instead of fetching just the changes...
You can create `Exec` task and run any shell/cmd command. No extra plugin dependency required for simple tasks. ``` task gitPull(type: Exec) { description 'Pulls git.' commandLine "git", "pull" } ``` Usage: `gradlew gitPull` You should see smth like this: ``` gradlew gitPull Parallel execution is an incuba...
29153650
How to check out most recent git tag using Ansible?
10
2015-03-19 19:47:30
<p>Is there an easy way to have Ansible check out the most recent tag on a particular git branch, without having to specify or pass in the tag? That is, can Ansible detect or derive the most recent tag on a branch or is that something that needs to be done separately using the shell module or something?</p>
17,696
147,937
2024-03-21 06:07:39
29,157,519
11
2015-03-20 00:41:08
1,287,889
2015-03-20 00:46:08
https://stackoverflow.com/q/29153650
https://stackoverflow.com/a/29157519
<p>Ansible doesn't have checking out of the latest tag as a built in feature. It does have the <code>update</code> parameter for its <code>git</code> module which will ensure a particular repo is fully up to date with the HEAD of its remote.</p> <pre><code>--- - git: repo=git@github.com:username/reponame.git dest={{ ...
<p>Ansible doesn't have checking out of the latest tag as a built in feature. It does have the <code>update</code> parameter for its <code>git</code> module which will ensure a particular repo is fully up to date with the HEAD of its remote.</p> <pre><code>--- - git: repo=git@github.com:username/reponame.git dest={{ ...
115, 119, 190, 86394
ansible, deployment, git, tags
<h1>How to check out most recent git tag using Ansible?</h1> <p>Is there an easy way to have Ansible check out the most recent tag on a particular git branch, without having to specify or pass in the tag? That is, can Ansible detect or derive the most recent tag on a branch or is that something that needs to be done se...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,494
git
# How to check out most recent git tag using Ansible? Is there an easy way to have Ansible check out the most recent tag on a particular git branch, without having to specify or pass in the tag? That is, can Ansible detect or derive the most recent tag on a branch or is that something that needs to be done separately ...
Ansible doesn't have checking out of the latest tag as a built in feature. It does have the `update` parameter for its `git` module which will ensure a particular repo is fully up to date with the HEAD of its remote. ``` --- - git: repo=git@github.com:username/reponame.git dest={{ path }} update=yes force=no ``` Forc...
24896923
kable displays different number of digits in each column
10
2014-07-22 20:09:29
<p>I am using kable with the knit to Word functionality at work. I find that I often have simple tables with counts as the first column and then a few columns with proportions. I'd like the count column to be rounded to the nearest digit and the other columns to the nearest hundredth. I've tried using the digits = c...
18,415
3,866,200
2017-04-29 22:01:30
24,965,477
11
2014-07-25 22:30:15
559,676
2014-07-25 22:30:15
https://stackoverflow.com/q/24896923
https://stackoverflow.com/a/24965477
<p>I do not see the problem here.</p> <pre><code>&gt; knitr::kable(as.data.frame(matrix(rnorm(12), 4)), digits = c(0, 2, 2)) | V1| V2| V3| |--:|-----:|-----:| | -1| 2.11| -0.54| | 0| -0.33| 0.95| | -1| -1.14| -0.96| | 0| 1.45| -0.93| &gt; sessionInfo() R version 3.1.1 (2014-07-10) Platform: x86_64-pc-linu...
<p>I do not see the problem here.</p> <pre><code>&gt; knitr::kable(as.data.frame(matrix(rnorm(12), 4)), digits = c(0, 2, 2)) | V1| V2| V3| |--:|-----:|-----:| | -1| 2.11| -0.54| | 0| -0.33| 0.95| | -1| -1.14| -0.96| | 0| 1.45| -0.93| &gt; sessionInfo() R version 3.1.1 (2014-07-10) Platform: x86_64-pc-linu...
4452, 9914, 75535
digits, knitr, r
<h1>kable displays different number of digits in each column</h1> <p>I am using kable with the knit to Word functionality at work. I find that I often have simple tables with counts as the first column and then a few columns with proportions. I'd like the count column to be rounded to the nearest digit and the other ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,495
git
# kable displays different number of digits in each column I am using kable with the knit to Word functionality at work. I find that I often have simple tables with counts as the first column and then a few columns with proportions. I'd like the count column to be rounded to the nearest digit and the other columns to ...
I do not see the problem here. ``` > knitr::kable(as.data.frame(matrix(rnorm(12), 4)), digits = c(0, 2, 2)) | V1| V2| V3| |--:|-----:|-----:| | -1| 2.11| -0.54| | 0| -0.33| 0.95| | -1| -1.14| -0.96| | 0| 1.45| -0.93| > sessionInfo() R version 3.1.1 (2014-07-10) Platform: x86_64-pc-linux-gnu (64-bit) loca...
24893918
Cannot SSH using private key while building Docker image
10
2014-07-22 17:26:57
<p>I'm having trouble checking out a private git repository hosted on GitHub during a Docker image build. The error from SSH in verbose mode is:</p> <pre><code>OpenSSH_6.6.1, OpenSSL 1.0.1f 6 Jan 2014 debug1: Reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 19: Applying options for * deb...
6,245
684,908
2014-07-22 22:00:05
24,898,612
11
2014-07-22 22:00:05
2,430,241
2014-07-22 22:00:05
https://stackoverflow.com/q/24893918
https://stackoverflow.com/a/24898612
<p>You need to accept the Github host key. Use <code>ssh-keyscan</code>:</p> <pre><code>ssh-keyscan -t rsa github.com 2&gt;&amp;1 &gt;&gt; /root/.ssh/known_hosts </code></pre>
<p>You need to accept the Github host key. Use <code>ssh-keyscan</code>:</p> <pre><code>ssh-keyscan -t rsa github.com 2&gt;&amp;1 &gt;&gt; /root/.ssh/known_hosts </code></pre>
119, 386, 3305, 90304
docker, git, openssh, ssh
<h1>Cannot SSH using private key while building Docker image</h1> <p>I'm having trouble checking out a private git repository hosted on GitHub during a Docker image build. The error from SSH in verbose mode is:</p> <pre><code>OpenSSH_6.6.1, OpenSSL 1.0.1f 6 Jan 2014 debug1: Reading configuration data /etc/ssh/ssh_conf...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,496
git
# Cannot SSH using private key while building Docker image I'm having trouble checking out a private git repository hosted on GitHub during a Docker image build. The error from SSH in verbose mode is: ``` OpenSSH_6.6.1, OpenSSL 1.0.1f 6 Jan 2014 debug1: Reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/...
You need to accept the Github host key. Use `ssh-keyscan`: ``` ssh-keyscan -t rsa github.com 2>&1 >> /root/.ssh/known_hosts ```
23422185
How does Git store large files over many commits?
10
2014-05-02 06:35:06
<p>So I have started using <code>git</code> for a while now and understanding how it works gradually. One main point I understood is that - It creates a snapshot every time a new commit is made. Of course snapshot will contain only changed files and pointers to unchanged file.</p> <p>According to <a href="http://git-s...
685
372,887
2014-05-02 09:35:40
23,422,786
11
2014-05-02 07:15:04
1,256,452
2014-05-02 09:35:40
https://stackoverflow.com/q/23422185
https://stackoverflow.com/a/23422786
<p>The short answer is "yes, you now have 10 2GB files". However:</p> <ol> <li><p>"Files" under a commit are stored as "blob" objects, and <em>all</em> git objects (blobs, trees, commits, and annotated-tags) are kept internally in zlib deflated format. So a 2 GB text file is actually a considerably smaller object.</...
<p>The short answer is "yes, you now have 10 2GB files". However:</p> <ol> <li><p>"Files" under a commit are stored as "blob" objects, and <em>all</em> git objects (blobs, trees, commits, and annotated-tags) are kept internally in zlib deflated format. So a 2 GB text file is actually a considerably smaller object.</...
119
git
<h1>How does Git store large files over many commits?</h1> <p>So I have started using <code>git</code> for a while now and understanding how it works gradually. One main point I understood is that - It creates a snapshot every time a new commit is made. Of course snapshot will contain only changed files and pointers to...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,497
git
# How does Git store large files over many commits? So I have started using `git` for a while now and understanding how it works gradually. One main point I understood is that - It creates a snapshot every time a new commit is made. Of course snapshot will contain only changed files and pointers to unchanged file. Ac...
The short answer is "yes, you now have 10 2GB files". However: 1. "Files" under a commit are stored as "blob" objects, and *all* git objects (blobs, trees, commits, and annotated-tags) are kept internally in zlib deflated format. So a 2 GB text file is actually a considerably smaller object. 2. "Loose" objects (all of...
23115777
git archive with unstaged changes
10
2014-04-16 17:03:17
<p>I'm building my own rpm's. Usually I use git archive to get a tarball from the commit or tag I'm interested in (suppose I have put a tag 1.0):</p> <pre><code>git archive --format=tgz --prefix=product-1.0 1.0 &gt; product-1.0.tgz </code></pre> <p>suppose now I am doing some local developments that I haven't committ...
8,665
2,082,964
2021-05-25 13:04:26
23,115,897
11
2014-04-16 17:09:53
1,893,248
2014-04-16 17:09:53
https://stackoverflow.com/q/23115777
https://stackoverflow.com/a/23115897
<p>I'm not 100% sure this is exactly what you want, but you can stash the changes you've made with <code>git stash create</code>, which will give you a hash for the current state of the repo - and then create an archive for it with <code>git archive &lt;options&gt; $HASH</code>.</p>
<p>I'm not 100% sure this is exactly what you want, but you can stash the changes you've made with <code>git stash create</code>, which will give you a hash for the current state of the repo - and then create an archive for it with <code>git archive &lt;options&gt; $HASH</code>.</p>
119, 81662
git, git-archive
<h1>git archive with unstaged changes</h1> <p>I'm building my own rpm's. Usually I use git archive to get a tarball from the commit or tag I'm interested in (suppose I have put a tag 1.0):</p> <pre><code>git archive --format=tgz --prefix=product-1.0 1.0 &gt; product-1.0.tgz </code></pre> <p>suppose now I am doing som...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,498
git
# git archive with unstaged changes I'm building my own rpm's. Usually I use git archive to get a tarball from the commit or tag I'm interested in (suppose I have put a tag 1.0): ``` git archive --format=tgz --prefix=product-1.0 1.0 > product-1.0.tgz ``` suppose now I am doing some local developments that I haven't ...
I'm not 100% sure this is exactly what you want, but you can stash the changes you've made with `git stash create`, which will give you a hash for the current state of the repo - and then create an archive for it with `git archive <options> $HASH`.
20326480
Can I have "git stash" to automatically include untracked files by default?
10
2013-12-02 10:52:39
<p>Well, as the title says, is there an option I can set in git, that will make it automatically include untracked files when I execute <code>git stash</code>, so I don't have to remember the <code>-u</code> option.</p> <p>Alternately, after I created a stash, and I discover that I forgot to include untracked files, c...
1,219
158,483
2018-09-24 18:49:40
20,329,467
11
2013-12-02 13:27:22
720,999
2018-09-24 18:49:40
https://stackoverflow.com/q/20326480
https://stackoverflow.com/a/20329467
<p>I failed to find a configuration option to do this in the <code>git-config</code> manual page (<code>$ man git-config</code>, or <code>$ git config --help</code>, or <a href="https://git-scm.com/docs/git-config" rel="noreferrer">read it online</a>), but you can get away easily using an alias:</p> <pre><code>$ git c...
<p>I failed to find a configuration option to do this in the <code>git-config</code> manual page (<code>$ man git-config</code>, or <code>$ git config --help</code>, or <a href="https://git-scm.com/docs/git-config" rel="noreferrer">read it online</a>), but you can get away easily using an alias:</p> <pre><code>$ git c...
119, 13091
git, git-stash
<h1>Can I have "git stash" to automatically include untracked files by default?</h1> <p>Well, as the title says, is there an option I can set in git, that will make it automatically include untracked files when I execute <code>git stash</code>, so I don't have to remember the <code>-u</code> option.</p> <p>Alternately...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,499
git
# Can I have "git stash" to automatically include untracked files by default? Well, as the title says, is there an option I can set in git, that will make it automatically include untracked files when I execute `git stash`, so I don't have to remember the `-u` option. Alternately, after I created a stash, and I disco...
I failed to find a configuration option to do this in the `git-config` manual page (`$ man git-config`, or `$ git config --help`, or [read it online](https://git-scm.com/docs/git-config)), but you can get away easily using an alias: ``` $ git config alias.stashall 'stash -u' $ git stashall ```
16419217
Git pull till certain commit (tag)
10
2013-05-07 12:35:38
<p>I have a clone of a remote repository. I updated its remote url to my own server. Then I did some commits and pushed them to my repository. Now I need to pull some changes from the initial repository. From a specific branch. I can do it by running</p> <pre><code>git pull http://example.com/repo.git example_branch <...
9,539
580,371
2016-07-01 12:04:10
16,419,361
11
2013-05-07 12:42:07
1,814,922
2013-05-07 12:42:07
https://stackoverflow.com/q/16419217
https://stackoverflow.com/a/16419361
<p><code>git pull</code>is just a <code>git fetch</code> followed by a <code>git merge</code>. So you can easily do a <code>git fetch</code> and then merge the desired commit / tag.</p>
<p><code>git pull</code>is just a <code>git fetch</code> followed by a <code>git merge</code>. So you can easily do a <code>git fetch</code> and then merge the desired commit / tag.</p>
119, 28896
git, git-pull
<h1>Git pull till certain commit (tag)</h1> <p>I have a clone of a remote repository. I updated its remote url to my own server. Then I did some commits and pushed them to my repository. Now I need to pull some changes from the initial repository. From a specific branch. I can do it by running</p> <pre><code>git pull ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,502
git
# Git pull till certain commit (tag) I have a clone of a remote repository. I updated its remote url to my own server. Then I did some commits and pushed them to my repository. Now I need to pull some changes from the initial repository. From a specific branch. I can do it by running ``` git pull http://example.com/r...
`git pull`is just a `git fetch` followed by a `git merge`. So you can easily do a `git fetch` and then merge the desired commit / tag.
16315379
Log of remote history
10
2013-05-01 09:00:20
<p>I have been asked to make a log of all the pushes made to a remote repository during a working day to display along side our build information. I am having trouble getting the necessary information for the remote repository.</p> <p>I can get the info in relation to my local version of the repository with "$git log"...
5,790
1,638,176
2017-03-31 06:11:43
16,315,536
11
2013-05-01 09:11:23
1,002,260
2013-05-01 09:11:23
https://stackoverflow.com/q/16315379
https://stackoverflow.com/a/16315536
<pre class="lang-sh prettyprint-override"><code>git log origin </code></pre> <p>This will give you a log of commits on the <code>origin</code> remote.</p> <p><a href="http://kernel.org/pub/software/scm/git/docs/git-log.html" rel="noreferrer"><code>git-log(1)</code></a></p>
<pre class="lang-sh prettyprint-override"><code>git log origin </code></pre> <p>This will give you a log of commits on the <code>origin</code> remote.</p> <p><a href="http://kernel.org/pub/software/scm/git/docs/git-log.html" rel="noreferrer"><code>git-log(1)</code></a></p>
119
git
<h1>Log of remote history</h1> <p>I have been asked to make a log of all the pushes made to a remote repository during a working day to display along side our build information. I am having trouble getting the necessary information for the remote repository.</p> <p>I can get the info in relation to my local version of...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,503
git
# Log of remote history I have been asked to make a log of all the pushes made to a remote repository during a working day to display along side our build information. I am having trouble getting the necessary information for the remote repository. I can get the info in relation to my local version of the repository ...
``` git log origin ``` This will give you a log of commits on the `origin` remote. [`git-log(1)`](http://kernel.org/pub/software/scm/git/docs/git-log.html)
12055303
Merging git notes when there are merge conflicts in them
10
2012-08-21 12:54:56
<p>I <a href="http://vmiklos.hu/blog/git-notes-merge" rel="nofollow noreferrer">followed these instructions</a> in order to merge Git notes.</p> <p>I cloned a repo, added notes reference to the commit (<code>refs/notes/commits</code>). When i push it, central repo rejects it as it was non-fast forward—because there was...
3,301
1,288,207
2023-05-12 21:45:12
16,269,354
11
2013-04-28 23:56:06
179,332
2013-04-29 12:55:45
https://stackoverflow.com/q/12055303
https://stackoverflow.com/a/16269354
<p>As I already alluded to in a comment, one reason the first approach is not working for you is that you copied the instructions wrong: your second step <code>git fetch refs/notes/commits</code> is missing the name of the remote.</p> <p>Regarding the second approach with <code>git notes merge</code>, again you have m...
<p>As I already alluded to in a comment, one reason the first approach is not working for you is that you copied the instructions wrong: your second step <code>git fetch refs/notes/commits</code> is missing the name of the remote.</p> <p>Regarding the second approach with <code>git notes merge</code>, again you have m...
119, 88239, 106113
git, git-merge-conflict, git-notes
<h1>Merging git notes when there are merge conflicts in them</h1> <p>I <a href="http://vmiklos.hu/blog/git-notes-merge" rel="nofollow noreferrer">followed these instructions</a> in order to merge Git notes.</p> <p>I cloned a repo, added notes reference to the commit (<code>refs/notes/commits</code>). When i push it, ce...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,504
git
# Merging git notes when there are merge conflicts in them I [followed these instructions](http://vmiklos.hu/blog/git-notes-merge) in order to merge Git notes. I cloned a repo, added notes reference to the commit (`refs/notes/commits`). When i push it, central repo rejects it as it was non-fast forward—because there ...
As I already alluded to in a comment, one reason the first approach is not working for you is that you copied the instructions wrong: your second step `git fetch refs/notes/commits` is missing the name of the remote. Regarding the second approach with `git notes merge`, again you have made the same mistake of missing ...
15455686
git rm --cached and 'deleted' status
10
2013-03-16 22:54:45
<p>I am wondering why when I do:</p> <pre><code>git add &lt;file&gt; </code></pre> <p>and after that, I do:</p> <pre><code>git rm --cached &lt;file&gt; </code></pre> <p>The file remains in <strong>deleted</strong> status in the <strong>stage área</strong>.</p> <p>Here the example: <img src="https://i.sstatic.net/M...
10,717
357,618
2013-03-17 00:11:16
15,455,789
11
2013-03-16 23:06:39
6,309
2013-03-17 00:11:16
https://stackoverflow.com/q/15455686
https://stackoverflow.com/a/15455789
<p>Try a <code>git reset HEAD yourFile</code>, instead of a <code>git rm --cached</code>.</p> <p>A mixed reset will remove your file from the index, without removing it from the working tree.<br> See "<a href="https://stackoverflow.com/a/348234/6309">Undo '<code>git add</code>' before commit</a>".</p> <p>In your case...
<p>Try a <code>git reset HEAD yourFile</code>, instead of a <code>git rm --cached</code>.</p> <p>A mixed reset will remove your file from the index, without removing it from the working tree.<br> See "<a href="https://stackoverflow.com/a/348234/6309">Undo '<code>git add</code>' before commit</a>".</p> <p>In your case...
119, 21628
git, msysgit
<h1>git rm --cached and 'deleted' status</h1> <p>I am wondering why when I do:</p> <pre><code>git add &lt;file&gt; </code></pre> <p>and after that, I do:</p> <pre><code>git rm --cached &lt;file&gt; </code></pre> <p>The file remains in <strong>deleted</strong> status in the <strong>stage área</strong>.</p> <p>Here ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,505
git
# git rm --cached and 'deleted' status I am wondering why when I do: ``` git add <file> ``` and after that, I do: ``` git rm --cached <file> ``` The file remains in **deleted** status in the **stage área**. Here the example: ![enter image description here](https://i.sstatic.net/MBvJO.png) I am *only* looking for...
Try a `git reset HEAD yourFile`, instead of a `git rm --cached`. A mixed reset will remove your file from the index, without removing it from the working tree. See "[Undo '`git add`' before commit](https://stackoverflow.com/a/348234/6309)". In your case, a [`git stash`](http://git-scm.com/docs/git-stash) would need...
14630161
how to import Git project to TFS Cloud
10
2013-01-31 16:12:31
<p>I visited our Team Foundation Service page and found a great new feature:</p> <p><em><strong>New Team Project + Git</em></strong></p> <p>This is great news. We have Projects in Team Foundation Service AND Git. Not as much because I love Git. I was very impressed with it's functionality, but never comfortable with ...
3,261
1,212,341
2013-05-28 16:40:15
14,630,946
11
2013-01-31 16:50:03
729,881
2013-05-28 16:40:15
https://stackoverflow.com/q/14630161
https://stackoverflow.com/a/14630946
<p><strong>tl;dr</strong>: Set your remote and push.</p> <ol> <li><p>Make sure you enable alternate credentials in Team Foundation Service. </p></li> <li><p>Set your remote: <code>git remote add &lt;name&gt; &lt;url&gt;</code>, <br>e.g. <code>git remote add origin https://yourname.visualstudio.com/DefaultCollection/...
<p><strong>tl;dr</strong>: Set your remote and push.</p> <ol> <li><p>Make sure you enable alternate credentials in Team Foundation Service. </p></li> <li><p>Set your remote: <code>git remote add &lt;name&gt; &lt;url&gt;</code>, <br>e.g. <code>git remote add origin https://yourname.visualstudio.com/DefaultCollection/...
119, 733, 80825, 116537
azure-devops, git, tfs, visual-studio-2012
<h1>how to import Git project to TFS Cloud</h1> <p>I visited our Team Foundation Service page and found a great new feature:</p> <p><em><strong>New Team Project + Git</em></strong></p> <p>This is great news. We have Projects in Team Foundation Service AND Git. Not as much because I love Git. I was very impressed with...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,506
git
# how to import Git project to TFS Cloud I visited our Team Foundation Service page and found a great new feature: ***New Team Project + Git*** This is great news. We have Projects in Team Foundation Service AND Git. Not as much because I love Git. I was very impressed with it's functionality, but never comfortable ...
**tl;dr**: Set your remote and push. 1. Make sure you enable alternate credentials in Team Foundation Service. 2. Set your remote: `git remote add <name> <url>`, e.g. `git remote add origin https://yourname.visualstudio.com/DefaultCollection/_git/ProjectName` 3. Push it: `git push <remote name> <name of branc...
12132862
How do I get the name of the current branch in libgit2?
10
2012-08-26 18:41:58
<p>I am trying to use libgit2 to read the name of the current branch. Do I have to do some sort of resolve?</p> <p>I tried using </p> <pre><code>git_branch_lookup </code></pre> <p>to look up the <code>git_reference</code> for <code>HEAD</code>, but it results in </p> <pre><code>Unable to find local branch 'HEAD' </...
4,547
10,675
2023-04-30 11:18:28
12,133,309
11
2012-08-26 19:43:02
335,418
2023-04-30 11:18:28
https://stackoverflow.com/q/12132862
https://stackoverflow.com/a/12133309
<p>Running <code>git branch -a</code> doesn't list <code>HEAD</code>. In libgit2, <code>HEAD</code> isn't considered a valid branch either. It's only a <strong>reference</strong>.</p> <p>If you want to discover which reference is the current branch, then you should</p> <ul> <li>Load the current <code>HEAD</code> refere...
<p>Running <code>git branch -a</code> doesn't list <code>HEAD</code>. In libgit2, <code>HEAD</code> isn't considered a valid branch either. It's only a <strong>reference</strong>.</p> <p>If you want to discover which reference is the current branch, then you should</p> <ul> <li>Load the current <code>HEAD</code> refere...
66800
libgit2
<h1>How do I get the name of the current branch in libgit2?</h1> <p>I am trying to use libgit2 to read the name of the current branch. Do I have to do some sort of resolve?</p> <p>I tried using </p> <pre><code>git_branch_lookup </code></pre> <p>to look up the <code>git_reference</code> for <code>HEAD</code>, but it ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,507
git
# How do I get the name of the current branch in libgit2? I am trying to use libgit2 to read the name of the current branch. Do I have to do some sort of resolve? I tried using ``` git_branch_lookup ``` to look up the `git_reference` for `HEAD`, but it results in ``` Unable to find local branch 'HEAD' ``` Thanks!
Running `git branch -a` doesn't list `HEAD`. In libgit2, `HEAD` isn't considered a valid branch either. It's only a **reference**. If you want to discover which reference is the current branch, then you should - Load the current `HEAD` reference (try the `git_repository_head()` convenience method) - Determine its typ...
8898120
Conversion of lat/lng coordinates to pixels on a given map (with JavaScript)
10
2012-01-17 16:25:12
<p>I have put together a cities database from MaxMind and it includes the lat/lng values for each city in the database. I have also put together a map of North/America and I would like to have a icon appear on the x/y coordinates of the map which are derived from the lat/lng coordinates of the city database record.</p>...
35,834
340,939
2019-08-20 16:32:05
11,774,576
11
2012-08-02 09:25:14
1,570,918
2017-08-31 12:03:33
https://stackoverflow.com/q/8898120
https://stackoverflow.com/a/11774576
<p>Latitude and Longitude are imaginary lines drawn on earth so that you can accurately pinpoint any location on the world . simply put they are the X and Y coords of a plane. Latitude is a vertical line running from north to south with its 90 deg at the north pole and -90deg at the south pole.</p> <p>Longitude on the...
<p>Latitude and Longitude are imaginary lines drawn on earth so that you can accurately pinpoint any location on the world . simply put they are the X and Y coords of a plane. Latitude is a vertical line running from north to south with its 90 deg at the north pole and -90deg at the south pole.</p> <p>Longitude on the...
3, 640, 20301
javascript, latitude-longitude, maps
<h1>Conversion of lat/lng coordinates to pixels on a given map (with JavaScript)</h1> <p>I have put together a cities database from MaxMind and it includes the lat/lng values for each city in the database. I have also put together a map of North/America and I would like to have a icon appear on the x/y coordinates of t...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,508
git
# Conversion of lat/lng coordinates to pixels on a given map (with JavaScript) I have put together a cities database from MaxMind and it includes the lat/lng values for each city in the database. I have also put together a map of North/America and I would like to have a icon appear on the x/y coordinates of the map wh...
Latitude and Longitude are imaginary lines drawn on earth so that you can accurately pinpoint any location on the world . simply put they are the X and Y coords of a plane. Latitude is a vertical line running from north to south with its 90 deg at the north pole and -90deg at the south pole. Longitude on the other han...
11491579
How do I clean up completely after SVN -> Git migration?
10
2012-07-15 11:43:13
<p>I've migrated a repo from SVN to Git using <code>svn2git</code> and am happy with everything apart from one thing. How can I remove the <code>remotes/svn/trunk</code> branch that shows in <code>git branch -a</code>:</p> <pre><code>$ git branch -a * master remotes/origin/master remotes/svn/trunk </code></pre> <...
5,850
1,068,248
2012-07-15 11:50:54
11,491,636
11
2012-07-15 11:50:54
6,309
2012-07-15 11:50:54
https://stackoverflow.com/q/11491579
https://stackoverflow.com/a/11491636
<p>Deleting the remote tracking branch would be a good start:</p> <pre><code>git branch -d -r svn/trunk </code></pre> <p>Other advices are available at "<a href="https://stackoverflow.com/questions/3046436/how-do-you-stop-tracking-a-remote-branch-in-git">How do you stop tracking a remote branch in git?</a>".<br> But ...
<p>Deleting the remote tracking branch would be a good start:</p> <pre><code>git branch -d -r svn/trunk </code></pre> <p>Other advices are available at "<a href="https://stackoverflow.com/questions/3046436/how-do-you-stop-tracking-a-remote-branch-in-git">How do you stop tracking a remote branch in git?</a>".<br> But ...
119, 6452
git, git-svn
<h1>How do I clean up completely after SVN -> Git migration?</h1> <p>I've migrated a repo from SVN to Git using <code>svn2git</code> and am happy with everything apart from one thing. How can I remove the <code>remotes/svn/trunk</code> branch that shows in <code>git branch -a</code>:</p> <pre><code>$ git branch -a * m...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,509
git
# How do I clean up completely after SVN -> Git migration? I've migrated a repo from SVN to Git using `svn2git` and am happy with everything apart from one thing. How can I remove the `remotes/svn/trunk` branch that shows in `git branch -a`: ``` $ git branch -a * master remotes/origin/master remotes/svn/trunk ```...
Deleting the remote tracking branch would be a good start: ``` git branch -d -r svn/trunk ``` Other advices are available at "[How do you stop tracking a remote branch in git?](https://stackoverflow.com/questions/3046436/how-do-you-stop-tracking-a-remote-branch-in-git)". But to really clean, you may have to do othe...
10976938
git change origin of a branch (rebase)
10
2012-06-11 08:52:32
<p>f'I have the following:</p> <pre><code>A---B---C-----D-- branch dev \--C'-E-/ branch test </code></pre> <p>I did it bad: C and C' are almost the same commits, it would make more sense if I could make branch <em>test</em> start on C, instead of B.</p> <p>How could I do that?, I guess rebase, but I'm no...
15,816
null
2012-06-18 20:08:25
10,976,962
11
2012-06-11 08:54:34
6,309
2012-06-11 09:51:39
https://stackoverflow.com/q/10976938
https://stackoverflow.com/a/10976962
<p>You could rebase it on top of a temporary branch (made from <code>C</code>)<br> See <a href="http://git-scm.com/docs/git-rebase" rel="noreferrer"><code>git rebase</code></a> and <a href="http://git-scm.com/book/en/Git-Branching-Rebasing" rel="noreferrer">Rebasing</a>, plus <a href="http://git-scm.com/docs/git-branch...
<p>You could rebase it on top of a temporary branch (made from <code>C</code>)<br> See <a href="http://git-scm.com/docs/git-rebase" rel="noreferrer"><code>git rebase</code></a> and <a href="http://git-scm.com/book/en/Git-Branching-Rebasing" rel="noreferrer">Rebasing</a>, plus <a href="http://git-scm.com/docs/git-branch...
119, 1879, 8974
branch, git, rebase
<h1>git change origin of a branch (rebase)</h1> <p>f'I have the following:</p> <pre><code>A---B---C-----D-- branch dev \--C'-E-/ branch test </code></pre> <p>I did it bad: C and C' are almost the same commits, it would make more sense if I could make branch <em>test</em> start on C, instead of B.</p> <p>...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,510
git
# git change origin of a branch (rebase) f'I have the following: ``` A---B---C-----D-- branch dev \--C'-E-/ branch test ``` I did it bad: C and C' are almost the same commits, it would make more sense if I could make branch *test* start on C, instead of B. How could I do that?, I guess rebase, but I'm n...
You could rebase it on top of a temporary branch (made from `C`) See [`git rebase`](http://git-scm.com/docs/git-rebase) and [Rebasing](http://git-scm.com/book/en/Git-Branching-Rebasing), plus [`git branch`](http://git-scm.com/docs/git-branch). ``` git branch tmp C git checkout test # rebase the current branch (test...
10326797
How does the git staging area store files?
10
2012-04-26 03:24:03
<p>I would like to understand what Git actually is storing when moving files into the "staging" state.</p> <p><strong>Consider the following sequence:</strong></p> <p>A new file is added and committed to the local repository:</p> <pre><code>touch file.txt git add file.txt git commit </code></pre> <p>I make changes ...
2,464
1,357,638
2012-04-26 07:16:25
10,327,469
11
2012-04-26 04:58:45
506,338
2012-04-26 04:58:45
https://stackoverflow.com/q/10326797
https://stackoverflow.com/a/10327469
<p>Think of Git as two things - commits (snapshots of files) and labels (branches, among other things).</p> <p>Git actually creates a commit when you <code>git add</code>, not when you <code>git commit</code>. So when you executed <code>git add</code> on the changed file, it created a commit with those changes, and as...
<p>Think of Git as two things - commits (snapshots of files) and labels (branches, among other things).</p> <p>Git actually creates a commit when you <code>git add</code>, not when you <code>git commit</code>. So when you executed <code>git add</code> on the changed file, it created a commit with those changes, and as...
119
git
<h1>How does the git staging area store files?</h1> <p>I would like to understand what Git actually is storing when moving files into the "staging" state.</p> <p><strong>Consider the following sequence:</strong></p> <p>A new file is added and committed to the local repository:</p> <pre><code>touch file.txt git add f...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,511
git
# How does the git staging area store files? I would like to understand what Git actually is storing when moving files into the "staging" state. **Consider the following sequence:** A new file is added and committed to the local repository: ``` touch file.txt git add file.txt git commit ``` I make changes to the f...
Think of Git as two things - commits (snapshots of files) and labels (branches, among other things). Git actually creates a commit when you `git add`, not when you `git commit`. So when you executed `git add` on the changed file, it created a commit with those changes, and assigned the "staging" label to that particul...
8965743
How do I get a unique list of files modified in a repository within a range of commits in Git?
10
2012-01-22 23:36:35
<p>I would like to obtain a list of files from a git repository that have been modified or created within a range of commits. Is this possible? I've taken a look at <code>log</code> but it doesn't seem to achieve this.</p>
1,151
406,329
2012-01-23 02:26:33
8,965,783
11
2012-01-22 23:42:48
1,024,637
2012-01-22 23:42:48
https://stackoverflow.com/q/8965743
https://stackoverflow.com/a/8965783
<p><code>git diff --name-only ${range}</code> will give you exactly what you want: only the names of files modified in this time.</p> <p>Actually, it gives you almost what you asked for: this would include files that were completely deleted, not just modified files. It would also miss files that were created, then re...
<p><code>git diff --name-only ${range}</code> will give you exactly what you want: only the names of files modified in this time.</p> <p>Actually, it gives you almost what you asked for: this would include files that were completely deleted, not just modified files. It would also miss files that were created, then re...
119
git
<h1>How do I get a unique list of files modified in a repository within a range of commits in Git?</h1> <p>I would like to obtain a list of files from a git repository that have been modified or created within a range of commits. Is this possible? I've taken a look at <code>log</code> but it doesn't seem to achieve thi...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,512
git
# How do I get a unique list of files modified in a repository within a range of commits in Git? I would like to obtain a list of files from a git repository that have been modified or created within a range of commits. Is this possible? I've taken a look at `log` but it doesn't seem to achieve this.
`git diff --name-only ${range}` will give you exactly what you want: only the names of files modified in this time. Actually, it gives you almost what you asked for: this would include files that were completely deleted, not just modified files. It would also miss files that were created, then removed, within the rang...
6637105
Re-enable mirroring with git-svn
10
2011-07-09 19:49:35
<p>For some time now I've been mirroring a Subversion repository to a Git repository. Which has always worked fine. However, due to a crash of a virtual server and not having a backup I've got to setup the mirror again. The repository I need to track is almost 1200 commits big and contains a lot of files (which is the ...
1,113
83,982
2015-05-27 21:37:32
6,658,191
11
2011-07-12 00:13:35
54,249
2011-07-12 00:43:34
https://stackoverflow.com/q/6637105
https://stackoverflow.com/a/6658191
<p>The easiest way to get it to work again is to copy over the <code>.git/svn</code> directory from the original, as this is where extra svn metadata are tracked (assuming the git-svn config is the same).</p> <p>However, since you don't have it try this:</p> <ol> <li><p><code>git svn init <a href="http://hostname/svn...
<p>The easiest way to get it to work again is to copy over the <code>.git/svn</code> directory from the original, as this is where extra svn metadata are tracked (assuming the git-svn config is the same).</p> <p>However, since you don't have it try this:</p> <ol> <li><p><code>git svn init <a href="http://hostname/svn...
63, 119, 456, 6452
git, git-svn, svn, version-control
<h1>Re-enable mirroring with git-svn</h1> <p>For some time now I've been mirroring a Subversion repository to a Git repository. Which has always worked fine. However, due to a crash of a virtual server and not having a backup I've got to setup the mirror again. The repository I need to track is almost 1200 commits big ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,513
git
# Re-enable mirroring with git-svn For some time now I've been mirroring a Subversion repository to a Git repository. Which has always worked fine. However, due to a crash of a virtual server and not having a backup I've got to setup the mirror again. The repository I need to track is almost 1200 commits big and conta...
The easiest way to get it to work again is to copy over the `.git/svn` directory from the original, as this is where extra svn metadata are tracked (assuming the git-svn config is the same). However, since you don't have it try this: 1. `git svn init http://hostname/svn/repository` with any other parameters you used ...
6392862
Git Stash & Worktree Woes
10
2011-06-17 23:40:35
<p>I'm having difficulty getting Git to cooperate with my user-defined worktree that exists <strong>outside</strong> the folder that contains my .git directory.</p> <p>Basically the setup is like this: I have two directories, one called &quot;git-worktree&quot; which houses the file I want to track &amp; another called...
5,286
228,315
2022-10-20 16:29:47
6,392,941
11
2011-06-17 23:59:55
1,864,976
2011-06-18 00:46:50
https://stackoverflow.com/q/6392862
https://stackoverflow.com/a/6392941
<pre><code>git --git-dir=&lt;your path&gt; --work-tree=&lt;work tree path&gt; stash </code></pre> <p>should work. Have you tried absolute paths?</p> <p>UPDATE:</p> <p>seems to be a bug. The extended functionality of --git-dir option was only added recently and some commands like git stash don't have the new implemen...
<pre><code>git --git-dir=&lt;your path&gt; --work-tree=&lt;work tree path&gt; stash </code></pre> <p>should work. Have you tried absolute paths?</p> <p>UPDATE:</p> <p>seems to be a bug. The extended functionality of --git-dir option was only added recently and some commands like git stash don't have the new implemen...
119, 13091
git, git-stash
<h1>Git Stash & Worktree Woes</h1> <p>I'm having difficulty getting Git to cooperate with my user-defined worktree that exists <strong>outside</strong> the folder that contains my .git directory.</p> <p>Basically the setup is like this: I have two directories, one called &quot;git-worktree&quot; which houses the file I...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,514
git
# Git Stash & Worktree Woes I'm having difficulty getting Git to cooperate with my user-defined worktree that exists **outside** the folder that contains my .git directory. Basically the setup is like this: I have two directories, one called "git-worktree" which houses the file I want to track & another called "git-d...
``` git --git-dir=<your path> --work-tree=<work tree path> stash ``` should work. Have you tried absolute paths? UPDATE: seems to be a bug. The extended functionality of --git-dir option was only added recently and some commands like git stash don't have the new implementation yet. git-stash is a bash script. You c...
6034632
fatal: bad config value for 'core.sharedrepository' in ./config
10
2011-05-17 17:20:04
<p>I just entered the command:<code>git config core.sharedrepository 1</code> and I am now receiving the error:</p> <blockquote> <p>fatal: bad config value for 'core.sharedrepository' in ./config</p> </blockquote> <p>Has anyone any idea how to fix it?</p>
13,497
556,479
2021-07-30 08:23:12
6,034,671
11
2011-05-17 17:24:22
211,563
2011-05-17 17:24:22
https://stackoverflow.com/q/6034632
https://stackoverflow.com/a/6034671
<p>The problem is exactly what it's saying: <code>1</code> is an invalid value for that setting. You probably want <code>true</code>.</p> <p>From the <a href="http://git-scm.com/docs/git-config">git-config man</a> page:</p> <blockquote> <p>When <code>group</code> (or <code>true</code>), the repository is made share...
<p>The problem is exactly what it's saying: <code>1</code> is an invalid value for that setting. You probably want <code>true</code>.</p> <p>From the <a href="http://git-scm.com/docs/git-config">git-config man</a> page:</p> <blockquote> <p>When <code>group</code> (or <code>true</code>), the repository is made share...
119
git
<h1>fatal: bad config value for 'core.sharedrepository' in ./config</h1> <p>I just entered the command:<code>git config core.sharedrepository 1</code> and I am now receiving the error:</p> <blockquote> <p>fatal: bad config value for 'core.sharedrepository' in ./config</p> </blockquote> <p>Has anyone any idea how to...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,515
git
# fatal: bad config value for 'core.sharedrepository' in ./config I just entered the command:`git config core.sharedrepository 1` and I am now receiving the error: > fatal: bad config value for 'core.sharedrepository' in ./config Has anyone any idea how to fix it?
The problem is exactly what it's saying: `1` is an invalid value for that setting. You probably want `true`. From the [git-config man](http://git-scm.com/docs/git-config) page: > When `group` (or `true`), the repository is made shareable between several users in a group (making sure all the files and objects are grou...
2736862
Clone works, remote push doesn't. Remote repository over copssh
10
2010-04-29 11:29:53
<p>I've "setup-a-msysgit-server-with-copssh-on-windows", following Tim Davis' <a href="http://www.timdavis.com.au/git/setting-up-a-msysgit-server-with-copssh-on-windows/" rel="nofollow noreferrer">guide</a> and I was now learning how to use the git commands, following Jason Meridth's <a href="http://www.lostechies.com/...
9,038
290,692
2018-08-05 04:06:25
2,745,562
11
2010-04-30 15:16:29
290,692
2010-04-30 15:16:29
https://stackoverflow.com/q/2736862
https://stackoverflow.com/a/2745562
<p>stupid fix (this changed /SSH/home/rvc/.gitconfig):</p> <pre><code>rvc@RVC-DESKTOP /c/code/myapp (master) $ git config --global remote.origin.receivepack "git receive-pack" rvc@RVC-DESKTOP /c/code/myapp (master) $ git push Counting objects: 3, done. Delta compression using up to 4 threads. Compressing objects: 100...
<p>stupid fix (this changed /SSH/home/rvc/.gitconfig):</p> <pre><code>rvc@RVC-DESKTOP /c/code/myapp (master) $ git config --global remote.origin.receivepack "git receive-pack" rvc@RVC-DESKTOP /c/code/myapp (master) $ git push Counting objects: 3, done. Delta compression using up to 4 threads. Compressing objects: 100...
119, 386, 21628, 41624, 54593
copssh, git, msysgit, ssh, windows-7-x64
<h1>Clone works, remote push doesn't. Remote repository over copssh</h1> <p>I've "setup-a-msysgit-server-with-copssh-on-windows", following Tim Davis' <a href="http://www.timdavis.com.au/git/setting-up-a-msysgit-server-with-copssh-on-windows/" rel="nofollow noreferrer">guide</a> and I was now learning how to use the gi...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,516
git
# Clone works, remote push doesn't. Remote repository over copssh I've "setup-a-msysgit-server-with-copssh-on-windows", following Tim Davis' [guide](http://www.timdavis.com.au/git/setting-up-a-msysgit-server-with-copssh-on-windows/) and I was now learning how to use the git commands, following Jason Meridth's [guide](...
stupid fix (this changed /SSH/home/rvc/.gitconfig): ``` rvc@RVC-DESKTOP /c/code/myapp (master) $ git config --global remote.origin.receivepack "git receive-pack" rvc@RVC-DESKTOP /c/code/myapp (master) $ git push Counting objects: 3, done. Delta compression using up to 4 threads. Compressing objects: 100% (2/2), done....
1734327
"Not a git repository"
10
2009-11-14 14:08:47
<p>I am trying to use a program that uses git as the backing store (I am new to git). On initialization, this program does a:</p> <pre><code>"git" "--bare" "rev-parse" "refs/heads/index" </code></pre> <p>Which results in:</p> <p><code>fatal: Not a git repository: '/home/david/blog.git'</code></p> <p>I followed <a ...
30,585
147,714
2024-11-10 23:04:33
1,734,421
11
2009-11-14 14:45:42
19,563
2009-11-14 14:45:42
https://stackoverflow.com/q/1734327
https://stackoverflow.com/a/1734421
<p>If <code>git status</code> is working then you must be in a non-bare repository with a working tree. <code>git status</code> requires a working tree.</p> <p>If the program is running <code>git --bare ...</code> then it expects the given directory to be a bare git repository, i.e. with not working directory.</p> <p...
<p>If <code>git status</code> is working then you must be in a non-bare repository with a working tree. <code>git status</code> requires a working tree.</p> <p>If the program is running <code>git --bare ...</code> then it expects the given directory to be a bare git repository, i.e. with not working directory.</p> <p...
119
git
<h1>"Not a git repository"</h1> <p>I am trying to use a program that uses git as the backing store (I am new to git). On initialization, this program does a:</p> <pre><code>"git" "--bare" "rev-parse" "refs/heads/index" </code></pre> <p>Which results in:</p> <p><code>fatal: Not a git repository: '/home/david/blog.gi...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,517
git
# "Not a git repository" I am trying to use a program that uses git as the backing store (I am new to git). On initialization, this program does a: ``` "git" "--bare" "rev-parse" "refs/heads/index" ``` Which results in: `fatal: Not a git repository: '/home/david/blog.git'` I followed [this tutorial](http://www.ker...
If `git status` is working then you must be in a non-bare repository with a working tree. `git status` requires a working tree. If the program is running `git --bare ...` then it expects the given directory to be a bare git repository, i.e. with not working directory. The naming convention of `reponame.git` is usuall...
1060963
How to get aliases working in .gitconfig?
10
2009-06-29 22:49:22
<p><a href="http://github.com/guides/git-cheat-sheet" rel="noreferrer">Github</a> has the following recommendation for global git configuration <code>~/.gitconfig</code>:</p> <pre><code>[alias] # Is this [-] only a comment in .gitconfig? gb = git branch gba = git branch -a gc = git commit -v gd = git diff ...
12,154
54,964
2022-06-15 16:13:35
1,061,650
11
2009-06-30 03:56:52
6,309
2009-06-30 03:56:52
https://stackoverflow.com/q/1060963
https://stackoverflow.com/a/1061650
<p>I believe what GitHub is referring to is <em>system aliases</em>, not '.gitconfig' aliases.</p> <p>In other terms, you would need to type, like <a href="http://robsanheim.com/2008/04/04/zero-to-a-fully-git-enabled-rails-app-in-the-time-it-takes-to-drink/#aliases" rel="noreferrer">illustrated here</a>, the following...
<p>I believe what GitHub is referring to is <em>system aliases</em>, not '.gitconfig' aliases.</p> <p>In other terms, you would need to type, like <a href="http://robsanheim.com/2008/04/04/zero-to-a-fully-git-enabled-rails-app-in-the-time-it-takes-to-drink/#aliases" rel="noreferrer">illustrated here</a>, the following...
119, 1448
alias, git
<h1>How to get aliases working in .gitconfig?</h1> <p><a href="http://github.com/guides/git-cheat-sheet" rel="noreferrer">Github</a> has the following recommendation for global git configuration <code>~/.gitconfig</code>:</p> <pre><code>[alias] # Is this [-] only a comment in .gitconfig? gb = git branch gb...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,518
git
# How to get aliases working in .gitconfig? [Github](http://github.com/guides/git-cheat-sheet) has the following recommendation for global git configuration `~/.gitconfig`: ``` [alias] # Is this [-] only a comment in .gitconfig? gb = git branch gba = git branch -a gc = git commit -v gd = git diff | mate ...
I believe what GitHub is referring to is *system aliases*, not '.gitconfig' aliases. In other terms, you would need to type, like [illustrated here](http://robsanheim.com/2008/04/04/zero-to-a-fully-git-enabled-rails-app-in-the-time-it-takes-to-drink/#aliases), the following *Unix* command to make those 'aliases' work:...
1010713
Move a branch to a new tag
10
2009-06-18 03:58:17
<p>My personal Wordpress install is cloned from the <a href="http://github.com/veilleperso/wordpress/" rel="nofollow noreferrer">wordpress git mirror</a> on GitHub. I checked out the 2.7.1 tag to the branch "stable" (<code>git checkout -b stable 2.7.1</code>) and its been running fine since. Now WordPress 2.8 has been ...
8,627
38,820
2012-05-05 06:31:01
1,010,730
11
2009-06-18 04:08:54
124,007
2009-06-18 04:08:54
https://stackoverflow.com/q/1010713
https://stackoverflow.com/a/1010730
<p>Use "git checkout 2.8". </p> <p>If you want to move "stable", you can simply remove/recreate it:</p> <pre><code>$ git checkout 2.8 $ git branch -d stable $ git checkout -b stable </code></pre>
<p>Use "git checkout 2.8". </p> <p>If you want to move "stable", you can simply remove/recreate it:</p> <pre><code>$ git checkout 2.8 $ git branch -d stable $ git checkout -b stable </code></pre>
115, 119, 1879, 8974
branch, git, rebase, tags
<h1>Move a branch to a new tag</h1> <p>My personal Wordpress install is cloned from the <a href="http://github.com/veilleperso/wordpress/" rel="nofollow noreferrer">wordpress git mirror</a> on GitHub. I checked out the 2.7.1 tag to the branch "stable" (<code>git checkout -b stable 2.7.1</code>) and its been running fin...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,519
git
# Move a branch to a new tag My personal Wordpress install is cloned from the [wordpress git mirror](http://github.com/veilleperso/wordpress/) on GitHub. I checked out the 2.7.1 tag to the branch "stable" (`git checkout -b stable 2.7.1`) and its been running fine since. Now WordPress 2.8 has been released I want to mo...
Use "git checkout 2.8". If you want to move "stable", you can simply remove/recreate it: ``` $ git checkout 2.8 $ git branch -d stable $ git checkout -b stable ```
62867041
How can I discover the git commit hash that I stashed from?
9
2020-07-12 22:24:44
<p>I realize that my question is very similar to <a href="https://stackoverflow.com/q/28590735/470749">How to list the parent commit of a stash in `git stash list`</a> and <a href="https://stackoverflow.com/questions/16071720/get-git-stash-parent-commit">Get git stash parent commit</a>, but those had so many confusing,...
5,889
470,749
2024-09-23 07:57:17
62,867,395
11
2020-07-12 23:22:52
86,072
2024-09-23 07:57:17
https://stackoverflow.com/q/62867041
https://stackoverflow.com/a/62867395
<p>The commit you are looking for is <code>stash@{0}^</code> :</p> <pre><code>git show stash@{0}^ git log -1 --oneline stash@{0}^ git rev-parse stash@{0}^ </code></pre> <hr /> <p>[update] or the shorter:</p> <pre><code>git show stash^ git log -1 --oneline stash^ git rev-parse stash^ </code></pre> <p>(note that your can...
<p>The commit you are looking for is <code>stash@{0}^</code> :</p> <pre><code>git show stash@{0}^ git log -1 --oneline stash@{0}^ git rev-parse stash@{0}^ </code></pre> <hr /> <p>[update] or the shorter:</p> <pre><code>git show stash^ git log -1 --oneline stash^ git rev-parse stash^ </code></pre> <p>(note that your can...
119
git
<h1>How can I discover the git commit hash that I stashed from?</h1> <p>I realize that my question is very similar to <a href="https://stackoverflow.com/q/28590735/470749">How to list the parent commit of a stash in `git stash list`</a> and <a href="https://stackoverflow.com/questions/16071720/get-git-stash-parent-comm...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,525
git
# How can I discover the git commit hash that I stashed from? I realize that my question is very similar to [How to list the parent commit of a stash in `git stash list`](https://stackoverflow.com/q/28590735/470749) and [Get git stash parent commit](https://stackoverflow.com/questions/16071720/get-git-stash-parent-com...
The commit you are looking for is `stash@{0}^` : ``` git show stash@{0}^ git log -1 --oneline stash@{0}^ git rev-parse stash@{0}^ ``` --- [update] or the shorter: ``` git show stash^ git log -1 --oneline stash^ git rev-parse stash^ ``` (note that your can use the `stash@{xx}` syntax for any entry of `git stash lis...
60906410
How do I read git synopsis documentation?
9
2020-03-28 20:11:19
<p>As an iOS engineer I struggle to understand the git documentation. I looked into the <a href="https://git-scm.com/docs/gitglossary" rel="noreferrer">glossary</a> and searched online but couldn’t find an answer to my question.</p> <p>Example for <a href="https://git-scm.com/docs/git-checkout" rel="noreferrer"><code>g...
1,533
5,175,709
2022-02-02 16:51:41
60,906,506
11
2020-03-28 20:18:44
5,175,709
2022-02-02 16:49:33
https://stackoverflow.com/q/60906410
https://stackoverflow.com/a/60906506
<p>Special thanks <a href="https://stackoverflow.com/users/14122/charles-duffy">Charles Duffy</a> who addressed my comments and helped me put this together.</p> <blockquote> <p>I counted 7 lines. Is every line a combination of options that can work with any number of the options in that line?</p> </blockquote> <p>That'...
<p>Special thanks <a href="https://stackoverflow.com/users/14122/charles-duffy">Charles Duffy</a> who addressed my comments and helped me put this together.</p> <blockquote> <p>I counted 7 lines. Is every line a combination of options that can work with any number of the options in that line?</p> </blockquote> <p>That'...
119, 271
documentation, git
<h1>How do I read git synopsis documentation?</h1> <p>As an iOS engineer I struggle to understand the git documentation. I looked into the <a href="https://git-scm.com/docs/gitglossary" rel="noreferrer">glossary</a> and searched online but couldn’t find an answer to my question.</p> <p>Example for <a href="https://git-...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,526
git
# How do I read git synopsis documentation? As an iOS engineer I struggle to understand the git documentation. I looked into the [glossary](https://git-scm.com/docs/gitglossary) and searched online but couldn’t find an answer to my question. Example for [`git checkout`](https://git-scm.com/docs/git-checkout): The doc...
Special thanks [Charles Duffy](https://stackoverflow.com/users/14122/charles-duffy) who addressed my comments and helped me put this together. > I counted 7 lines. Is every line a combination of options that can > work with any number of the options in that line? That's correct. Yet `git checkout -q -b new_branch_nam...
52661839
gpg: keyblock resource pubring.kbx not found because the repo path is prefixed to the gnupg home
9
2018-10-05 08:53:59
<p>I used to have my commits signed by gpg which worked all fine, but I suddenly got this message instead:</p> <pre><code>gpg: keyblock resource '/c/Users/username/path/to/project/C:\Users\username\.gnupg/pubring.kbx': No such file or directory gpg: skipped "my_key": No secret key gpg: signing failed: No secret key er...
20,378
4,126,843
2024-02-04 22:04:38
52,836,141
11
2018-10-16 13:05:17
9,292,433
2018-10-16 13:05:17
https://stackoverflow.com/q/52661839
https://stackoverflow.com/a/52836141
<p>I had the same issue. To fix it I just had to specify the gpg.program variable in my .gitconfig file to point to my installation of Gpg4win like so:</p> <pre><code>git config --global gpg.program "%PROGRAMFILES(x86)%\GnuPG\bin\gpg.exe" </code></pre> <p>or</p> <pre><code>git config --global gpg.program "C:\Program...
<p>I had the same issue. To fix it I just had to specify the gpg.program variable in my .gitconfig file to point to my installation of Gpg4win like so:</p> <pre><code>git config --global gpg.program "%PROGRAMFILES(x86)%\GnuPG\bin\gpg.exe" </code></pre> <p>or</p> <pre><code>git config --global gpg.program "C:\Program...
119, 6735
git, gnupg
<h1>gpg: keyblock resource pubring.kbx not found because the repo path is prefixed to the gnupg home</h1> <p>I used to have my commits signed by gpg which worked all fine, but I suddenly got this message instead:</p> <pre><code>gpg: keyblock resource '/c/Users/username/path/to/project/C:\Users\username\.gnupg/pubring....
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,530
git
# gpg: keyblock resource pubring.kbx not found because the repo path is prefixed to the gnupg home I used to have my commits signed by gpg which worked all fine, but I suddenly got this message instead: ``` gpg: keyblock resource '/c/Users/username/path/to/project/C:\Users\username\.gnupg/pubring.kbx': No such file o...
I had the same issue. To fix it I just had to specify the gpg.program variable in my .gitconfig file to point to my installation of Gpg4win like so: ``` git config --global gpg.program "%PROGRAMFILES(x86)%\GnuPG\bin\gpg.exe" ``` or ``` git config --global gpg.program "C:\Program Files (x86)\GnuPG\bin\gpg.exe" ``` O...
52160052
Git Auto Commit Daily
9
2018-09-04 06:30:01
<p>Could I do take commit my changes in a directory by a daily routine? Say, In every 12 AM at early morning, It should commit all the changes in that directory automatically? Is it possible in git? I get some answers for auto commit for every changes. But I want it for daily once commit.</p>
8,506
1,437,138
2018-09-04 07:44:52
52,160,113
11
2018-09-04 06:33:46
7,323,888
2018-09-04 07:44:52
https://stackoverflow.com/q/52160052
https://stackoverflow.com/a/52160113
<p>If you simply want to commit ALL changes every morning at 12 AM, you can do this using a cronjob.</p> <p>Assuming that you are using a linux distribution with bash, you can write a bash script that does the commit</p> <pre><code>#!/bin/bash cd &lt;git directory&gt; &amp;&amp; git add -A &amp;&amp; git commit * --a...
<p>If you simply want to commit ALL changes every morning at 12 AM, you can do this using a cronjob.</p> <p>Assuming that you are using a linux distribution with bash, you can write a bash script that does the commit</p> <pre><code>#!/bin/bash cd &lt;git directory&gt; &amp;&amp; git add -A &amp;&amp; git commit * --a...
58, 119, 53850
git, git-commit, linux
<h1>Git Auto Commit Daily</h1> <p>Could I do take commit my changes in a directory by a daily routine? Say, In every 12 AM at early morning, It should commit all the changes in that directory automatically? Is it possible in git? I get some answers for auto commit for every changes. But I want it for daily once commit....
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,531
git
# Git Auto Commit Daily Could I do take commit my changes in a directory by a daily routine? Say, In every 12 AM at early morning, It should commit all the changes in that directory automatically? Is it possible in git? I get some answers for auto commit for every changes. But I want it for daily once commit.
If you simply want to commit ALL changes every morning at 12 AM, you can do this using a cronjob. Assuming that you are using a linux distribution with bash, you can write a bash script that does the commit ``` #!/bin/bash cd <git directory> && git add -A && git commit * --allow-empty-message -m '' ``` Then you can ...
50719083
Git log for a directory including merges
9
2018-06-06 11:17:05
<p>I'm writing a scripts that takes a path as a parameter and outputs Git commits for that path, similarly to what GitHub does when you click the <em>History</em> button in some folder (here's <a href="https://github.com/versionpress/versionpress/commits/master/docs" rel="noreferrer">an example</a>). In essence, I want...
2,698
21,728
2018-06-06 15:34:47
50,724,301
11
2018-06-06 15:34:47
1,256,452
2018-06-06 15:34:47
https://stackoverflow.com/q/50719083
https://stackoverflow.com/a/50724301
<p>You are indeed being bitten by History Simplification. Note that simplification is enabled by default when using any path names with <code>git log</code>. It is <em>not</em> enabled by default if you do not supply path names. Adding particular options, like <code>--full-history</code> or <code>--simplify-*</code>...
<p>You are indeed being bitten by History Simplification. Note that simplification is enabled by default when using any path names with <code>git log</code>. It is <em>not</em> enabled by default if you do not supply path names. Adding particular options, like <code>--full-history</code> or <code>--simplify-*</code>...
119
git
<h1>Git log for a directory including merges</h1> <p>I'm writing a scripts that takes a path as a parameter and outputs Git commits for that path, similarly to what GitHub does when you click the <em>History</em> button in some folder (here's <a href="https://github.com/versionpress/versionpress/commits/master/docs" re...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,532
git
# Git log for a directory including merges I'm writing a scripts that takes a path as a parameter and outputs Git commits for that path, similarly to what GitHub does when you click the *History* button in some folder (here's [an example](https://github.com/versionpress/versionpress/commits/master/docs)). In essence, ...
You are indeed being bitten by History Simplification. Note that simplification is enabled by default when using any path names with `git log`. It is *not* enabled by default if you do not supply path names. Adding particular options, like `--full-history` or `--simplify-*` (You may also get bitten by the implied `--f...
47079595
costura.fody for a dll that references another dll
9
2017-11-02 15:57:19
<p>I have a small exe I've written that uses <code>LibGit2Sharp</code> and am trying to use <code>Costura.Fody</code> to embed everything so I only have a single exe to distribute (actually, there are two config files as well, but that's ok).</p> <p>The problem seems to be that <code>LibGet2Sharp.dll</code> has a fair...
5,436
4,664,804
2018-04-03 16:36:49
49,635,072
11
2018-04-03 16:36:49
4,664,804
2018-04-03 16:36:49
https://stackoverflow.com/q/47079595
https://stackoverflow.com/a/49635072
<p>Figured this out with some help from <a href="https://stackoverflow.com/questions/33695753/not-able-to-get-costura-fody-to-work-keeps-asking-for-the-dll">this question</a> and had to add some work of my own. </p> <p>Essentially, you need to create a pair of folders in the project, called Costura32 and Costura64 and...
<p>Figured this out with some help from <a href="https://stackoverflow.com/questions/33695753/not-able-to-get-costura-fody-to-work-keeps-asking-for-the-dll">this question</a> and had to add some work of my own. </p> <p>Essentially, you need to create a pair of folders in the project, called Costura32 and Costura64 and...
1, 9, 457, 74777, 88989
.net, c#, dll, fody-costura, libgit2sharp
<h1>costura.fody for a dll that references another dll</h1> <p>I have a small exe I've written that uses <code>LibGit2Sharp</code> and am trying to use <code>Costura.Fody</code> to embed everything so I only have a single exe to distribute (actually, there are two config files as well, but that's ok).</p> <p>The probl...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,533
git
# costura.fody for a dll that references another dll I have a small exe I've written that uses `LibGit2Sharp` and am trying to use `Costura.Fody` to embed everything so I only have a single exe to distribute (actually, there are two config files as well, but that's ok). The problem seems to be that `LibGet2Sharp.dll`...
Figured this out with some help from [this question](https://stackoverflow.com/questions/33695753/not-able-to-get-costura-fody-to-work-keeps-asking-for-the-dll) and had to add some work of my own. Essentially, you need to create a pair of folders in the project, called Costura32 and Costura64 and put the appropriate v...
49106104
get current git branch inside a java test
9
2018-03-05 08:21:54
<p>I need to get name of the current Git branch inside a Java test. Probably I can parse <code>git status</code> results. Is any other approach or a ready code snippet is available?</p>
5,227
4,793,077
2018-03-05 12:53:21
49,106,276
11
2018-03-05 08:33:07
4,793,077
2018-03-05 12:53:21
https://stackoverflow.com/q/49106104
https://stackoverflow.com/a/49106276
<p>Works fine for me.</p> <pre><code>public static String getCurrentGitBranch() throws IOException, InterruptedException { Process process = Runtime.getRuntime().exec( "git rev-parse --abbrev-ref HEAD" ); process.waitFor(); BufferedReader reader = new BufferedReader( new InputStreamReader( pro...
<p>Works fine for me.</p> <pre><code>public static String getCurrentGitBranch() throws IOException, InterruptedException { Process process = Runtime.getRuntime().exec( "git rev-parse --abbrev-ref HEAD" ); process.waitFor(); BufferedReader reader = new BufferedReader( new InputStreamReader( pro...
17, 119
git, java
<h1>get current git branch inside a java test</h1> <p>I need to get name of the current Git branch inside a Java test. Probably I can parse <code>git status</code> results. Is any other approach or a ready code snippet is available?</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,534
git
# get current git branch inside a java test I need to get name of the current Git branch inside a Java test. Probably I can parse `git status` results. Is any other approach or a ready code snippet is available?
Works fine for me. ``` public static String getCurrentGitBranch() throws IOException, InterruptedException { Process process = Runtime.getRuntime().exec( "git rev-parse --abbrev-ref HEAD" ); process.waitFor(); BufferedReader reader = new BufferedReader( new InputStreamReader( process.getInputS...
39766619
How do I configure TortoiseGit to use Meld for diff, merge and conflicts?
9
2016-09-29 09:32:17
<p>I have tried a naive configuration to replace the native TortoiseGit viewers with <a href="https://wiki.gnome.org/Apps/Meld/Windows" rel="noreferrer">Meld for Windows</a> for diff, merge and conflict actions. What additional parameters do I need to pass in to Meld for these functions?</p> <p><a href="https://i.ssta...
4,548
236,081
2017-08-14 03:53:42
45,586,216
11
2017-08-09 09:06:40
3,247,152
2017-08-14 03:53:42
https://stackoverflow.com/q/39766619
https://stackoverflow.com/a/45586216
<p>Tested under meld 3.16.2</p> <p>Diff:</p> <p><code>C:\Program Files (x86)\Meld\Meld.exe %base %mine</code></p> <p>Merge:</p> <p><code>C:\Program Files (x86)\Meld\Meld.exe %mine %base %theirs --output %merged</code></p> <p><a href="https://i.sstatic.net/ncIU1.png" rel="noreferrer"><img src="https://i.sstatic.net...
<p>Tested under meld 3.16.2</p> <p>Diff:</p> <p><code>C:\Program Files (x86)\Meld\Meld.exe %base %mine</code></p> <p>Merge:</p> <p><code>C:\Program Files (x86)\Meld\Meld.exe %mine %base %theirs --output %merged</code></p> <p><a href="https://i.sstatic.net/ncIU1.png" rel="noreferrer"><img src="https://i.sstatic.net...
64, 119, 13630, 31409
git, meld, tortoisegit, windows
<h1>How do I configure TortoiseGit to use Meld for diff, merge and conflicts?</h1> <p>I have tried a naive configuration to replace the native TortoiseGit viewers with <a href="https://wiki.gnome.org/Apps/Meld/Windows" rel="noreferrer">Meld for Windows</a> for diff, merge and conflict actions. What additional parameter...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,535
git
# How do I configure TortoiseGit to use Meld for diff, merge and conflicts? I have tried a naive configuration to replace the native TortoiseGit viewers with [Meld for Windows](https://wiki.gnome.org/Apps/Meld/Windows) for diff, merge and conflict actions. What additional parameters do I need to pass in to Meld for th...
Tested under meld 3.16.2 Diff: `C:\Program Files (x86)\Meld\Meld.exe %base %mine` Merge: `C:\Program Files (x86)\Meld\Meld.exe %mine %base %theirs --output %merged` [![enter image description here](https://i.sstatic.net/ncIU1.png)](https://i.sstatic.net/ncIU1.png) (meld shows the %base file content in middle pane...
45533593
How to make git LFS not apply to a subdirectory
9
2017-08-06 15:31:49
<p>My repository uses git LFS and includes lines such as this one in its .gitattributes:</p> <pre><code>*.jar filter=lfs diff=lfs merge=lfs -text </code></pre> <p>There's one .jar file that I want to store in the repo directly, not involving LFS. Ideally, I would make LFS not apply to anything under the directory tha...
3,362
5,405,070
2024-01-16 07:58:08
45,533,738
11
2017-08-06 15:46:32
812,183
2017-08-06 15:46:32
https://stackoverflow.com/q/45533593
https://stackoverflow.com/a/45533738
<p>This answer is <a href="https://github.com/git-lfs/git-lfs/issues/2120#issuecomment-290754993" rel="noreferrer">largely sourced from this github comment</a></p> <p>The syntax for <code>.gitattributes</code> allows you to "minus" an attribute -- removing it from already being included (see: <a href="https://git-scm....
<p>This answer is <a href="https://github.com/git-lfs/git-lfs/issues/2120#issuecomment-290754993" rel="noreferrer">largely sourced from this github comment</a></p> <p>The syntax for <code>.gitattributes</code> allows you to "minus" an attribute -- removing it from already being included (see: <a href="https://git-scm....
119, 56102, 115244
git, gitattributes, git-lfs
<h1>How to make git LFS not apply to a subdirectory</h1> <p>My repository uses git LFS and includes lines such as this one in its .gitattributes:</p> <pre><code>*.jar filter=lfs diff=lfs merge=lfs -text </code></pre> <p>There's one .jar file that I want to store in the repo directly, not involving LFS. Ideally, I wou...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,536
git
# How to make git LFS not apply to a subdirectory My repository uses git LFS and includes lines such as this one in its .gitattributes: ``` *.jar filter=lfs diff=lfs merge=lfs -text ``` There's one .jar file that I want to store in the repo directly, not involving LFS. Ideally, I would make LFS not apply to anything...
This answer is [largely sourced from this github comment](https://github.com/git-lfs/git-lfs/issues/2120#issuecomment-290754993) The syntax for `.gitattributes` allows you to "minus" an attribute -- removing it from already being included (see: <https://git-scm.com/docs/gitattributes#gitattributes-Unset>) This allows...
45352225
Creating patch files in git
9
2017-07-27 13:27:30
<p>I wanted to know whether it is possible to create patch files in git. I mean if I have done some changes in few files then patch file should be created with respect to the filename.</p> <p><code>git diff</code> displays the changes on the console but <em>Is it possible to separate the output into different files?...
6,883
3,527,746
2023-05-25 09:03:11
45,352,805
11
2017-07-27 13:50:34
6,330,106
2023-05-25 09:03:11
https://stackoverflow.com/q/45352225
https://stackoverflow.com/a/45352805
<p><a href="https://git-scm.com/docs/git-format-patch" rel="nofollow noreferrer">git format-patch</a></p> <p>Say you've made a commit <code>aaa111</code> which modifies <code>foo.txt</code>, <code>bar.txt</code> and <code>hello.txt</code>.</p> <p><code>git format-patch -1 aaa111</code></p> <p>It generates a patch inclu...
<p><a href="https://git-scm.com/docs/git-format-patch" rel="nofollow noreferrer">git format-patch</a></p> <p>Say you've made a commit <code>aaa111</code> which modifies <code>foo.txt</code>, <code>bar.txt</code> and <code>hello.txt</code>.</p> <p><code>git format-patch -1 aaa111</code></p> <p>It generates a patch inclu...
119
git
<h1>Creating patch files in git</h1> <p>I wanted to know whether it is possible to create patch files in git. I mean if I have done some changes in few files then patch file should be created with respect to the filename.</p> <p><code>git diff</code> displays the changes on the console but <em>Is it possible to separa...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,537
git
# Creating patch files in git I wanted to know whether it is possible to create patch files in git. I mean if I have done some changes in few files then patch file should be created with respect to the filename. `git diff` displays the changes on the console but *Is it possible to separate the output into different f...
[git format-patch](https://git-scm.com/docs/git-format-patch) Say you've made a commit `aaa111` which modifies `foo.txt`, `bar.txt` and `hello.txt`. `git format-patch -1 aaa111` It generates a patch including three files' changes. `git format-patch -1 aaa111 -- foo.txt` It generates a patch including only the chan...
44407782
what is difference of "develop" and "origin/develop" in command git
9
2017-06-07 08:45:38
<p>I'm newbie and starting use git for project. I not notice the difference of "Branch" and "origin/Branch" Please guide me. <a href="https://i.sstatic.net/Tb2oR.png" rel="noreferrer"><img src="https://i.sstatic.net/Tb2oR.png" alt="Picture of the challenge that I&#39;ve faced"></a></p>
18,271
4,734,649
2017-06-07 09:18:06
44,407,809
11
2017-06-07 08:47:03
4,133,798
2017-06-07 09:18:06
https://stackoverflow.com/q/44407782
https://stackoverflow.com/a/44407809
<p><code>Branch</code> is your local branch and <code>origin/Branch</code> is your remote branch.</p> <p>To make sure which branches are local or remote just use the following git commands. </p> <pre><code>$ git branch # see local branches $ git branch -r # see remote branches $ git branch -a # see local and re...
<p><code>Branch</code> is your local branch and <code>origin/Branch</code> is your remote branch.</p> <p>To make sure which branches are local or remote just use the following git commands. </p> <pre><code>$ git branch # see local branches $ git branch -r # see remote branches $ git branch -a # see local and re...
119, 1796, 4236
command, git, push
<h1>what is difference of "develop" and "origin/develop" in command git</h1> <p>I'm newbie and starting use git for project. I not notice the difference of "Branch" and "origin/Branch" Please guide me. <a href="https://i.sstatic.net/Tb2oR.png" rel="noreferrer"><img src="https://i.sstatic.net/Tb2oR.png" alt="Picture of ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,538
git
# what is difference of "develop" and "origin/develop" in command git I'm newbie and starting use git for project. I not notice the difference of "Branch" and "origin/Branch" Please guide me. [![Picture of the challenge that I've faced](https://i.sstatic.net/Tb2oR.png)](https://i.sstatic.net/Tb2oR.png)
`Branch` is your local branch and `origin/Branch` is your remote branch. To make sure which branches are local or remote just use the following git commands. ``` $ git branch # see local branches $ git branch -r # see remote branches $ git branch -a # see local and remote branches ```
32661397
Is there a keyboard shortcut for stage lines in git gui?
9
2015-09-18 21:35:44
<p>In the standard <a href="https://git-scm.com/docs/git-gui" rel="noreferrer">git gui</a>, there are options to <a href="http://www.mfranc.com/uncategorized/git-git-gui-staging-selected-lines/" rel="noreferrer">stage selected lines</a> or stage hunk. I find myself using these options constantly, but each time I have t...
946
119,592
2021-10-25 15:23:55
35,543,923
11
2016-02-22 00:22:37
1,225,273
2021-10-25 15:23:55
https://stackoverflow.com/q/32661397
https://stackoverflow.com/a/35543923
<p>Here is a solution:</p> <p>Open this file:</p> <pre><code>c:/Program Files (x86)/Git/libexec/git-core/git-gui.tcl </code></pre> <p>Add the following:</p> <pre><code>bind . &lt;$M1B-Key-d&gt; stagelines proc stagelines {} { apply_or_revert_range_or_line %X %Y 0 # for older versions of git-gui, use this lin...
<p>Here is a solution:</p> <p>Open this file:</p> <pre><code>c:/Program Files (x86)/Git/libexec/git-core/git-gui.tcl </code></pre> <p>Add the following:</p> <pre><code>bind . &lt;$M1B-Key-d&gt; stagelines proc stagelines {} { apply_or_revert_range_or_line %X %Y 0 # for older versions of git-gui, use this lin...
119, 865, 33729
git, git-gui, user-interface
<h1>Is there a keyboard shortcut for stage lines in git gui?</h1> <p>In the standard <a href="https://git-scm.com/docs/git-gui" rel="noreferrer">git gui</a>, there are options to <a href="http://www.mfranc.com/uncategorized/git-git-gui-staging-selected-lines/" rel="noreferrer">stage selected lines</a> or stage hunk. I ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,542
git
# Is there a keyboard shortcut for stage lines in git gui? In the standard [git gui](https://git-scm.com/docs/git-gui), there are options to [stage selected lines](http://www.mfranc.com/uncategorized/git-git-gui-staging-selected-lines/) or stage hunk. I find myself using these options constantly, but each time I have ...
Here is a solution: Open this file: ``` c:/Program Files (x86)/Git/libexec/git-core/git-gui.tcl ``` Add the following: ``` bind . <$M1B-Key-d> stagelines proc stagelines {} { apply_or_revert_range_or_line %X %Y 0 # for older versions of git-gui, use this line instead: #apply_range_or_line %X %Y d...
32814034
Show message as well as diff with git stash show
9
2015-09-27 23:51:30
<p>Using the command line tool <code>git-stash</code>, how can I view both the stash message, as well as the diff, for a given stash?</p> <p>The documentation for <a href="https://www.kernel.org/pub/software/scm/git/docs/git-stash.html">git stash</a> mentions that you can configure how a diff is shown, but it doesn't ...
1,821
38,765
2022-08-21 15:18:31
35,426,625
11
2016-02-16 07:47:16
4,830,165
2022-08-21 15:18:31
https://stackoverflow.com/q/32814034
https://stackoverflow.com/a/35426625
<p>A stash is stored as a normal commit, hence you can use usual Git commands to display it, like:</p> <pre><code>git show stash@{1} </code></pre> <p>to show message and diff for <code>stash@{1}</code>. Since stashes are stored as commits with two parents (one for the index, and the other for the <code>HEAD</code> at t...
<p>A stash is stored as a normal commit, hence you can use usual Git commands to display it, like:</p> <pre><code>git show stash@{1} </code></pre> <p>to show message and diff for <code>stash@{1}</code>. Since stashes are stored as commits with two parents (one for the index, and the other for the <code>HEAD</code> at t...
119, 13091
git, git-stash
<h1>Show message as well as diff with git stash show</h1> <p>Using the command line tool <code>git-stash</code>, how can I view both the stash message, as well as the diff, for a given stash?</p> <p>The documentation for <a href="https://www.kernel.org/pub/software/scm/git/docs/git-stash.html">git stash</a> mentions t...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,543
git
# Show message as well as diff with git stash show Using the command line tool `git-stash`, how can I view both the stash message, as well as the diff, for a given stash? The documentation for [git stash](https://www.kernel.org/pub/software/scm/git/docs/git-stash.html) mentions that you can configure how a diff is sh...
A stash is stored as a normal commit, hence you can use usual Git commands to display it, like: ``` git show stash@{1} ``` to show message and diff for `stash@{1}`. Since stashes are stored as commits with two parents (one for the index, and the other for the `HEAD` at the time the stash was created), the command abo...
34609767
Svn to Git of only one subdirectory
9
2016-01-05 10:45:36
<p>I know about git-svn and have used it to migrate SVN repositories into Git. </p> <p>With one repo I have a specific requirement, which I can't find a solution for. That SVN repo contains multiple actual projects as subdirectories:</p> <pre><code>trunk/ project1/ project2/ project3/ branches/ branc...
3,612
717,214
2016-01-07 19:04:47
34,650,981
11
2016-01-07 09:02:22
717,214
2016-01-07 19:04:47
https://stackoverflow.com/q/34609767
https://stackoverflow.com/a/34650981
<p>I found the solution. It's not as simple as <code>git svn clone</code>, but not too difficult. So, here's what I did (say, for <code>project1</code> in the scenario from the question):</p> <ol> <li>Create an empty repo on the git server for <code>project1</code></li> <li>Clone the empty repo onto my local machine...
<p>I found the solution. It's not as simple as <code>git svn clone</code>, but not too difficult. So, here's what I did (say, for <code>project1</code> in the scenario from the question):</p> <ol> <li>Create an empty repo on the git server for <code>project1</code></li> <li>Clone the empty repo onto my local machine...
63, 119, 6452
git, git-svn, svn
<h1>Svn to Git of only one subdirectory</h1> <p>I know about git-svn and have used it to migrate SVN repositories into Git. </p> <p>With one repo I have a specific requirement, which I can't find a solution for. That SVN repo contains multiple actual projects as subdirectories:</p> <pre><code>trunk/ project1/ ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,544
git
# Svn to Git of only one subdirectory I know about git-svn and have used it to migrate SVN repositories into Git. With one repo I have a specific requirement, which I can't find a solution for. That SVN repo contains multiple actual projects as subdirectories: ``` trunk/ project1/ project2/ project3/ bra...
I found the solution. It's not as simple as `git svn clone`, but not too difficult. So, here's what I did (say, for `project1` in the scenario from the question): 1. Create an empty repo on the git server for `project1` 2. Clone the empty repo onto my local machine: `git clone git@git.server.com:group/project1.gi...
30256070
Changing the remote url of a repository in libgit2sharp
9
2015-05-15 09:32:40
<p>How can we change the remote url of a repository?</p> <pre><code>using (var repository = new Repository(repositoryPath)) { //Change the remote url first //Then checkout } </code></pre>
3,158
1,875,419
2020-08-20 00:07:35
30,256,920
11
2015-05-15 10:14:56
335,418
2020-08-20 00:07:35
https://stackoverflow.com/q/30256070
https://stackoverflow.com/a/30256920
<blockquote> <p>How can we change the remote url of a repository?</p> </blockquote> <pre><code>var newUrl = &quot;https://github.com/owner/my_repository.git&quot;;&quot;; Remote remote = repo.Network.Remotes[name]; // This will update the remote configuration, persist it // and return a new instance of the updated re...
<blockquote> <p>How can we change the remote url of a repository?</p> </blockquote> <pre><code>var newUrl = &quot;https://github.com/owner/my_repository.git&quot;;&quot;; Remote remote = repo.Network.Remotes[name]; // This will update the remote configuration, persist it // and return a new instance of the updated re...
74777
libgit2sharp
<h1>Changing the remote url of a repository in libgit2sharp</h1> <p>How can we change the remote url of a repository?</p> <pre><code>using (var repository = new Repository(repositoryPath)) { //Change the remote url first //Then checkout } </code></pre>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,545
git
# Changing the remote url of a repository in libgit2sharp How can we change the remote url of a repository? ``` using (var repository = new Repository(repositoryPath)) { //Change the remote url first //Then checkout } ```
> How can we change the remote url of a repository? ``` var newUrl = "https://github.com/owner/my_repository.git";"; Remote remote = repo.Network.Remotes[name]; // This will update the remote configuration, persist it // and return a new instance of the updated remote Remote updatedremote = repo.Network.Remotes.Upd...
29832785
Push to git repo in a yeoman generator?
9
2015-04-23 19:36:35
<p>I'm hoping someone can clarify how Yeoman's spawnCommand() method works a little. I'm working on a generator and I'd like it to initialize a git repo, commit and push the generated app at the end.</p> <p>I was under the impression that the second parameter being an array, it's an array of commands that would run un...
2,481
1,998,175
2016-02-26 18:44:14
29,834,006
11
2015-04-23 20:47:42
1,024,223
2016-02-26 18:44:14
https://stackoverflow.com/q/29832785
https://stackoverflow.com/a/29834006
<p>Use one <code>this.spawnCommandSync()</code> per git command you want to run.</p> <pre><code>this.spawnCommandSync('git', ['init']); this.spawnCommandSync('git', ['remote', 'add', 'origin', this.repo]); this.spawnCommandSync('git', ['add', '--all']); this.spawnCommandSync('git', ['commit', '-m', '"initial commit fr...
<p>Use one <code>this.spawnCommandSync()</code> per git command you want to run.</p> <pre><code>this.spawnCommandSync('git', ['init']); this.spawnCommandSync('git', ['remote', 'add', 'origin', this.repo]); this.spawnCommandSync('git', ['add', '--all']); this.spawnCommandSync('git', ['commit', '-m', '"initial commit fr...
119, 83890, 95992
git, yeoman, yeoman-generator
<h1>Push to git repo in a yeoman generator?</h1> <p>I'm hoping someone can clarify how Yeoman's spawnCommand() method works a little. I'm working on a generator and I'd like it to initialize a git repo, commit and push the generated app at the end.</p> <p>I was under the impression that the second parameter being an a...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,546
git
# Push to git repo in a yeoman generator? I'm hoping someone can clarify how Yeoman's spawnCommand() method works a little. I'm working on a generator and I'd like it to initialize a git repo, commit and push the generated app at the end. I was under the impression that the second parameter being an array, it's an ar...
Use one `this.spawnCommandSync()` per git command you want to run. ``` this.spawnCommandSync('git', ['init']); this.spawnCommandSync('git', ['remote', 'add', 'origin', this.repo]); this.spawnCommandSync('git', ['add', '--all']); this.spawnCommandSync('git', ['commit', '-m', '"initial commit from generator"']); this.sp...
27445747
How to rebase over already rebased branch
9
2014-12-12 14:27:13
<p>My git branches look like this:</p> <pre><code>master-*-*-*-*-*-*-implement_x \ \-*-further_foo_fixes_that_depend_on_x \ \-*-*-further_bar_fixes_that_depend_on_x \ \-implement_x_rebased </code></pre> <p>It ended this way, because I thought my branch <code>implement_x...
4,376
1,106,456
2014-12-12 18:16:51
27,449,674
11
2014-12-12 18:16:51
1,236,045
2014-12-12 18:16:51
https://stackoverflow.com/q/27445747
https://stackoverflow.com/a/27449674
<p>This seems to be a task for the <code>--onto</code> option of <code>git rebase</code>.</p> <pre><code>git rebase --onto implement_x_rebased implement_x further_bar_fixes_that_depend_on_x </code></pre> <p>You may want to have look at the <code>--onto</code> example in the <a href="https://www.kernel.org/pub/softwar...
<p>This seems to be a task for the <code>--onto</code> option of <code>git rebase</code>.</p> <pre><code>git rebase --onto implement_x_rebased implement_x further_bar_fixes_that_depend_on_x </code></pre> <p>You may want to have look at the <code>--onto</code> example in the <a href="https://www.kernel.org/pub/softwar...
119, 29934
git, git-rebase
<h1>How to rebase over already rebased branch</h1> <p>My git branches look like this:</p> <pre><code>master-*-*-*-*-*-*-implement_x \ \-*-further_foo_fixes_that_depend_on_x \ \-*-*-further_bar_fixes_that_depend_on_x \ \-implement_x_rebased </code></pre> <p>It ended this...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,547
git
# How to rebase over already rebased branch My git branches look like this: ``` master-*-*-*-*-*-*-implement_x \ \-*-further_foo_fixes_that_depend_on_x \ \-*-*-further_bar_fixes_that_depend_on_x \ \-implement_x_rebased ``` It ended this way, because I thought my branch...
This seems to be a task for the `--onto` option of `git rebase`. ``` git rebase --onto implement_x_rebased implement_x further_bar_fixes_that_depend_on_x ``` You may want to have look at the `--onto` example in the [git rebase manual](https://www.kernel.org/pub/software/scm/git/docs/git-rebase.html).
25953411
How can a pre-commit git hook runs rspec tests and prevent a commit?
9
2014-09-20 21:20:33
<p>How can I add a pre-commit hook that will run my rspec tests and if any fail, will not complete the commit. I can get the tests to run but not prevent the commit on any failure of them</p> <p>I have copied <code>.git/hooks/pre-commit.sample</code> to <code>.git/hooks/pre-commit</code></p> <p>I've added <code>rspe...
3,294
631,619
2014-09-20 23:45:28
25,954,329
11
2014-09-20 23:42:30
631,619
2014-09-20 23:42:30
https://stackoverflow.com/q/25953411
https://stackoverflow.com/a/25954329
<p>I found that using</p> <pre><code>exec rspec spec </code></pre> <p>in</p> <pre><code>.git/hooks/pre-commit </code></pre> <p>gave me the desired functionality -<br> commit attempts trigger rspec test runs and the commit only complete if all rspec tests pass.</p>
<p>I found that using</p> <pre><code>exec rspec spec </code></pre> <p>in</p> <pre><code>.git/hooks/pre-commit </code></pre> <p>gave me the desired functionality -<br> commit attempts trigger rspec test runs and the commit only complete if all rspec tests pass.</p>
119, 3081, 4984, 25281, 43087
git, githooks, pre-commit-hook, rspec, ruby-on-rails
<h1>How can a pre-commit git hook runs rspec tests and prevent a commit?</h1> <p>How can I add a pre-commit hook that will run my rspec tests and if any fail, will not complete the commit. I can get the tests to run but not prevent the commit on any failure of them</p> <p>I have copied <code>.git/hooks/pre-commit.sam...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,548
git
# How can a pre-commit git hook runs rspec tests and prevent a commit? How can I add a pre-commit hook that will run my rspec tests and if any fail, will not complete the commit. I can get the tests to run but not prevent the commit on any failure of them I have copied `.git/hooks/pre-commit.sample` to `.git/hooks/pr...
I found that using ``` exec rspec spec ``` in ``` .git/hooks/pre-commit ``` gave me the desired functionality - commit attempts trigger rspec test runs and the commit only complete if all rspec tests pass.
25440207
Difference between pre-push and pre-receive hook in git?
9
2014-08-22 05:37:31
<p>Is there a difference between pre-push and pre-receive hook in git, in terms of use case or working logic?<br> The only difference I could understand from their <a href="https://github.com/git/git/blob/master/Documentation/githooks.txt#L211" rel="noreferrer">documentation</a> was in terms of the input they receive -...
3,533
1,783,805
2014-08-22 05:44:26
25,440,229
11
2014-08-22 05:39:11
6,309
2014-08-22 05:44:26
https://stackoverflow.com/q/25440207
https://stackoverflow.com/a/25440229
<p>One (<code>pre-push</code>) is a <a href="http://git-scm.com/book/en/Customizing-Git-Git-Hooks#Client-Side-Hooks" rel="noreferrer"><strong>client-side</strong> hook</a>, the other (<code>pre-receive</code>) is a <a href="http://git-scm.com/book/en/Customizing-Git-Git-Hooks#Server-Side-Hooks" rel="noreferrer"><strong...
<p>One (<code>pre-push</code>) is a <a href="http://git-scm.com/book/en/Customizing-Git-Git-Hooks#Client-Side-Hooks" rel="noreferrer"><strong>client-side</strong> hook</a>, the other (<code>pre-receive</code>) is a <a href="http://git-scm.com/book/en/Customizing-Git-Git-Hooks#Server-Side-Hooks" rel="noreferrer"><strong...
119, 43087
git, githooks
<h1>Difference between pre-push and pre-receive hook in git?</h1> <p>Is there a difference between pre-push and pre-receive hook in git, in terms of use case or working logic?<br> The only difference I could understand from their <a href="https://github.com/git/git/blob/master/Documentation/githooks.txt#L211" rel="nore...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,549
git
# Difference between pre-push and pre-receive hook in git? Is there a difference between pre-push and pre-receive hook in git, in terms of use case or working logic? The only difference I could understand from their [documentation](https://github.com/git/git/blob/master/Documentation/githooks.txt#L211) was in terms ...
One (`pre-push`) is a [**client-side** hook](http://git-scm.com/book/en/Customizing-Git-Git-Hooks#Client-Side-Hooks), the other (`pre-receive`) is a [**server-side** hook](http://git-scm.com/book/en/Customizing-Git-Git-Hooks#Server-Side-Hooks). In that aspect, they are *very* different, and if you want to enforce *con...
25375679
Git amend/reword (without adding/changing files)
9
2014-08-19 04:27:58
<p>Often I want to edit a commit message without having to re-select the file-set from the last commit.</p> <pre><code>git commit file1.c file2.c </code></pre> <p>Accidental typo in commit message.</p> <pre><code>git commit file1.c file2.c --amend </code></pre> <p>This works, but Id like not to have to re-select th...
1,680
432,509
2015-02-23 07:18:24
25,375,850
11
2014-08-19 04:51:52
null
2014-08-19 22:23:50
https://stackoverflow.com/q/25375679
https://stackoverflow.com/a/25375850
<h3>Amending message without staged changes</h3> <p>As long as you don't have any changes staged in your staging area, you can simply use</p> <pre><code>git commit --amend </code></pre> <p>to edit your previous commit's message<sup>1</sup>.</p> <h3>Amending message even <em>with</em> staged changes</h3> <p>However...
<h3>Amending message without staged changes</h3> <p>As long as you don't have any changes staged in your staging area, you can simply use</p> <pre><code>git commit --amend </code></pre> <p>to edit your previous commit's message<sup>1</sup>.</p> <h3>Amending message even <em>with</em> staged changes</h3> <p>However...
119, 30968, 53850, 91259
git, git-amend, git-commit, git-rewrite-history
<h1>Git amend/reword (without adding/changing files)</h1> <p>Often I want to edit a commit message without having to re-select the file-set from the last commit.</p> <pre><code>git commit file1.c file2.c </code></pre> <p>Accidental typo in commit message.</p> <pre><code>git commit file1.c file2.c --amend </code></pr...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,550
git
# Git amend/reword (without adding/changing files) Often I want to edit a commit message without having to re-select the file-set from the last commit. ``` git commit file1.c file2.c ``` Accidental typo in commit message. ``` git commit file1.c file2.c --amend ``` This works, but Id like not to have to re-select t...
### Amending message without staged changes As long as you don't have any changes staged in your staging area, you can simply use ``` git commit --amend ``` to edit your previous commit's message1. ### Amending message even *with* staged changes However, if you *do* have changes staged, then you can use the `--onl...
23723461
How can I share a git configuration?
9
2014-05-18 15:15:46
<p>I've initiated a new git repository using <code>git flow</code>, done a commit or two and pushed.</p> <p>When I clone the repository in a new directory and run a <code>git flow</code> command I get the error:</p> <pre><code>Fatal: Not a gitflow-enabled repo yet. Please run 'git flow init' first. </code></pre> <p>...
6,609
1,574,376
2015-07-23 08:58:48
23,726,067
11
2014-05-18 19:36:10
761,202
2014-05-18 19:36:10
https://stackoverflow.com/q/23723461
https://stackoverflow.com/a/23726067
<h2>You cannot directly share you config</h2> <p>The contents of the <code>.git</code> folder are (intended to be) specific to an individual install.</p> <h2>Alternative</h2> <p>Instead of trying to directly share your config, consider adding a script to the repository to setup whatever config you want to share. e.g. a...
<h2>You cannot directly share you config</h2> <p>The contents of the <code>.git</code> folder are (intended to be) specific to an individual install.</p> <h2>Alternative</h2> <p>Instead of trying to directly share your config, consider adding a script to the repository to setup whatever config you want to share. e.g. a...
119, 64339
git, git-flow
<h1>How can I share a git configuration?</h1> <p>I've initiated a new git repository using <code>git flow</code>, done a commit or two and pushed.</p> <p>When I clone the repository in a new directory and run a <code>git flow</code> command I get the error:</p> <pre><code>Fatal: Not a gitflow-enabled repo yet. Please...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,551
git
# How can I share a git configuration? I've initiated a new git repository using `git flow`, done a commit or two and pushed. When I clone the repository in a new directory and run a `git flow` command I get the error: ``` Fatal: Not a gitflow-enabled repo yet. Please run 'git flow init' first. ``` The reason for t...
## You cannot directly share you config The contents of the `.git` folder are (intended to be) specific to an individual install. ## Alternative Instead of trying to directly share your config, consider adding a script to the repository to setup whatever config you want to share. e.g. add a file named `bin/setup` to...
23483100
undo "git filter-branch ... -- --all"? in one command?
9
2014-05-05 22:39:59
<p>I started messing around with <code>git filter-branch</code>. The --all option rewrites all branches and tags. Cool. <code>git filter-branch</code> creates a backup of all refs it overwrites in refs/original. Very Cool. Now I'd like to blow all my experimenting with <code>filter-branch</code> away.</p> <p><str...
2,685
407,588
2018-01-05 18:08:17
23,483,576
11
2014-05-05 23:30:35
1,290,731
2017-08-29 15:34:09
https://stackoverflow.com/q/23483100
https://stackoverflow.com/a/23483576
<p>Here's a simple and safe way to undo a filter-branch:</p> <pre><code>git fetch . +refs/original/*:* </code></pre> <p>If the currently checked out branch (<code>HEAD</code>) is one of the branches to be restored, this command will fail. You can run <code>git checkout --detach</code> beforehand to let <code>git fetc...
<p>Here's a simple and safe way to undo a filter-branch:</p> <pre><code>git fetch . +refs/original/*:* </code></pre> <p>If the currently checked out branch (<code>HEAD</code>) is one of the branches to be restored, this command will fail. You can run <code>git checkout --detach</code> beforehand to let <code>git fetc...
119, 46509
git, git-filter-branch
<h1>undo "git filter-branch ... -- --all"? in one command?</h1> <p>I started messing around with <code>git filter-branch</code>. The --all option rewrites all branches and tags. Cool. <code>git filter-branch</code> creates a backup of all refs it overwrites in refs/original. Very Cool. Now I'd like to blow all my ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,552
git
# undo "git filter-branch ... -- --all"? in one command? I started messing around with `git filter-branch`. The --all option rewrites all branches and tags. Cool. `git filter-branch` creates a backup of all refs it overwrites in refs/original. Very Cool. Now I'd like to blow all my experimenting with `filter-branch` a...
Here's a simple and safe way to undo a filter-branch: ``` git fetch . +refs/original/*:* ``` If the currently checked out branch (`HEAD`) is one of the branches to be restored, this command will fail. You can run `git checkout --detach` beforehand to let `git fetch` update all branches. Remember to checkout a branch ...
18000738
Private Git on OpenShift
9
2013-08-01 17:29:56
<p>Is any way to configure a private git repository in OpenShift?</p> <p>Or OpenShift doesn't provide external access to Git repositories?</p>
2,635
2,643,098
2017-01-11 18:03:48
18,036,540
11
2013-08-03 19:36:25
1,481,408
2013-08-03 19:36:25
https://stackoverflow.com/q/18000738
https://stackoverflow.com/a/18036540
<p>You need to execute the following steps:</p> <pre><code>git clone &lt;your-external-repo-url&gt; change to newly cloned git directory git remote add openshift -f &lt;openshift-git-repo-url&gt; git merge openshift/master -s recursive -X ours git push openshift master </code></pre> <p>Here's the <a href="https://ge...
<p>You need to execute the following steps:</p> <pre><code>git clone &lt;your-external-repo-url&gt; change to newly cloned git directory git remote add openshift -f &lt;openshift-git-repo-url&gt; git merge openshift/master -s recursive -X ours git push openshift master </code></pre> <p>Here's the <a href="https://ge...
119, 77738
git, openshift
<h1>Private Git on OpenShift</h1> <p>Is any way to configure a private git repository in OpenShift?</p> <p>Or OpenShift doesn't provide external access to Git repositories?</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,553
git
# Private Git on OpenShift Is any way to configure a private git repository in OpenShift? Or OpenShift doesn't provide external access to Git repositories?
You need to execute the following steps: ``` git clone <your-external-repo-url> change to newly cloned git directory git remote add openshift -f <openshift-git-repo-url> git merge openshift/master -s recursive -X ours git push openshift master ``` Here's the [reference](https://geekwentfreak-raviteja.rhcloud.com/201...
13006135
Copy last commits from master to branch
9
2012-10-22 06:41:04
<p>Present situation in the picture. Green branch is a master. How to copy last 3 commits from master to pink branch, but without touching a master ?</p> <p><img src="https://i.sstatic.net/heHDA.png" alt="enter image description here"></p>
18,703
404,395
2013-09-11 23:49:11
13,006,204
11
2012-10-22 06:47:20
479,989
2013-09-11 23:49:11
https://stackoverflow.com/q/13006135
https://stackoverflow.com/a/13006204
<p>If you mean you wished you had waited to branch (and it's a personal project branch) you can (from branch "pink") use <code>git rebase master</code>. That will pop off the pink commits, move <code>pink</code> ahead to 29934b6 and then re-apply the patches.</p> <p>Otherwise Amber's <code>git merge</code> is probabl...
<p>If you mean you wished you had waited to branch (and it's a personal project branch) you can (from branch "pink") use <code>git rebase master</code>. That will pop off the pink commits, move <code>pink</code> ahead to 29934b6 and then re-apply the patches.</p> <p>Otherwise Amber's <code>git merge</code> is probabl...
119
git
<h1>Copy last commits from master to branch</h1> <p>Present situation in the picture. Green branch is a master. How to copy last 3 commits from master to pink branch, but without touching a master ?</p> <p><img src="https://i.sstatic.net/heHDA.png" alt="enter image description here"></p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,555
git
# Copy last commits from master to branch Present situation in the picture. Green branch is a master. How to copy last 3 commits from master to pink branch, but without touching a master ? ![enter image description here](https://i.sstatic.net/heHDA.png)
If you mean you wished you had waited to branch (and it's a personal project branch) you can (from branch "pink") use `git rebase master`. That will pop off the pink commits, move `pink` ahead to 29934b6 and then re-apply the patches. Otherwise Amber's `git merge` is probably the best answer. Another possibility is (...
10406315
How can I "back out" a feature branch merge in Git?
9
2012-05-02 00:43:33
<p>I am relatively new to Git and I want to know if this is correct to do and if there are other ways to remove a feature branch which is merged to master branch. Let me explain with a example:</p> <p>Let us assume we are working on three tickets (bugs/enhancements) and there are three feature branches one for each ti...
7,018
1,368,887
2021-07-14 02:21:09
10,406,368
11
2012-05-02 00:50:56
893
2021-07-14 02:21:09
https://stackoverflow.com/q/10406315
https://stackoverflow.com/a/10406368
<p>If your merges create a &quot;merge commit&quot;, which is often a good idea for this very reason, then you can reverse the changes from a specific feature branch by using the <a href="http://schacon.github.com/git/git-revert.html" rel="nofollow noreferrer"><code>git revert</code></a> command with the commit ID of t...
<p>If your merges create a &quot;merge commit&quot;, which is often a good idea for this very reason, then you can reverse the changes from a specific feature branch by using the <a href="http://schacon.github.com/git/git-revert.html" rel="nofollow noreferrer"><code>git revert</code></a> command with the commit ID of t...
119
git
<h1>How can I "back out" a feature branch merge in Git?</h1> <p>I am relatively new to Git and I want to know if this is correct to do and if there are other ways to remove a feature branch which is merged to master branch. Let me explain with a example:</p> <p>Let us assume we are working on three tickets (bugs/enhan...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,557
git
# How can I "back out" a feature branch merge in Git? I am relatively new to Git and I want to know if this is correct to do and if there are other ways to remove a feature branch which is merged to master branch. Let me explain with a example: Let us assume we are working on three tickets (bugs/enhancements) and the...
If your merges create a "merge commit", which is often a good idea for this very reason, then you can reverse the changes from a specific feature branch by using the [`git revert`](http://schacon.github.com/git/git-revert.html) command with the commit ID of the merge commit for that branch. The Git documentation inclu...
7540572
Is there a way to do "git log -n 100 -from 200"?
9
2011-09-24 17:16:21
<p>Is there a way to do like paginated retrieval of commit history like <code>git log -n 100 -from 200</code>? It would fetch 100 commits after the first 200th commit. Is there such a feature?</p>
1,367
283,055
2011-09-24 17:30:26
7,540,580
11
2011-09-24 17:18:22
223,092
2011-09-24 17:30:26
https://stackoverflow.com/q/7540572
https://stackoverflow.com/a/7540580
<p>You can do that with:</p> <pre><code>git log -n 100 --skip=200 </code></pre> <p>The documentation for these options can be <a href="http://schacon.github.com/git/git-log.html#_commit_limiting" rel="noreferrer">found here</a>.</p>
<p>You can do that with:</p> <pre><code>git log -n 100 --skip=200 </code></pre> <p>The documentation for these options can be <a href="http://schacon.github.com/git/git-log.html#_commit_limiting" rel="noreferrer">found here</a>.</p>
119
git
<h1>Is there a way to do "git log -n 100 -from 200"?</h1> <p>Is there a way to do like paginated retrieval of commit history like <code>git log -n 100 -from 200</code>? It would fetch 100 commits after the first 200th commit. Is there such a feature?</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,559
git
# Is there a way to do "git log -n 100 -from 200"? Is there a way to do like paginated retrieval of commit history like `git log -n 100 -from 200`? It would fetch 100 commits after the first 200th commit. Is there such a feature?
You can do that with: ``` git log -n 100 --skip=200 ``` The documentation for these options can be [found here](http://schacon.github.com/git/git-log.html#_commit_limiting).
6821705
Make a new branch from master then revert master back to certain commit
9
2011-07-25 20:08:20
<p>I would like to make a branch from master then revert master back to a certain point. How can this be achieved with git?</p>
2,583
204,927
2011-07-25 20:14:46
6,821,777
11
2011-07-25 20:14:46
275,354
2011-07-25 20:14:46
https://stackoverflow.com/q/6821705
https://stackoverflow.com/a/6821777
<p><code>git checkout master</code><br> <code>git branch newBranch</code><br> <code>git reset shaToResetMasterTo</code></p>
<p><code>git checkout master</code><br> <code>git branch newBranch</code><br> <code>git reset shaToResetMasterTo</code></p>
119
git
<h1>Make a new branch from master then revert master back to certain commit</h1> <p>I would like to make a branch from master then revert master back to a certain point. How can this be achieved with git?</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,560
git
# Make a new branch from master then revert master back to certain commit I would like to make a branch from master then revert master back to a certain point. How can this be achieved with git?
`git checkout master` `git branch newBranch` `git reset shaToResetMasterTo`
6430572
Listening for Git Repo Changes
9
2011-06-21 19:00:05
<p>I want to write an app that given a user's GitHub account information and a repo will be notified whenever the repo is pushed to. I know I could basically save the state of the repo and poll it for changes periodically but I was wondering if there is a way to do this with a push architecture and if so how to go abou...
9,567
553,725
2020-07-21 13:09:25
6,430,706
11
2011-06-21 19:11:36
298,054
2011-06-21 19:11:36
https://stackoverflow.com/q/6430572
https://stackoverflow.com/a/6430706
<p>If you want to perform an action when a <code>push</code> is received, you can write a script and use it as a <code>post-receive</code> hook. GitHub supports git-hooks, but for obvious reasons they do not allow you to write a "custom script". What their script do is actually simple - they notify you by POSTing a JSO...
<p>If you want to perform an action when a <code>push</code> is received, you can write a script and use it as a <code>post-receive</code> hook. GitHub supports git-hooks, but for obvious reasons they do not allow you to write a "custom script". What their script do is actually simple - they notify you by POSTing a JSO...
119, 4236
git, push
<h1>Listening for Git Repo Changes</h1> <p>I want to write an app that given a user's GitHub account information and a repo will be notified whenever the repo is pushed to. I know I could basically save the state of the repo and poll it for changes periodically but I was wondering if there is a way to do this with a pu...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,561
git
# Listening for Git Repo Changes I want to write an app that given a user's GitHub account information and a repo will be notified whenever the repo is pushed to. I know I could basically save the state of the repo and poll it for changes periodically but I was wondering if there is a way to do this with a push archit...
If you want to perform an action when a `push` is received, you can write a script and use it as a `post-receive` hook. GitHub supports git-hooks, but for obvious reasons they do not allow you to write a "custom script". What their script do is actually simple - they notify you by POSTing a JSON to an URL you specify. ...
5469978
Git pack filenames -- what is the digest?
9
2011-03-29 08:47:46
<p>Git stores individual objects in <code>.git/objects/ab/cdefgh...</code> where <code>ab</code> is the first byte of the SHA1 digest.</p> <p>However, pack files don't follow the same naming policy, and I can find no documentation on how it is named. Any insights?</p>
2,909
678,216
2016-04-01 10:15:47
5,470,188
11
2011-03-29 09:07:51
223,092
2011-03-29 09:07:51
https://stackoverflow.com/q/5469978
https://stackoverflow.com/a/5470188
<p>The pack files are kept in <code>objects/pack</code>, which is documented in <a href="http://www.kernel.org/pub/software/scm/git/docs/gitrepository-layout.html#_description">gitrepository layout</a>. Within this directory, they are stored as pairs of an index file and the pack file itself, called, for example:</p> ...
<p>The pack files are kept in <code>objects/pack</code>, which is documented in <a href="http://www.kernel.org/pub/software/scm/git/docs/gitrepository-layout.html#_description">gitrepository layout</a>. Within this directory, they are stored as pairs of an index file and the pack file itself, called, for example:</p> ...
119, 21567
git, pack
<h1>Git pack filenames -- what is the digest?</h1> <p>Git stores individual objects in <code>.git/objects/ab/cdefgh...</code> where <code>ab</code> is the first byte of the SHA1 digest.</p> <p>However, pack files don't follow the same naming policy, and I can find no documentation on how it is named. Any insights?</p>...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,563
git
# Git pack filenames -- what is the digest? Git stores individual objects in `.git/objects/ab/cdefgh...` where `ab` is the first byte of the SHA1 digest. However, pack files don't follow the same naming policy, and I can find no documentation on how it is named. Any insights?
The pack files are kept in `objects/pack`, which is documented in [gitrepository layout](http://www.kernel.org/pub/software/scm/git/docs/gitrepository-layout.html#_description). Within this directory, they are stored as pairs of an index file and the pack file itself, called, for example: ``` pack-a862cfa8b08077329007...
4761426
git reflog references pruned commits, but does not show the reflog for the branch
9
2011-01-21 16:49:15
<p>git gc shows:</p> <pre><code>warning: reflog of 'refs/remotes/origin/abc_branch' references pruned commits </code></pre> <p>But, when I try to see the reflog, I get nothing:</p> <pre><code>$ git reflog show origin/abc_branch@{0} fatal: ambiguous argument 'origin/abc_branch@{0}': unknown revision or path not in t...
8,139
4,118
2011-03-15 20:37:21
5,317,736
11
2011-03-15 20:37:21
158,513
2011-03-15 20:37:21
https://stackoverflow.com/q/4761426
https://stackoverflow.com/a/5317736
<p>If you just want to get rid of the <code>abc_branch</code> ref, you could try:</p> <pre><code>git update-ref -d refs/remotes/origin/abc_branch </code></pre>
<p>If you just want to get rid of the <code>abc_branch</code> ref, you could try:</p> <pre><code>git update-ref -d refs/remotes/origin/abc_branch </code></pre>
119
git
<h1>git reflog references pruned commits, but does not show the reflog for the branch</h1> <p>git gc shows:</p> <pre><code>warning: reflog of 'refs/remotes/origin/abc_branch' references pruned commits </code></pre> <p>But, when I try to see the reflog, I get nothing:</p> <pre><code>$ git reflog show origin/abc_branc...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,564
git
# git reflog references pruned commits, but does not show the reflog for the branch git gc shows: ``` warning: reflog of 'refs/remotes/origin/abc_branch' references pruned commits ``` But, when I try to see the reflog, I get nothing: ``` $ git reflog show origin/abc_branch@{0} fatal: ambiguous argument 'origin/abc...
If you just want to get rid of the `abc_branch` ref, you could try: ``` git update-ref -d refs/remotes/origin/abc_branch ```
4741249
How can I do git merges in such a way that they are easy to roll back?
9
2011-01-19 21:55:54
<p>There is lots of talk about how it's not easy to "undo" a merge in git. Short version: if you undo a merge commit, it also tells git to never merge those changes back in in the future.</p> <p>Is there something I can do when doing the merge in order to abate this problem? There are plenty of situations where undoin...
496
168,143
2015-12-04 12:00:59
4,741,357
11
2011-01-19 22:07:49
1,864,976
2013-01-15 08:46:22
https://stackoverflow.com/q/4741249
https://stackoverflow.com/a/4741357
<p>UPDATE:</p> <p>A workflow that makes it easier to work with branch-per-feature is here: <a href="http://dymitruk.com/blog/2012/02/05/branch-per-feature/" rel="nofollow">http://dymitruk.com/blog/2012/02/05/branch-per-feature/</a></p> <hr> <p>(the SVN part of the question has been answered at the end)</p> <p>Yes, ...
<p>UPDATE:</p> <p>A workflow that makes it easier to work with branch-per-feature is here: <a href="http://dymitruk.com/blog/2012/02/05/branch-per-feature/" rel="nofollow">http://dymitruk.com/blog/2012/02/05/branch-per-feature/</a></p> <hr> <p>(the SVN part of the question has been answered at the end)</p> <p>Yes, ...
119, 717, 5766, 12196, 40701
feature-branch, git, merge, rollback, undo
<h1>How can I do git merges in such a way that they are easy to roll back?</h1> <p>There is lots of talk about how it's not easy to "undo" a merge in git. Short version: if you undo a merge commit, it also tells git to never merge those changes back in in the future.</p> <p>Is there something I can do when doing the m...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,565
git
# How can I do git merges in such a way that they are easy to roll back? There is lots of talk about how it's not easy to "undo" a merge in git. Short version: if you undo a merge commit, it also tells git to never merge those changes back in in the future. Is there something I can do when doing the merge in order to...
UPDATE: A workflow that makes it easier to work with branch-per-feature is here: <http://dymitruk.com/blog/2012/02/05/branch-per-feature/> --- (the SVN part of the question has been answered at the end) Yes, here is how you reintroduce a feature that you unmerged. Consider the following history (assumes you "undid"...
3893231
Head commit for all remote branches using Git
9
2010-10-08 18:20:42
<p>I know how to list the remote branches</p> <pre><code>$ git branch -a </code></pre> <p>And I know how to find the head commit hash of my current branch</p> <pre><code>$ git rev-parse HEAD </code></pre> <p>But I'm not sure how to list all the head commit hashes for all the remote branches. This is close to what ...
7,272
245,777
2012-08-13 10:12:03
3,893,370
11
2010-10-08 18:41:20
356,716
2010-10-08 18:41:20
https://stackoverflow.com/q/3893231
https://stackoverflow.com/a/3893370
<p>Use either </p> <pre><code>git branch -r -v --no-abbrev </code></pre> <p>and ignore part with commit message or</p> <pre><code>git show-ref </code></pre> <p>and filter results starting with refs/remotes.</p>
<p>Use either </p> <pre><code>git branch -r -v --no-abbrev </code></pre> <p>and ignore part with commit message or</p> <pre><code>git show-ref </code></pre> <p>and filter results starting with refs/remotes.</p>
119, 5597, 31678
commit, git, remote-branch
<h1>Head commit for all remote branches using Git</h1> <p>I know how to list the remote branches</p> <pre><code>$ git branch -a </code></pre> <p>And I know how to find the head commit hash of my current branch</p> <pre><code>$ git rev-parse HEAD </code></pre> <p>But I'm not sure how to list all the head commit hash...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,567
git
# Head commit for all remote branches using Git I know how to list the remote branches ``` $ git branch -a ``` And I know how to find the head commit hash of my current branch ``` $ git rev-parse HEAD ``` But I'm not sure how to list all the head commit hashes for all the remote branches. This is close to what I w...
Use either ``` git branch -r -v --no-abbrev ``` and ignore part with commit message or ``` git show-ref ``` and filter results starting with refs/remotes.
3876168
How can I write a rule in gitignore to ignore all files except directories in some directory?
9
2010-10-06 19:28:48
<p>So lets say I have a directory structure like so</p> <pre><code>uploads/ --dir1/ ----one.txt ----two.txt ----dir2/ ------one.txt ------two.txt </code></pre> <p>I would like any directory and sub directories of uploads to be tracked but not any files in it with the exception of a dummy file because git doesn't trac...
4,959
237,016
2010-10-06 23:16:25
3,877,584
11
2010-10-06 23:16:25
193,688
2010-10-06 23:16:25
https://stackoverflow.com/q/3876168
https://stackoverflow.com/a/3877584
<p>When you tell it to ignore <code>*</code>, Git will not recurse into any subdirectories (even though you have a “unignore” pattern that might match something <em>inside</em> one of the directories).</p> <p>There is a bit of the <a href="http://git-scm.com/docs/gitignore">gitignore</a> pattern language that might he...
<p>When you tell it to ignore <code>*</code>, Git will not recurse into any subdirectories (even though you have a “unignore” pattern that might match something <em>inside</em> one of the directories).</p> <p>There is a bit of the <a href="http://git-scm.com/docs/gitignore">gitignore</a> pattern language that might he...
119, 25056
git, gitignore
<h1>How can I write a rule in gitignore to ignore all files except directories in some directory?</h1> <p>So lets say I have a directory structure like so</p> <pre><code>uploads/ --dir1/ ----one.txt ----two.txt ----dir2/ ------one.txt ------two.txt </code></pre> <p>I would like any directory and sub directories of up...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,568
git
# How can I write a rule in gitignore to ignore all files except directories in some directory? So lets say I have a directory structure like so ``` uploads/ --dir1/ ----one.txt ----two.txt ----dir2/ ------one.txt ------two.txt ``` I would like any directory and sub directories of uploads to be tracked but not any f...
When you tell it to ignore `*`, Git will not recurse into any subdirectories (even though you have a “unignore” pattern that might match something *inside* one of the directories). There is a bit of the [gitignore](http://git-scm.com/docs/gitignore) pattern language that might help though. A trailing slash forces the ...
3827291
capistrano deployment nightmare
9
2010-09-30 02:32:11
<p>I am getting the followoing error when I try to do a deploy via a "deploy" user account.</p> <pre><code> 1782001..ae10d1b master -&gt; master ** transaction: start * executing `deploy:update_code' updating the cached checkout on all servers executing locally: "git ls-remote git@github.com:username/app_...
4,877
444,875
2010-09-30 03:40:43
3,827,310
11
2010-09-30 02:37:42
203,731
2010-09-30 02:37:42
https://stackoverflow.com/q/3827291
https://stackoverflow.com/a/3827310
<p>You need to make sure that you own .git so you should never do a checkout as root or you're going to run into this problem. </p> <p><code>chmod -R ug+rw .git</code> will fix the problem this time but you have to be diligent about keeping your coworkers from doing manual <code>git pull</code>s or work on setting up ...
<p>You need to make sure that you own .git so you should never do a checkout as root or you're going to run into this problem. </p> <p><code>chmod -R ug+rw .git</code> will fix the problem this time but you have to be diligent about keeping your coworkers from doing manual <code>git pull</code>s or work on setting up ...
119, 2831
capistrano, git
<h1>capistrano deployment nightmare</h1> <p>I am getting the followoing error when I try to do a deploy via a "deploy" user account.</p> <pre><code> 1782001..ae10d1b master -&gt; master ** transaction: start * executing `deploy:update_code' updating the cached checkout on all servers executing locally: "g...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,569
git
# capistrano deployment nightmare I am getting the followoing error when I try to do a deploy via a "deploy" user account. ``` 1782001..ae10d1b master -> master ** transaction: start * executing `deploy:update_code' updating the cached checkout on all servers executing locally: "git ls-remote git@github...
You need to make sure that you own .git so you should never do a checkout as root or you're going to run into this problem. `chmod -R ug+rw .git` will fix the problem this time but you have to be diligent about keeping your coworkers from doing manual `git pull`s or work on setting up group permissions correctly.
3642143
Get a single file from a remote git repository
9
2010-09-04 11:59:41
<p>Is there a way to programmatically download a single file from a remote git repository, in Java?</p> <ol> <li>I prefer a solution which uses as little bandwidth as possible, preferably only downloading that single file. I do not need to browse the repository, I already have the file's path.</li> <li>I prefer a solu...
12,733
242,762
2010-09-04 13:21:31
3,642,451
11
2010-09-04 13:21:31
19,563
2010-09-04 13:21:31
https://stackoverflow.com/q/3642143
https://stackoverflow.com/a/3642451
<p>git isn't really designed for single file access from a remote repository but you can abuse <code>git archive</code> for this. The downside is that you have to download a "tree" rather than just the blob that you need.</p> <p>E.g.</p> <pre><code>git archive --remote=url://to.git.repo branch path/to/dir | tar -x fi...
<p>git isn't really designed for single file access from a remote repository but you can abuse <code>git archive</code> for this. The downside is that you have to download a "tree" rather than just the blob that you need.</p> <p>E.g.</p> <pre><code>git archive --remote=url://to.git.repo branch path/to/dir | tar -x fi...
17, 119, 8109, 61058
download, git, java, jgit
<h1>Get a single file from a remote git repository</h1> <p>Is there a way to programmatically download a single file from a remote git repository, in Java?</p> <ol> <li>I prefer a solution which uses as little bandwidth as possible, preferably only downloading that single file. I do not need to browse the repository, ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,570
git
# Get a single file from a remote git repository Is there a way to programmatically download a single file from a remote git repository, in Java? 1. I prefer a solution which uses as little bandwidth as possible, preferably only downloading that single file. I do not need to browse the repository, I already have the ...
git isn't really designed for single file access from a remote repository but you can abuse `git archive` for this. The downside is that you have to download a "tree" rather than just the blob that you need. E.g. ``` git archive --remote=url://to.git.repo branch path/to/dir | tar -x file ``` As an alternative, if yo...
2171015
What's the easiest way in Git to "cherry pick" uncommitted changes to an individual file?
9
2010-01-31 08:18:22
<p>If I have a bunch of uncommitted changes to a <em>single</em> file in my working directory in Git, what's the easiest way to selectively pick and choose among these changes?</p> <p>My current way is to "git diff" the file, and then manually review the diff alongside the actual file. If I want to restore bits of ol...
2,803
262,819
2010-01-31 13:57:51
2,171,050
11
2010-01-31 08:32:41
226,621
2010-01-31 08:32:41
https://stackoverflow.com/q/2171015
https://stackoverflow.com/a/2171050
<p>You can select which hunks to add in a commit by <code>git add --patch</code>. This will ask you for each hunk in a file's changes if you want to add that changeset. If a particular hunk is too big for you, you can split it even further. There is another option to <code>git-add</code>, <code>--interactive</code>,...
<p>You can select which hunks to add in a commit by <code>git add --patch</code>. This will ask you for each hunk in a file's changes if you want to add that changeset. If a particular hunk is too big for you, you can split it even further. There is another option to <code>git-add</code>, <code>--interactive</code>,...
119
git
<h1>What's the easiest way in Git to "cherry pick" uncommitted changes to an individual file?</h1> <p>If I have a bunch of uncommitted changes to a <em>single</em> file in my working directory in Git, what's the easiest way to selectively pick and choose among these changes?</p> <p>My current way is to "git diff" the ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,571
git
# What's the easiest way in Git to "cherry pick" uncommitted changes to an individual file? If I have a bunch of uncommitted changes to a *single* file in my working directory in Git, what's the easiest way to selectively pick and choose among these changes? My current way is to "git diff" the file, and then manually...
You can select which hunks to add in a commit by `git add --patch`. This will ask you for each hunk in a file's changes if you want to add that changeset. If a particular hunk is too big for you, you can split it even further. There is another option to `git-add`, `--interactive`, which lets you work with multiple file...
1930796
How do I pull a remote branch in git without conflicts?
9
2009-12-18 21:28:28
<p>There is a branch on remote I would like to work on. It is old and I no longer have an old copy of it on my local machine. It is really far behind master. Whenever I attempt to pull it I get conflicts. I just want to create an exact duplicate of the remote branch on my local system. Why would that lead to conflicts?...
11,380
66,475
2023-12-20 12:19:03
1,930,813
11
2009-12-18 21:31:47
95,382
2009-12-18 21:31:47
https://stackoverflow.com/q/1930796
https://stackoverflow.com/a/1930813
<pre><code>git fetch origin git checkout -b newoldbranch oldoldbranch </code></pre>
<pre><code>git fetch origin git checkout -b newoldbranch oldoldbranch </code></pre>
119, 4860, 28896
git, git-pull, pull
<h1>How do I pull a remote branch in git without conflicts?</h1> <p>There is a branch on remote I would like to work on. It is old and I no longer have an old copy of it on my local machine. It is really far behind master. Whenever I attempt to pull it I get conflicts. I just want to create an exact duplicate of the re...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,572
git
# How do I pull a remote branch in git without conflicts? There is a branch on remote I would like to work on. It is old and I no longer have an old copy of it on my local machine. It is really far behind master. Whenever I attempt to pull it I get conflicts. I just want to create an exact duplicate of the remote bran...
``` git fetch origin git checkout -b newoldbranch oldoldbranch ```
1635814
Automatically rewrite full git history to get rid of simple merge commits
9
2009-10-28 08:18:38
<p>Our team uses a purely merge-based git workflow, and we're discussing the possibility of just asking all team members to push all work to server one afternoon and do an evening of rebasing the server repo.</p> <p>I (think) what I would like to do automatically is that as long as all the commits are only on the same...
1,468
23,691
2016-07-18 19:38:36
1,635,991
11
2009-10-28 09:05:32
19,563
2009-10-28 09:05:32
https://stackoverflow.com/q/1635814
https://stackoverflow.com/a/1635991
<p>In my opinion you should avoid the temptation to re-write history just to make it "look nice". There really is no point. The history, as it is, is a more accurate representation of reality and git's reporting tools are all designed to be useful even with lots of little merges.</p> <p>If you're not interested in vie...
<p>In my opinion you should avoid the temptation to re-write history just to make it "look nice". There really is no point. The history, as it is, is a more accurate representation of reality and git's reporting tools are all designed to be useful even with lots of little merges.</p> <p>If you're not interested in vie...
119, 91259
git, git-rewrite-history
<h1>Automatically rewrite full git history to get rid of simple merge commits</h1> <p>Our team uses a purely merge-based git workflow, and we're discussing the possibility of just asking all team members to push all work to server one afternoon and do an evening of rebasing the server repo.</p> <p>I (think) what I wou...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,573
git
# Automatically rewrite full git history to get rid of simple merge commits Our team uses a purely merge-based git workflow, and we're discussing the possibility of just asking all team members to push all work to server one afternoon and do an evening of rebasing the server repo. I (think) what I would like to do au...
In my opinion you should avoid the temptation to re-write history just to make it "look nice". There really is no point. The history, as it is, is a more accurate representation of reality and git's reporting tools are all designed to be useful even with lots of little merges. If you're not interested in viewing a lot...
635325
Unable to recover a file in Git
9
2009-03-11 16:32:05
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="https://stackoverflow.com/questions/953481/restore-a-deleted-file-in-a-git-repo">Restore a deleted file in a Git repo</a> </p> </blockquote> <p>I have two branches in my Git, <em>master and newFeature</em>. At the branch <em>newFeature</em>, I re...
3,800
54,964
2012-03-01 10:50:01
635,971
11
2009-03-11 19:21:12
46,058
2009-03-11 19:21:12
https://stackoverflow.com/q/635325
https://stackoverflow.com/a/635971
<p>First, you need to find where you have last version of <code>fileA</code>. You can use "git log -p" or "git whatchanged" to check when it was deleted, or you can use "git ls-files &lt;<em>revision</em>&gt; -- fileA" to check if file is present in given commit, where '&lt;<em>revision</em>&gt;' can be <em>master</em>...
<p>First, you need to find where you have last version of <code>fileA</code>. You can use "git log -p" or "git whatchanged" to check when it was deleted, or you can use "git ls-files &lt;<em>revision</em>&gt; -- fileA" to check if file is present in given commit, where '&lt;<em>revision</em>&gt;' can be <em>master</em>...
119, 5610
git, rm
<h1>Unable to recover a file in Git</h1> <blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="https://stackoverflow.com/questions/953481/restore-a-deleted-file-in-a-git-repo">Restore a deleted file in a Git repo</a> </p> </blockquote> <p>I have two branches in my Git, <em>master and newFeature</em>...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,574
git
# Unable to recover a file in Git > **Possible Duplicate:** > [Restore a deleted file in a Git repo](https://stackoverflow.com/questions/953481/restore-a-deleted-file-in-a-git-repo) I have two branches in my Git, *master and newFeature*. At the branch *newFeature*, I removed the fileA physically first in terminal a...
First, you need to find where you have last version of `fileA`. You can use "git log -p" or "git whatchanged" to check when it was deleted, or you can use "git ls-files <*revision*> -- fileA" to check if file is present in given commit, where '<*revision*>' can be *master* or *newFeature^* (*newFeature^* means parent o...
65602969
Understanding the git symbols in oh my posh
8
2021-01-06 20:29:45
<p>I have the paradox theme on the terminal using oh my posh. But I can't find anywhere what these symbols mean. I tried using the command $ThemeSettings.GitSymbols but I don't get anything (I'm using the v3). Where should I be looking for?</p> <p><a href="https://i.sstatic.net/0mw62.png" rel="noreferrer"><img src="htt...
4,696
12,252,693
2021-01-07 01:41:19
65,605,558
11
2021-01-07 01:41:19
6,309
2021-01-07 01:41:19
https://stackoverflow.com/q/65602969
https://stackoverflow.com/a/65605558
<p>The prompt theming <a href="https://github.com/JanDeDobbeleer/oh-my-posh" rel="noreferrer"><code>JanDeDobbeleer/oh-my-posh</code></a> includes themes based on symbols from <a href="https://github.com/dahlbyk/posh-git" rel="noreferrer"><code>dahlbyk/posh-git</code></a></p> <pre><code> [{HEAD-name} S +A ~B -C !D | +E ...
<p>The prompt theming <a href="https://github.com/JanDeDobbeleer/oh-my-posh" rel="noreferrer"><code>JanDeDobbeleer/oh-my-posh</code></a> includes themes based on symbols from <a href="https://github.com/dahlbyk/posh-git" rel="noreferrer"><code>dahlbyk/posh-git</code></a></p> <pre><code> [{HEAD-name} S +A ~B -C !D | +E ...
119
git
<h1>Understanding the git symbols in oh my posh</h1> <p>I have the paradox theme on the terminal using oh my posh. But I can't find anywhere what these symbols mean. I tried using the command $ThemeSettings.GitSymbols but I don't get anything (I'm using the v3). Where should I be looking for?</p> <p><a href="https://i....
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,580
git
# Understanding the git symbols in oh my posh I have the paradox theme on the terminal using oh my posh. But I can't find anywhere what these symbols mean. I tried using the command $ThemeSettings.GitSymbols but I don't get anything (I'm using the v3). Where should I be looking for? [![enter image description here](h...
The prompt theming [`JanDeDobbeleer/oh-my-posh`](https://github.com/JanDeDobbeleer/oh-my-posh) includes themes based on symbols from [`dahlbyk/posh-git`](https://github.com/dahlbyk/posh-git) ``` [{HEAD-name} S +A ~B -C !D | +E ~F -G !H W] ``` With: > - `≡` = The local branch in at the same commit level as the remot...
59891242
What is the difference between GitVersion.Tool and GitVersionTask
8
2020-01-24 06:14:27
<p>I see that there are two nuget packages <a href="https://www.nuget.org/packages/GitVersion.Tool/" rel="noreferrer">GitVersion.Tool</a> and <a href="https://www.nuget.org/packages/GitVersionTask/" rel="noreferrer">GitVersionTask</a></p> <p>What is the difference between the two and what to use when.</p> <p>I also s...
7,267
1,977,871
2020-01-25 10:14:52
59,891,929
11
2020-01-24 07:13:30
671,491
2020-01-25 10:14:52
https://stackoverflow.com/q/59891242
https://stackoverflow.com/a/59891929
<p>I believe I am right in saying that the <a href="https://www.nuget.org/packages/GitVersion/" rel="noreferrer">GitVersion</a> package can be ignored. This is no longer used, or recommended.</p> <p><a href="https://www.nuget.org/packages/GitVersion.Tool/" rel="noreferrer">GitVersion.Tool</a> is a .Net Global Tool ve...
<p>I believe I am right in saying that the <a href="https://www.nuget.org/packages/GitVersion/" rel="noreferrer">GitVersion</a> package can be ignored. This is no longer used, or recommended.</p> <p><a href="https://www.nuget.org/packages/GitVersion.Tool/" rel="noreferrer">GitVersion.Tool</a> is a .Net Global Tool ve...
110771
gitversion
<h1>What is the difference between GitVersion.Tool and GitVersionTask</h1> <p>I see that there are two nuget packages <a href="https://www.nuget.org/packages/GitVersion.Tool/" rel="noreferrer">GitVersion.Tool</a> and <a href="https://www.nuget.org/packages/GitVersionTask/" rel="noreferrer">GitVersionTask</a></p> <p>Wh...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,582
git
# What is the difference between GitVersion.Tool and GitVersionTask I see that there are two nuget packages [GitVersion.Tool](https://www.nuget.org/packages/GitVersion.Tool/) and [GitVersionTask](https://www.nuget.org/packages/GitVersionTask/) What is the difference between the two and what to use when. I also see t...
I believe I am right in saying that the [GitVersion](https://www.nuget.org/packages/GitVersion/) package can be ignored. This is no longer used, or recommended. [GitVersion.Tool](https://www.nuget.org/packages/GitVersion.Tool/) is a .Net Global Tool version of GitVersion. You can install this using globally on your ma...
59434963
Existing Git repository with files in mixed encodings
8
2019-12-21 09:14:52
<p>I have an existing repository with files in mixed encodings - some files are in UTF-8 and some are in ANSI (e.g. Windows-1252). Mostly everything works fine, except that I am getting tired of seeing "invalid characters" when performing a diff on the ANSI files, and I am particularly annoyed that I can't use my GUI t...
6,916
6,755,416
2023-04-02 18:09:25
59,437,328
11
2019-12-21 15:13:48
8,705,432
2019-12-21 15:13:48
https://stackoverflow.com/q/59434963
https://stackoverflow.com/a/59437328
<p>You're on the right track by using the <code>working-tree-encoding</code>, but there's one more step you need.</p> <p>In the same commit where you create the <code>.gitattributes</code> file, run <code>git add --renormalize .</code>, which will take all the working tree files and filter them according to the specif...
<p>You're on the right track by using the <code>working-tree-encoding</code>, but there's one more step you need.</p> <p>In the same commit where you create the <code>.gitattributes</code> file, run <code>git add --renormalize .</code>, which will take all the working tree files and filter them according to the specif...
119, 1124, 7330, 8944, 21479
encoding, git, repository, utf-8, windows-1252
<h1>Existing Git repository with files in mixed encodings</h1> <p>I have an existing repository with files in mixed encodings - some files are in UTF-8 and some are in ANSI (e.g. Windows-1252). Mostly everything works fine, except that I am getting tired of seeing "invalid characters" when performing a diff on the ANSI...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,583
git
# Existing Git repository with files in mixed encodings I have an existing repository with files in mixed encodings - some files are in UTF-8 and some are in ANSI (e.g. Windows-1252). Mostly everything works fine, except that I am getting tired of seeing "invalid characters" when performing a diff on the ANSI files, a...
You're on the right track by using the `working-tree-encoding`, but there's one more step you need. In the same commit where you create the `.gitattributes` file, run `git add --renormalize .`, which will take all the working tree files and filter them according to the specified encoding. Then you'll want to commit al...
58082701
Cleaning up the branch history in Git
8
2019-09-24 14:34:23
<p>I'm working on a feature branch for days. During this time I did so many mistakes and committed so many unnecessary code changes, which I had to revert in the next commit. </p> <p>Finally, I found the best solution and now I'm ready to create a Pull-Request. However, I don't want that every one can see how many stu...
13,088
1,941,537
2019-09-24 15:14:55
58,082,749
11
2019-09-24 14:37:10
3,390,419
2019-09-24 15:14:55
https://stackoverflow.com/q/58082701
https://stackoverflow.com/a/58082749
<p>You can run an interactive git rebase:</p> <pre><code>git rebase -i HEAD~N </code></pre> <p>where N is the number of last commits in your history which you wish to take an action on (e.g modify the commit message, delete the commit, etc.).</p> <p>This command allows you to choose from a series of actions to apply...
<p>You can run an interactive git rebase:</p> <pre><code>git rebase -i HEAD~N </code></pre> <p>where N is the number of last commits in your history which you wish to take an action on (e.g modify the commit message, delete the commit, etc.).</p> <p>This command allows you to choose from a series of actions to apply...
119
git
<h1>Cleaning up the branch history in Git</h1> <p>I'm working on a feature branch for days. During this time I did so many mistakes and committed so many unnecessary code changes, which I had to revert in the next commit. </p> <p>Finally, I found the best solution and now I'm ready to create a Pull-Request. However, I...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,584
git
# Cleaning up the branch history in Git I'm working on a feature branch for days. During this time I did so many mistakes and committed so many unnecessary code changes, which I had to revert in the next commit. Finally, I found the best solution and now I'm ready to create a Pull-Request. However, I don't want that ...
You can run an interactive git rebase: ``` git rebase -i HEAD~N ``` where N is the number of last commits in your history which you wish to take an action on (e.g modify the commit message, delete the commit, etc.). This command allows you to choose from a series of actions to apply to each commit (up to the Nth com...
52686670
git reset --soft HEAD^ for initial commit
8
2018-10-07 08:16:24
<p>Could someone please tell me what would be an equivalent of <code>git reset --soft HEAD^</code> for an initial commit? I'm trying to find a really safe one-liner without any deletions :)</p> <p>To further clarify: I want all the files I tediously added to be in the index and ready for committing after the command i...
6,205
932,256
2018-10-07 09:49:26
52,686,712
11
2018-10-07 08:22:38
138,290
2018-10-07 08:43:55
https://stackoverflow.com/q/52686670
https://stackoverflow.com/a/52686712
<p>As you found, for the initial commit using <code>git reset --soft HEAD^</code> doesn't work.</p> <p>What does work is using <code>git update-ref -d HEAD</code>.</p> <p>But provided that there is only one branch and one commit, it's can be easier to just delete the <code>.git</code> directory and start over. Of cou...
<p>As you found, for the initial commit using <code>git reset --soft HEAD^</code> doesn't work.</p> <p>What does work is using <code>git update-ref -d HEAD</code>.</p> <p>But provided that there is only one branch and one commit, it's can be easier to just delete the <code>.git</code> directory and start over. Of cou...
119
git
<h1>git reset --soft HEAD^ for initial commit</h1> <p>Could someone please tell me what would be an equivalent of <code>git reset --soft HEAD^</code> for an initial commit? I'm trying to find a really safe one-liner without any deletions :)</p> <p>To further clarify: I want all the files I tediously added to be in the...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,586
git
# git reset --soft HEAD^ for initial commit Could someone please tell me what would be an equivalent of `git reset --soft HEAD^` for an initial commit? I'm trying to find a really safe one-liner without any deletions :) To further clarify: I want all the files I tediously added to be in the index and ready for commit...
As you found, for the initial commit using `git reset --soft HEAD^` doesn't work. What does work is using `git update-ref -d HEAD`. But provided that there is only one branch and one commit, it's can be easier to just delete the `.git` directory and start over. Of course, you should only do that if you know what you ...
48900936
Postgresql rounding to significant figures
8
2018-02-21 08:13:46
<p>i've tried this significant figures query from this blog (<a href="https://www.garysieling.com/blog/postgres-significant-figures-pg_size_pretty" rel="noreferrer">https://www.garysieling.com/blog/postgres-significant-figures-pg_size_pretty</a>).</p> <p>But it seems have fixed decimal digit on it.</p> <pre><code>SEL...
3,656
8,091,329
2023-01-05 12:32:50
51,709,848
11
2018-08-06 14:23:15
114,926
2023-01-05 12:32:50
https://stackoverflow.com/q/48900936
https://stackoverflow.com/a/51709848
<p>You can use the following function to round to a number of significant digits:</p> <pre><code>CREATE OR REPLACE FUNCTION sig_digits(n anyelement, digits int) RETURNS numeric AS $$ SELECT CASE WHEN n=0 THEN 0 ELSE round(n, digits - 1 - floor(log(abs(n)))::int) END $$ LANGUAGE sql IMMUTABLE ST...
<p>You can use the following function to round to a number of significant digits:</p> <pre><code>CREATE OR REPLACE FUNCTION sig_digits(n anyelement, digits int) RETURNS numeric AS $$ SELECT CASE WHEN n=0 THEN 0 ELSE round(n, digits - 1 - floor(log(abs(n)))::int) END $$ LANGUAGE sql IMMUTABLE ST...
256, 259, 12414, 121620
math, postgresql, postgresql-9.6, significant-digits
<h1>Postgresql rounding to significant figures</h1> <p>i've tried this significant figures query from this blog (<a href="https://www.garysieling.com/blog/postgres-significant-figures-pg_size_pretty" rel="noreferrer">https://www.garysieling.com/blog/postgres-significant-figures-pg_size_pretty</a>).</p> <p>But it seems...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,587
git
# Postgresql rounding to significant figures i've tried this significant figures query from this blog (<https://www.garysieling.com/blog/postgres-significant-figures-pg_size_pretty>). But it seems have fixed decimal digit on it. ``` SELECT FLOOR(5.4321/(10 ^ FLOOR(log(5.4321)-1))) * (10 ^ FLOOR(log(5.4321)-1)) ``` ...
You can use the following function to round to a number of significant digits: ``` CREATE OR REPLACE FUNCTION sig_digits(n anyelement, digits int) RETURNS numeric AS $$ SELECT CASE WHEN n=0 THEN 0 ELSE round(n, digits - 1 - floor(log(abs(n)))::int) END $$ LANGUAGE sql IMMUTABLE STRICT; ``` Co...
51571769
GIT status missing in Visual Studio Code explorer
8
2018-07-28 13:14:26
<p>I can clearly the GIT status of files on my current dev machine (Win10).</p> <p><a href="https://i.sstatic.net/Ls85J.png" rel="noreferrer"><img src="https://i.sstatic.net/Ls85J.png" alt="current dev workstation"></a></p> <p>I needed to help update the dev tools on a laptop (Win8.1). VSCode and GIT versions are ide...
6,034
6,032,920
2021-01-28 17:44:59
51,571,846
11
2018-07-28 13:27:05
6,925,187
2018-07-28 13:27:05
https://stackoverflow.com/q/51571769
https://stackoverflow.com/a/51571846
<p>Ensure the following setting is set to <code>true</code>:</p> <pre class="lang-json prettyprint-override"><code>"git.decorations.enabled": true </code></pre> <p>And then reload the window by pressing <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>P</kbd> and insert <em>reload window</em>, then press <kbd>Enter</kbd>....
<p>Ensure the following setting is set to <code>true</code>:</p> <pre class="lang-json prettyprint-override"><code>"git.decorations.enabled": true </code></pre> <p>And then reload the window by pressing <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>P</kbd> and insert <em>reload window</em>, then press <kbd>Enter</kbd>....
119, 111608
git, visual-studio-code
<h1>GIT status missing in Visual Studio Code explorer</h1> <p>I can clearly the GIT status of files on my current dev machine (Win10).</p> <p><a href="https://i.sstatic.net/Ls85J.png" rel="noreferrer"><img src="https://i.sstatic.net/Ls85J.png" alt="current dev workstation"></a></p> <p>I needed to help update the dev ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,588
git
# GIT status missing in Visual Studio Code explorer I can clearly the GIT status of files on my current dev machine (Win10). [![current dev workstation](https://i.sstatic.net/Ls85J.png)](https://i.sstatic.net/Ls85J.png) I needed to help update the dev tools on a laptop (Win8.1). VSCode and GIT versions are identical...
Ensure the following setting is set to `true`: ``` "git.decorations.enabled": true ``` And then reload the window by pressing `Ctrl` + `Shift` + `P` and insert *reload window*, then press `Enter`. If this does not work you can check whether an extension overwrites this setting.
50375477
Can you turn a local network directory into a remote git repository?
8
2018-05-16 16:06:14
<p>I have a shared directory on a local network that is used for file storage and file sharing purposes. Is it possible to turn such a directory into a remote git repository so that I can push to it from a local git repository?</p>
10,851
7,019,483
2021-04-05 20:26:06
50,382,253
11
2018-05-17 01:55:03
6,936,103
2018-05-17 01:55:03
https://stackoverflow.com/q/50375477
https://stackoverflow.com/a/50382253
<p>Yes, it’s possible.</p> <p>You can treat the shared directory as the local copy for the remote repo. Then you can push changes from the local repo to remote repo. Detail steps as below:</p> <h3>1. Create remote repo</h3> <p>You can setup remote repo on your own server by <code>git init --bare</code>.</p> <p>An...
<p>Yes, it’s possible.</p> <p>You can treat the shared directory as the local copy for the remote repo. Then you can push changes from the local repo to remote repo. Detail steps as below:</p> <h3>1. Create remote repo</h3> <p>You can setup remote repo on your own server by <code>git init --bare</code>.</p> <p>An...
119, 456
git, version-control
<h1>Can you turn a local network directory into a remote git repository?</h1> <p>I have a shared directory on a local network that is used for file storage and file sharing purposes. Is it possible to turn such a directory into a remote git repository so that I can push to it from a local git repository?</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,589
git
# Can you turn a local network directory into a remote git repository? I have a shared directory on a local network that is used for file storage and file sharing purposes. Is it possible to turn such a directory into a remote git repository so that I can push to it from a local git repository?
Yes, it’s possible. You can treat the shared directory as the local copy for the remote repo. Then you can push changes from the local repo to remote repo. Detail steps as below: ### 1. Create remote repo You can setup remote repo on your own server by `git init --bare`. And if the local machine can access to githu...
50206886
Grep all commits in a repository
8
2018-05-07 03:56:01
<p>I have a Git repository of a rather large software project. I'd like to search every single commit message for a certain substring. I'm not looking for just the commits on the current branch, but every single commit that the repository is aware of.</p> <p>The results do not have to be in any particular order (though...
1,359
9,100,341
2023-10-22 23:15:32
50,207,182
11
2018-05-07 04:39:28
4,487,833
2023-10-22 23:15:32
https://stackoverflow.com/q/50206886
https://stackoverflow.com/a/50207182
<p>To search the commit log (across all branches) for the given text:</p> <pre><code>git log --all --grep='Build 0051' </code></pre> <p>To search the actual content of commits through a repository's history, use:</p> <pre><code>git grep 'Build 0051' $(git rev-list --all) </code></pre> <p>to show all instances of the gi...
<p>To search the commit log (across all branches) for the given text:</p> <pre><code>git log --all --grep='Build 0051' </code></pre> <p>To search the actual content of commits through a repository's history, use:</p> <pre><code>git grep 'Build 0051' $(git rev-list --all) </code></pre> <p>to show all instances of the gi...
119
git
<h1>Grep all commits in a repository</h1> <p>I have a Git repository of a rather large software project. I'd like to search every single commit message for a certain substring. I'm not looking for just the commits on the current branch, but every single commit that the repository is aware of.</p> <p>The results do not ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,590
git
# Grep all commits in a repository I have a Git repository of a rather large software project. I'd like to search every single commit message for a certain substring. I'm not looking for just the commits on the current branch, but every single commit that the repository is aware of. The results do not have to be in a...
To search the commit log (across all branches) for the given text: ``` git log --all --grep='Build 0051' ``` To search the actual content of commits through a repository's history, use: ``` git grep 'Build 0051' $(git rev-list --all) ``` to show all instances of the given text, the containing file name, and the com...
48371418
How to create a git repository backup with bundle where there is no linkage after cloning
8
2018-01-21 20:30:52
<p>Is there a way to create a backup using <code>git bundle</code> where there is no linkage to the bundle file after cloning from the backup? I'd like to backup my repositories to a single file with all history and restore them, exactly, later.</p> <p>At the moment, I'm creating a backup using the following methodolo...
1,627
1,932,452
2018-01-22 22:26:34
48,391,271
11
2018-01-22 22:26:34
9,067,523
2018-01-22 22:26:34
https://stackoverflow.com/q/48371418
https://stackoverflow.com/a/48391271
<p>Instead of cloning from the bundle, create a new repository and fetch using a wildcard refspec. I have added a second branch <code>feature</code> and a tag <code>v1.0</code> to the example to make this more illustrative:</p> <pre><code>$ mkdir there $ git init . $ git fetch --update-head-ok ../here/myrepo.bundle '*...
<p>Instead of cloning from the bundle, create a new repository and fetch using a wildcard refspec. I have added a second branch <code>feature</code> and a tag <code>v1.0</code> to the example to make this more illustrative:</p> <pre><code>$ mkdir there $ git init . $ git fetch --update-head-ok ../here/myrepo.bundle '*...
119
git
<h1>How to create a git repository backup with bundle where there is no linkage after cloning</h1> <p>Is there a way to create a backup using <code>git bundle</code> where there is no linkage to the bundle file after cloning from the backup? I'd like to backup my repositories to a single file with all history and resto...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,591
git
# How to create a git repository backup with bundle where there is no linkage after cloning Is there a way to create a backup using `git bundle` where there is no linkage to the bundle file after cloning from the backup? I'd like to backup my repositories to a single file with all history and restore them, exactly, la...
Instead of cloning from the bundle, create a new repository and fetch using a wildcard refspec. I have added a second branch `feature` and a tag `v1.0` to the example to make this more illustrative: ``` $ mkdir there $ git init . $ git fetch --update-head-ok ../here/myrepo.bundle '*:*' Receiving objects: 100% (5/5), d...
48076989
is it possible to git stash pop with dry run?
8
2018-01-03 12:01:41
<p>Does git stash pop blindly overwrites the local changes or merges them with the local changes?</p> <p>If it merges, there could be merge conflicts. Is there any way to know in advance, that there would be merge conflicts or not by using --dry-run or some other method?</p> <p>I could find --dry-run with git fetch a...
3,910
1,534,898
2023-02-14 18:36:56
48,077,075
11
2018-01-03 12:06:55
1,988,508
2023-02-14 18:36:56
https://stackoverflow.com/q/48076989
https://stackoverflow.com/a/48077075
<blockquote> <p>is it possible to git stash pop with dry run?</p> </blockquote> <p>I am not sure about dry run, but you may <code>apply</code> the stash instead of <code>pop</code>ing it (to keep a copy of the stash, in case the changes do not fit, and you want to apply them later again):</p> <pre><code>git stash apply...
<blockquote> <p>is it possible to git stash pop with dry run?</p> </blockquote> <p>I am not sure about dry run, but you may <code>apply</code> the stash instead of <code>pop</code>ing it (to keep a copy of the stash, in case the changes do not fit, and you want to apply them later again):</p> <pre><code>git stash apply...
119
git
<h1>is it possible to git stash pop with dry run?</h1> <p>Does git stash pop blindly overwrites the local changes or merges them with the local changes?</p> <p>If it merges, there could be merge conflicts. Is there any way to know in advance, that there would be merge conflicts or not by using --dry-run or some other ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,592
git
# is it possible to git stash pop with dry run? Does git stash pop blindly overwrites the local changes or merges them with the local changes? If it merges, there could be merge conflicts. Is there any way to know in advance, that there would be merge conflicts or not by using --dry-run or some other method? I could...
> is it possible to git stash pop with dry run? I am not sure about dry run, but you may `apply` the stash instead of `pop`ing it (to keep a copy of the stash, in case the changes do not fit, and you want to apply them later again): ``` git stash apply ``` Then watch the results, if you do not like them, just `check...
47470271
What does "--remote" actually do in "git submodule update --remote"?
8
2017-11-24 09:36:40
<p>I just do not understand the help page of Git. So what does happen or what is the difference?</p> <p>Assume I have a Git project A with a submodule B. Submodule B does have a submodule C. After cloning the repository A points to a specific commit of B. And B points to a specific commit of C.</p> <p>If I am inside ...
4,315
4,717,188
2022-05-02 06:15:39
47,470,934
11
2017-11-24 10:11:49
6,330,106
2017-11-24 10:11:49
https://stackoverflow.com/q/47470271
https://stackoverflow.com/a/47470934
<p>Suppose B is the only submodule of A.</p> <pre><code>cd A git ls-tree -r HEAD | grep commit </code></pre> <p>The output is something like </p> <p><code>160000 commit 0814c6ba8f45829f04709c56118868d2483444c2 foo</code></p> <p><code>foo</code> is the submodule folder and <code>0814c6ba8f45829f04709c56118868d248344...
<p>Suppose B is the only submodule of A.</p> <pre><code>cd A git ls-tree -r HEAD | grep commit </code></pre> <p>The output is something like </p> <p><code>160000 commit 0814c6ba8f45829f04709c56118868d2483444c2 foo</code></p> <p><code>foo</code> is the submodule folder and <code>0814c6ba8f45829f04709c56118868d248344...
119, 41612
git, git-submodules
<h1>What does "--remote" actually do in "git submodule update --remote"?</h1> <p>I just do not understand the help page of Git. So what does happen or what is the difference?</p> <p>Assume I have a Git project A with a submodule B. Submodule B does have a submodule C. After cloning the repository A points to a specifi...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,593
git
# What does "--remote" actually do in "git submodule update --remote"? I just do not understand the help page of Git. So what does happen or what is the difference? Assume I have a Git project A with a submodule B. Submodule B does have a submodule C. After cloning the repository A points to a specific commit of B. A...
Suppose B is the only submodule of A. ``` cd A git ls-tree -r HEAD | grep commit ``` The output is something like `160000 commit 0814c6ba8f45829f04709c56118868d2483444c2 foo` `foo` is the submodule folder and `0814c6ba8f45829f04709c56118868d2483444c2` is its revision tracked by A's current commit. `git submodule u...
47177246
Floor and ceiling with 2 or more significant digits
8
2017-11-08 10:28:13
<p>It is possible to round results into two significant digits using <code>signif</code>:</p> <pre><code>&gt; signif(12500,2) [1] 12000 &gt; signif(12501,2) [1] 13000 </code></pre> <p>But are there an equally handy functions, like the <em>fictitious</em> functions below <code>signif.floor</code> and <code>signif.ceil...
3,547
3,874,475
2017-11-08 12:30:49
47,178,649
11
2017-11-08 11:32:50
1,376,652
2017-11-08 12:30:49
https://stackoverflow.com/q/47177246
https://stackoverflow.com/a/47178649
<p>I think this approach is proper for all types of numbers (i.e. integers, negative, decimal).</p> <p>The floor function </p> <pre><code>signif.floor &lt;- function(x, n){ pow &lt;- floor( log10( abs(x) ) ) + 1 - n y &lt;- floor(x / 10 ^ pow) * 10^pow # handle the x = 0 case y[x==0] &lt;- 0 y } </code></pr...
<p>I think this approach is proper for all types of numbers (i.e. integers, negative, decimal).</p> <p>The floor function </p> <pre><code>signif.floor &lt;- function(x, n){ pow &lt;- floor( log10( abs(x) ) ) + 1 - n y &lt;- floor(x / 10 ^ pow) * 10^pow # handle the x = 0 case y[x==0] &lt;- 0 y } </code></pr...
4452, 12414
r, significant-digits
<h1>Floor and ceiling with 2 or more significant digits</h1> <p>It is possible to round results into two significant digits using <code>signif</code>:</p> <pre><code>&gt; signif(12500,2) [1] 12000 &gt; signif(12501,2) [1] 13000 </code></pre> <p>But are there an equally handy functions, like the <em>fictitious</em> fu...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,595
git
# Floor and ceiling with 2 or more significant digits It is possible to round results into two significant digits using `signif`: ``` > signif(12500,2) [1] 12000 > signif(12501,2) [1] 13000 ``` But are there an equally handy functions, like the *fictitious* functions below `signif.floor` and `signif.ceiling`, so tha...
I think this approach is proper for all types of numbers (i.e. integers, negative, decimal). The floor function ``` signif.floor <- function(x, n){ pow <- floor( log10( abs(x) ) ) + 1 - n y <- floor(x / 10 ^ pow) * 10^pow # handle the x = 0 case y[x==0] <- 0 y } ``` The ceiling function ``` signif.ceiling...
37198784
Can I push a commit made in detached HEAD state
8
2016-05-12 22:59:39
<p>Using git I would like to go into detached HEAD state and create a new commit. I'd then like to create a tag and push both the 'detached commit' and the tag to the remote repo. Is this possible?</p> <p>If I create the detached commit in my local repo and create a tag then I can checkout the tag to get back to that ...
6,607
3,294,248
2016-05-13 13:23:08
37,198,851
11
2016-05-12 23:07:16
1,256,452
2016-05-12 23:14:23
https://stackoverflow.com/q/37198784
https://stackoverflow.com/a/37198851
<p>Yes, this—by "this" I mean the main question, "can you push a tagged but not branch-contained commit?"—is perfectly fine. Note that <code>git push</code> works by calling up some other Git (e.g., ssh://... or https://... call up the other Git over the Internet-phone), delivering some commit(s) if necessary, and the...
<p>Yes, this—by "this" I mean the main question, "can you push a tagged but not branch-contained commit?"—is perfectly fine. Note that <code>git push</code> works by calling up some other Git (e.g., ssh://... or https://... call up the other Git over the Internet-phone), delivering some commit(s) if necessary, and the...
119, 28898, 76220, 98582
git, git-branch, git-detached-head, git-push
<h1>Can I push a commit made in detached HEAD state</h1> <p>Using git I would like to go into detached HEAD state and create a new commit. I'd then like to create a tag and push both the 'detached commit' and the tag to the remote repo. Is this possible?</p> <p>If I create the detached commit in my local repo and crea...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,600
git
# Can I push a commit made in detached HEAD state Using git I would like to go into detached HEAD state and create a new commit. I'd then like to create a tag and push both the 'detached commit' and the tag to the remote repo. Is this possible? If I create the detached commit in my local repo and create a tag then I ...
Yes, this—by "this" I mean the main question, "can you push a tagged but not branch-contained commit?"—is perfectly fine. Note that `git push` works by calling up some other Git (e.g., ssh://... or https://... call up the other Git over the Internet-phone), delivering some commit(s) if necessary, and then asking that o...
37063238
Why does git rebase delete a file added in the most recent commit if it was deleted by the rebase branch?
8
2016-05-06 02:23:55
<p>I'm trying to figure out why git rebase causes a newly created file to be deleted if the branch I'm rebasing off of deleted it. For example:</p> <pre><code>A1 - A2 - A3 \ B1 A2 = add a new file test.txt A3 = delete test.txt B1 = add the exact same file as A2 </code></pre> <p>If B1 is checked out and I execute ...
12,327
2,284,725
2024-07-10 12:39:43
37,064,182
11
2016-05-06 04:20:35
1,256,452
2016-05-06 04:44:45
https://stackoverflow.com/q/37063238
https://stackoverflow.com/a/37064182
<p>Wow, this was a tough one! :-)</p> <p>Using your script, I reproduced the problem. There was something very odd about it all though, so first, I trimmed out the rebase step, leaving this (slightly modified) script:</p> <pre><code>#!/bin/sh set -e if [ -d testing_git ]; then echo test dir testing_git already e...
<p>Wow, this was a tough one! :-)</p> <p>Using your script, I reproduced the problem. There was something very odd about it all though, so first, I trimmed out the rebase step, leaving this (slightly modified) script:</p> <pre><code>#!/bin/sh set -e if [ -d testing_git ]; then echo test dir testing_git already e...
119, 8974, 29934
git, git-rebase, rebase
<h1>Why does git rebase delete a file added in the most recent commit if it was deleted by the rebase branch?</h1> <p>I'm trying to figure out why git rebase causes a newly created file to be deleted if the branch I'm rebasing off of deleted it. For example:</p> <pre><code>A1 - A2 - A3 \ B1 A2 = add a new file tes...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,601
git
# Why does git rebase delete a file added in the most recent commit if it was deleted by the rebase branch? I'm trying to figure out why git rebase causes a newly created file to be deleted if the branch I'm rebasing off of deleted it. For example: ``` A1 - A2 - A3 \ B1 A2 = add a new file test.txt A3 = delete te...
Wow, this was a tough one! :-) Using your script, I reproduced the problem. There was something very odd about it all though, so first, I trimmed out the rebase step, leaving this (slightly modified) script: ``` #!/bin/sh set -e if [ -d testing_git ]; then echo test dir testing_git already exists - halting ex...
35837364
Get Git commit hash from commit message
8
2016-03-07 06:18:46
<p>Is it possible to get the hash of a commit from a commit message?</p> <p>I ran the following <code>git log | grep tap</code> and got a list of commit messages only, no hashes. </p> <p>I need to cherry-pick a few of the listed commits, but don't want to manually search for them all to find the commit hashes.</p>
4,359
356,387
2016-03-07 09:21:27
35,840,049
11
2016-03-07 09:21:27
1,755,598
2016-03-07 09:21:27
https://stackoverflow.com/q/35837364
https://stackoverflow.com/a/35840049
<p>Yep you can.</p> <p>You have minor mistake in your command:<br /> The correct command is to use the <code>--grep</code> as flag to the log and not as a unix command after the pipe <code>|</code></p> <pre><code>git log --grep=&quot;.. any text you need to find ...&quot; </code></pre> <p><a href="https://i.sstatic.net...
<p>Yep you can.</p> <p>You have minor mistake in your command:<br /> The correct command is to use the <code>--grep</code> as flag to the log and not as a unix command after the pipe <code>|</code></p> <pre><code>git log --grep=&quot;.. any text you need to find ...&quot; </code></pre> <p><a href="https://i.sstatic.net...
119
git
<h1>Get Git commit hash from commit message</h1> <p>Is it possible to get the hash of a commit from a commit message?</p> <p>I ran the following <code>git log | grep tap</code> and got a list of commit messages only, no hashes. </p> <p>I need to cherry-pick a few of the listed commits, but don't want to manually sear...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,602
git
# Get Git commit hash from commit message Is it possible to get the hash of a commit from a commit message? I ran the following `git log | grep tap` and got a list of commit messages only, no hashes. I need to cherry-pick a few of the listed commits, but don't want to manually search for them all to find the commit ...
Yep you can. You have minor mistake in your command: The correct command is to use the `--grep` as flag to the log and not as a unix command after the pipe `|` ``` git log --grep=".. any text you need to find ..." ``` [![enter image description here](https://i.sstatic.net/GTdB3.png)](https://i.sstatic.net/GTdB3.pn...