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
32649628
How can I add my pre-commit hook to an existing git repository
26
2015-09-18 10:21:19
<p>I have a pre-commit hook and I want to add it to the repository so that by checking it out my colleagues have it instantly in place.<br> However if I try to add it ( being in the root directory of my project) I get the following result:</p> <pre><code>$ git add .git/hooks/pre-commit error: Invalid path '.git/hooks...
28,648
2,055,097
2021-11-29 00:16:58
32,649,801
11
2015-09-18 10:31:02
6,309
2019-04-21 20:03:22
https://stackoverflow.com/q/32649628
https://stackoverflow.com/a/32649801
<blockquote> <p>checking it out my colleagues have it instantly in place</p> </blockquote> <p><strong>Sept. 2015</strong>: That is not possible: a hook can be put in source control (you simply copy the script in your git repo), but it cannot be "automatically in place" (active) on clone/checkout: that would be way t...
<blockquote> <p>checking it out my colleagues have it instantly in place</p> </blockquote> <p><strong>Sept. 2015</strong>: That is not possible: a hook can be put in source control (you simply copy the script in your git repo), but it cannot be "automatically in place" (active) on clone/checkout: that would be way t...
119, 43087
git, githooks
<h1>How can I add my pre-commit hook to an existing git repository</h1> <p>I have a pre-commit hook and I want to add it to the repository so that by checking it out my colleagues have it instantly in place.<br> However if I try to add it ( being in the root directory of my project) I get the following result:</p> <pr...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,316
git
# How can I add my pre-commit hook to an existing git repository I have a pre-commit hook and I want to add it to the repository so that by checking it out my colleagues have it instantly in place. However if I try to add it ( being in the root directory of my project) I get the following result: ``` $ git add .gi...
> checking it out my colleagues have it instantly in place **Sept. 2015**: That is not possible: a hook can be put in source control (you simply copy the script in your git repo), but it cannot be "automatically in place" (active) on clone/checkout: that would be way too dangerous, depending on what the hook is actual...
42583073
How to re-merge an already merged branch?
25
2017-03-03 15:46:11
<p>I have a commit graph that looks something like the one below. Commits marked with <code>*</code> represent lots of commits.</p> <pre><code> A* | B--------- | | C* D* &lt;- old feature branch | | E--------- | F* | G &lt;- master </code></pre> <p>The merge...
43,264
7,654,205
2021-07-16 15:53:46
42,584,170
11
2017-03-03 16:40:10
5,227,053
2017-03-06 17:28:28
https://stackoverflow.com/q/42583073
https://stackoverflow.com/a/42584170
<blockquote> <p>Ideally, we would take all the changes in C*, apply them to master and resolve all conflicts.</p> </blockquote> <p>No, ideally you would rewind time, do the merge as it was back then (but correctly, this time), then reapply the <code>F*</code> changes and end up with a correct <code>master</code>.</p...
<blockquote> <p>Ideally, we would take all the changes in C*, apply them to master and resolve all conflicts.</p> </blockquote> <p>No, ideally you would rewind time, do the merge as it was back then (but correctly, this time), then reapply the <code>F*</code> changes and end up with a correct <code>master</code>.</p...
119, 717
git, merge
<h1>How to re-merge an already merged branch?</h1> <p>I have a commit graph that looks something like the one below. Commits marked with <code>*</code> represent lots of commits.</p> <pre><code> A* | B--------- | | C* D* &lt;- old feature branch | | E--------- | F* |...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,317
git
# How to re-merge an already merged branch? I have a commit graph that looks something like the one below. Commits marked with `*` represent lots of commits. ``` A* | B--------- | | C* D* <- old feature branch | | E--------- | F* | G <- master ``` The merg...
> Ideally, we would take all the changes in C*, apply them to master and resolve all conflicts. No, ideally you would rewind time, do the merge as it was back then (but correctly, this time), then reapply the `F*` changes and end up with a correct `master`. You can do it like this: ``` git checkout missing-commits g...
40617288
A commit in Git: Is it a snapshot/state/image or is it a change/diff/patch/delta?
25
2016-11-15 18:37:02
<ul> <li>Some operations in Git (e.g. <code>checkout</code>) appear to assume that a commit is a snapshot or state of the working tree.</li> <li>Other operations in Git (e.g. <code>rebase</code>) appear to assume that a commit is a change: a kind of operator that can be applied to working trees.</li> </ul> <p>When lear...
6,226
2,810,305
2025-04-12 12:28:51
40,617,289
11
2016-11-15 18:37:02
2,810,305
2025-04-12 12:28:51
https://stackoverflow.com/q/40617288
https://stackoverflow.com/a/40617289
<h1>It depends!</h1> <p><em>Short answer:</em> <strong>both</strong>.</p> <p><em>Medium answer:</em> <strong>It depends.</strong></p> <p><em>Long answer:</em> Git is a bit like with particles vs. waves in quantum phenomena: Neither of the two views alone can explain all observations. Read on.</p> <p><strong>Internally<...
<h1>It depends!</h1> <p><em>Short answer:</em> <strong>both</strong>.</p> <p><em>Medium answer:</em> <strong>It depends.</strong></p> <p><em>Long answer:</em> Git is a bit like with particles vs. waves in quantum phenomena: Neither of the two views alone can explain all observations. Read on.</p> <p><strong>Internally<...
119
git
<h1>A commit in Git: Is it a snapshot/state/image or is it a change/diff/patch/delta?</h1> <ul> <li>Some operations in Git (e.g. <code>checkout</code>) appear to assume that a commit is a snapshot or state of the working tree.</li> <li>Other operations in Git (e.g. <code>rebase</code>) appear to assume that a commit is...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,318
git
# A commit in Git: Is it a snapshot/state/image or is it a change/diff/patch/delta? - Some operations in Git (e.g. `checkout`) appear to assume that a commit is a snapshot or state of the working tree. - Other operations in Git (e.g. `rebase`) appear to assume that a commit is a change: a kind of operator that can be ...
# It depends! *Short answer:* **both**. *Medium answer:* **It depends.** *Long answer:* Git is a bit like with particles vs. waves in quantum phenomena: Neither of the two views alone can explain all observations. Read on. **Internally**, Git will use both representations, depending (conceptually) on which one it d...
51001919
How to solve git error: Server does not allow request for unadvertised object 3a2ceef391af73994dfeb0d8ef57ed6a52ef4238?
24
2018-06-23 14:03:28
<p>I wanted to pull commit "3a2ceef391af73994dfeb0d8ef57ed6a52ef4238" from branch android. I used the command:</p> <pre><code>$ git fetch origin 3a2ceef391af73994dfeb0d8ef57ed6a52ef4238 </code></pre> <p>and it is showing this error, </p> <pre><code>error: Server does not allow request for unadvertised object 3a2ceef...
50,767
4,464,547
2023-12-20 02:31:10
51,002,078
11
2018-06-23 14:21:53
7,200,715
2018-06-23 14:21:53
https://stackoverflow.com/q/51001919
https://stackoverflow.com/a/51002078
<p>According to <a href="https://superuser.com/questions/1240216/what-does-the-git-error-message-server-does-not-allow-request-for-unadvertised#answer-1286550">this answer</a> and <a href="https://git-scm.com/book/en/v2/Git-Internals-Transfer-Protocols" rel="noreferrer">the given source</a> it looks like BitBucket does...
<p>According to <a href="https://superuser.com/questions/1240216/what-does-the-git-error-message-server-does-not-allow-request-for-unadvertised#answer-1286550">this answer</a> and <a href="https://git-scm.com/book/en/v2/Git-Internals-Transfer-Protocols" rel="noreferrer">the given source</a> it looks like BitBucket does...
119, 8337
bitbucket, git
<h1>How to solve git error: Server does not allow request for unadvertised object 3a2ceef391af73994dfeb0d8ef57ed6a52ef4238?</h1> <p>I wanted to pull commit "3a2ceef391af73994dfeb0d8ef57ed6a52ef4238" from branch android. I used the command:</p> <pre><code>$ git fetch origin 3a2ceef391af73994dfeb0d8ef57ed6a52ef4238 </co...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,319
git
# How to solve git error: Server does not allow request for unadvertised object 3a2ceef391af73994dfeb0d8ef57ed6a52ef4238? I wanted to pull commit "3a2ceef391af73994dfeb0d8ef57ed6a52ef4238" from branch android. I used the command: ``` $ git fetch origin 3a2ceef391af73994dfeb0d8ef57ed6a52ef4238 ``` and it is showing t...
According to [this answer](https://superuser.com/questions/1240216/what-does-the-git-error-message-server-does-not-allow-request-for-unadvertised#answer-1286550) and [the given source](https://git-scm.com/book/en/v2/Git-Internals-Transfer-Protocols) it looks like BitBucket does not allow you to fetch a commit id, only ...
23068790
Git revert certain files
24
2014-04-14 19:38:32
<p>I want to do a revert of a commit, but only for some files. (<em>Not a checkout; a revert.</em> If you are unfamiliar with the difference, keep reading.)</p> <p>I tried this</p> <pre><code>git revert --no-commit abcdef123456 -- my/path/to/revert </code></pre> <p>And I got this error</p> <pre><code>fatal: ambiguo...
10,296
1,212,596
2021-02-08 04:46:59
23,155,910
11
2014-04-18 14:12:14
1,290,731
2014-04-18 14:12:14
https://stackoverflow.com/q/23068790
https://stackoverflow.com/a/23155910
<p>A shorter sequence for when you can make a short list of what you want:</p> <pre><code>git revert that_commit # do the whole revert git reset --hard HEAD^ # in what turns out to have been a throwaway commit git checkout HEAD@{1} -- one/folder # and just take what you want of the results </code...
<p>A shorter sequence for when you can make a short list of what you want:</p> <pre><code>git revert that_commit # do the whole revert git reset --hard HEAD^ # in what turns out to have been a throwaway commit git checkout HEAD@{1} -- one/folder # and just take what you want of the results </code...
119, 34403
git, git-revert
<h1>Git revert certain files</h1> <p>I want to do a revert of a commit, but only for some files. (<em>Not a checkout; a revert.</em> If you are unfamiliar with the difference, keep reading.)</p> <p>I tried this</p> <pre><code>git revert --no-commit abcdef123456 -- my/path/to/revert </code></pre> <p>And I got this er...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,320
git
# Git revert certain files I want to do a revert of a commit, but only for some files. (*Not a checkout; a revert.* If you are unfamiliar with the difference, keep reading.) I tried this ``` git revert --no-commit abcdef123456 -- my/path/to/revert ``` And I got this error ``` fatal: ambiguous argument 'my/path/to/...
A shorter sequence for when you can make a short list of what you want: ``` git revert that_commit # do the whole revert git reset --hard HEAD^ # in what turns out to have been a throwaway commit git checkout HEAD@{1} -- one/folder # and just take what you want of the results ```
17785265
List all the versions of a given line number in the GIT history
24
2013-07-22 10:30:37
<p>Is it possible in Git to list all the previous versions of a given line in a file by the line number? </p> <p>The reason why I would find it useful is to be able to easier troubleshoot a problem based on logged stack trace report.</p> <p>i.e. I have a <code>undefined method exception</code> logged at a line 100 of...
7,576
650,046
2013-07-23 08:24:49
17,803,762
11
2013-07-23 07:19:47
946,850
2013-07-23 08:09:00
https://stackoverflow.com/q/17785265
https://stackoverflow.com/a/17803762
<p>This will call <code>git blame</code> for <strong>every</strong> meaningful revision to show line <code>$LINE</code> of file <code>$FILE</code>: </p> <pre><code>git log --format=format:%H $FILE | xargs -L 1 git blame $FILE -L $LINE,$LINE </code></pre> <p>As usual, the blame shows the revision number in the beginni...
<p>This will call <code>git blame</code> for <strong>every</strong> meaningful revision to show line <code>$LINE</code> of file <code>$FILE</code>: </p> <pre><code>git log --format=format:%H $FILE | xargs -L 1 git blame $FILE -L $LINE,$LINE </code></pre> <p>As usual, the blame shows the revision number in the beginni...
119
git
<h1>List all the versions of a given line number in the GIT history</h1> <p>Is it possible in Git to list all the previous versions of a given line in a file by the line number? </p> <p>The reason why I would find it useful is to be able to easier troubleshoot a problem based on logged stack trace report.</p> <p>i.e....
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,321
git
# List all the versions of a given line number in the GIT history Is it possible in Git to list all the previous versions of a given line in a file by the line number? The reason why I would find it useful is to be able to easier troubleshoot a problem based on logged stack trace report. i.e. I have a `undefined met...
This will call `git blame` for **every** meaningful revision to show line `$LINE` of file `$FILE`: ``` git log --format=format:%H $FILE | xargs -L 1 git blame $FILE -L $LINE,$LINE ``` As usual, the blame shows the revision number in the beginning of each line. You can append ``` | sort | uniq -c ``` to get aggregat...
10056165
How to resolve "delete/modify" conflict caused by "git stash apply"
24
2012-04-07 16:22:59
<p>I recently did a <code>git stash</code>, then did some work on the branch and committed it, and got these errors when trying to do a <code>git stash apply</code>:</p> <pre><code>CONFLICT (delete/modify): app/controllers/orders_controller.rb deleted in Updated upstream and modified in Stashed changes. Version Stashe...
29,699
346,418
2024-11-18 05:27:57
10,056,260
11
2012-04-07 16:34:11
1,286,639
2014-07-03 15:03:51
https://stackoverflow.com/q/10056165
https://stackoverflow.com/a/10056260
<p>You are popping the stash onto a different state; state that has one additional commit. And worse, the commit has introduced merge conflicts, as you know.</p> <p>You have two options:</p> <ol> <li>pop that stash onto the latest commit and resolve the conflicts </li> <li>pop the stash onto the prior commit. </li...
<p>You are popping the stash onto a different state; state that has one additional commit. And worse, the commit has introduced merge conflicts, as you know.</p> <p>You have two options:</p> <ol> <li>pop that stash onto the latest commit and resolve the conflicts </li> <li>pop the stash onto the prior commit. </li...
119, 13091
git, git-stash
<h1>How to resolve "delete/modify" conflict caused by "git stash apply"</h1> <p>I recently did a <code>git stash</code>, then did some work on the branch and committed it, and got these errors when trying to do a <code>git stash apply</code>:</p> <pre><code>CONFLICT (delete/modify): app/controllers/orders_controller.r...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,322
git
# How to resolve "delete/modify" conflict caused by "git stash apply" I recently did a `git stash`, then did some work on the branch and committed it, and got these errors when trying to do a `git stash apply`: ``` CONFLICT (delete/modify): app/controllers/orders_controller.rb deleted in Updated upstream and modified...
You are popping the stash onto a different state; state that has one additional commit. And worse, the commit has introduced merge conflicts, as you know. You have two options: 1. pop that stash onto the latest commit and resolve the conflicts 2. pop the stash onto the prior commit. Sounds like #2 is what you want t...
14223302
How to use Google's repo tool on MS Windows OS?
23
2013-01-08 20:17:18
<p>I installed git for windows and it works fine(e.g. use one of the following solutions <a href="https://stackoverflow.com/questions/110205/want-to-download-a-git-repository-what-do-i-need-windows-machine">Want to download a Git repository, what do I need (windows machine)?</a>). </p> <p><a href="http://code.google.c...
50,494
1,031,417
2025-07-27 13:20:24
18,652,851
11
2013-09-06 08:05:40
938,111
2013-09-06 14:25:16
https://stackoverflow.com/q/14223302
https://stackoverflow.com/a/18652851
<p><strong>Yes, Google <code>repo</code> script can be compliant with Windows. Follow the steps below.</strong></p> <p>But before, as <a href="https://stackoverflow.com/a/14224458/938111">Borealid</a> said <code>repo</code> as not been ported on Windows. <code>repo</code> (<code>forall.py</code>) uses <a href="http://...
<p><strong>Yes, Google <code>repo</code> script can be compliant with Windows. Follow the steps below.</strong></p> <p>But before, as <a href="https://stackoverflow.com/a/14224458/938111">Borealid</a> said <code>repo</code> as not been ported on Windows. <code>repo</code> (<code>forall.py</code>) uses <a href="http://...
16, 119, 7330, 14456, 59047
git, python, python-2.7, repository, visual-studio-2010
<h1>How to use Google's repo tool on MS Windows OS?</h1> <p>I installed git for windows and it works fine(e.g. use one of the following solutions <a href="https://stackoverflow.com/questions/110205/want-to-download-a-git-repository-what-do-i-need-windows-machine">Want to download a Git repository, what do I need (windo...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,324
git
# How to use Google's repo tool on MS Windows OS? I installed git for windows and it works fine(e.g. use one of the following solutions [Want to download a Git repository, what do I need (windows machine)?](https://stackoverflow.com/questions/110205/want-to-download-a-git-repository-what-do-i-need-windows-machine)). ...
**Yes, Google `repo` script can be compliant with Windows. Follow the steps below.** But before, as [Borealid](https://stackoverflow.com/a/14224458/938111) said `repo` as not been ported on Windows. `repo` (`forall.py`) uses [`fcntl` that is not available on Windows (Unix only)](http://docs.python.org/2.7/library/fcnt...
37343550
Is there any way to get git to work directly with a .pac (proxy auto-config) script?
22
2016-05-20 09:52:04
<p>My corporate network works with a PAC script.(<a href="http://proxyconf.xxx.yy-ss/proxy.pac" rel="noreferrer">http://proxyconf.xxx.yy-ss/proxy.pac</a>). </p> <p>Using the PAC script in the "git config" command does not work. "git config --global http.proxy <a href="http://proxyconf.xxx.yy-ss/proxy.pac" rel="norefe...
18,325
2,122,833
2020-04-29 14:06:21
40,750,992
11
2016-11-22 20:26:36
6,309
2020-04-29 14:06:21
https://stackoverflow.com/q/37343550
https://stackoverflow.com/a/40750992
<p>You would need to configure git and make it reference your own proxy server, one using your PAC file.</p> <p>See for instance <a href="https://github.com/liangqing/PacProxy" rel="nofollow noreferrer"><strong><code>liangqing/PacProxy</code></strong></a></p> <blockquote> <p>A socks proxy server that use PAC file t...
<p>You would need to configure git and make it reference your own proxy server, one using your PAC file.</p> <p>See for instance <a href="https://github.com/liangqing/PacProxy" rel="nofollow noreferrer"><strong><code>liangqing/PacProxy</code></strong></a></p> <blockquote> <p>A socks proxy server that use PAC file t...
119, 7006
git, pac
<h1>Is there any way to get git to work directly with a .pac (proxy auto-config) script?</h1> <p>My corporate network works with a PAC script.(<a href="http://proxyconf.xxx.yy-ss/proxy.pac" rel="noreferrer">http://proxyconf.xxx.yy-ss/proxy.pac</a>). </p> <p>Using the PAC script in the "git config" command does not wor...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,325
git
# Is there any way to get git to work directly with a .pac (proxy auto-config) script? My corporate network works with a PAC script.(<http://proxyconf.xxx.yy-ss/proxy.pac>). Using the PAC script in the "git config" command does not work. "git config --global http.proxy <http://proxyconf.xxx.yy-ss/proxy.pac>" I got i...
You would need to configure git and make it reference your own proxy server, one using your PAC file. See for instance [**`liangqing/PacProxy`**](https://github.com/liangqing/PacProxy) > A socks proxy server that use PAC file to decide how to forward request > > ## Features > > - Implement a socks server(support sock...
26075786
Force LF line endings using .gitattributes without losing automatic text/binary inference?
22
2014-09-27 14:41:41
<p>I would like to use <code>eol=LF</code> in my .gitattributes file, but I would like it to apply <em>only</em> to the files Git automatically determines to be text files.</p> <p>The best I could find is to define specific file extensions / globs as text or binary. This is not ideal as the list could be huge. I've tr...
4,848
33,080
2025-05-08 13:34:21
33,890,199
11
2015-11-24 09:45:18
898,999
2015-11-24 20:48:08
https://stackoverflow.com/q/26075786
https://stackoverflow.com/a/33890199
<p><strong>Update:</strong> after @romkyns comment I rechecked everything and found my solution to be slightly incorrect. Correct would be a <code>.gitattributes</code>-file with the following content:</p> <pre><code>* text=auto </code></pre> <p>According to the <a href="http://git-scm.com/docs/gitattributes#_end_of_...
<p><strong>Update:</strong> after @romkyns comment I rechecked everything and found my solution to be slightly incorrect. Correct would be a <code>.gitattributes</code>-file with the following content:</p> <pre><code>* text=auto </code></pre> <p>According to the <a href="http://git-scm.com/docs/gitattributes#_end_of_...
119, 3705
git, newline
<h1>Force LF line endings using .gitattributes without losing automatic text/binary inference?</h1> <p>I would like to use <code>eol=LF</code> in my .gitattributes file, but I would like it to apply <em>only</em> to the files Git automatically determines to be text files.</p> <p>The best I could find is to define spec...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,326
git
# Force LF line endings using .gitattributes without losing automatic text/binary inference? I would like to use `eol=LF` in my .gitattributes file, but I would like it to apply *only* to the files Git automatically determines to be text files. The best I could find is to define specific file extensions / globs as te...
**Update:** after @romkyns comment I rechecked everything and found my solution to be slightly incorrect. Correct would be a `.gitattributes`-file with the following content: ``` * text=auto ``` According to the [documentation](http://git-scm.com/docs/gitattributes#_end_of_line_conversion), *this ensures that all fil...
46395528
git rebase --committer-date-is-author-date --root does not work
21
2017-09-24 22:38:26
<p>I try to set the committer date of the latest commit to its author date. Usually this works with <code>git rebase --committer-date-is-author-date HEAD~1</code>. Unfortunately there is only one commit which means that I have to use <code>--root</code> instead of <code>HEAD~1</code> but <code>git rebase --committer-da...
20,650
3,882,565
2022-06-20 11:47:47
46,395,791
11
2017-09-24 23:28:11
1,256,452
2017-09-25 01:02:34
https://stackoverflow.com/q/46395528
https://stackoverflow.com/a/46395791
<h3>The bad news</h3> <p>Unfortunately <code>git rebase --root</code> uses the interactive rebase code (because the non-interactive code cannot "replay" the root commit), and <code>--committer-date-is-author-date</code> is actually a flag passed to <code>git am</code>, which implements the simple non-interactive cases...
<h3>The bad news</h3> <p>Unfortunately <code>git rebase --root</code> uses the interactive rebase code (because the non-interactive code cannot "replay" the root commit), and <code>--committer-date-is-author-date</code> is actually a flag passed to <code>git am</code>, which implements the simple non-interactive cases...
119, 3953, 5002, 5597, 8974
author, commit, date, git, rebase
<h1>git rebase --committer-date-is-author-date --root does not work</h1> <p>I try to set the committer date of the latest commit to its author date. Usually this works with <code>git rebase --committer-date-is-author-date HEAD~1</code>. Unfortunately there is only one commit which means that I have to use <code>--root<...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,329
git
# git rebase --committer-date-is-author-date --root does not work I try to set the committer date of the latest commit to its author date. Usually this works with `git rebase --committer-date-is-author-date HEAD~1`. Unfortunately there is only one commit which means that I have to use `--root` instead of `HEAD~1` but ...
### The bad news Unfortunately `git rebase --root` uses the interactive rebase code (because the non-interactive code cannot "replay" the root commit), and `--committer-date-is-author-date` is actually a flag passed to `git am`, which implements the simple non-interactive cases. ### The good news What `git rebase` d...
36927089
Exclude Preceding Commit> line from git rev-list formatting
21
2016-04-28 23:23:09
<p>I'm trying to work on a branch diff command, and I've got it all working... Except for the formatting. I can use <code>--pretty=oneline</code> to display just the information I want, except it displays the full hash, and doesn't colorize the output. </p> <p>So it'd just output this:</p> <pre><code>fa73c05913292fbc...
3,437
1,905,944
2022-10-27 04:51:00
36,927,818
11
2016-04-29 00:54:04
1,755,598
2016-04-29 00:54:04
https://stackoverflow.com/q/36927089
https://stackoverflow.com/a/36927818
<p>To leave an answer for those who will come next/</p> <p>@torec mentioned in his comment the following:</p> <blockquote> <p><code>git rev-list</code> and <code>git log</code> are essentially the same command</p> </blockquote> <p>The answer is to use the following format:</p> <pre><code># print out the log histo...
<p>To leave an answer for those who will come next/</p> <p>@torec mentioned in his comment the following:</p> <blockquote> <p><code>git rev-list</code> and <code>git log</code> are essentially the same command</p> </blockquote> <p>The answer is to use the following format:</p> <pre><code># print out the log histo...
119
git
<h1>Exclude Preceding Commit> line from git rev-list formatting</h1> <p>I'm trying to work on a branch diff command, and I've got it all working... Except for the formatting. I can use <code>--pretty=oneline</code> to display just the information I want, except it displays the full hash, and doesn't colorize the output...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,330
git
# Exclude Preceding Commit> line from git rev-list formatting I'm trying to work on a branch diff command, and I've got it all working... Except for the formatting. I can use `--pretty=oneline` to display just the information I want, except it displays the full hash, and doesn't colorize the output. So it'd just outp...
To leave an answer for those who will come next/ @torec mentioned in his comment the following: > `git rev-list` and `git log` are essentially the same command The answer is to use the following format: ``` # print out the log history in the desired format. git log --pretty="format:..." <SHA-1> ```
29124247
How can I restrict git status to regular files in the current directory only?
21
2015-03-18 14:06:41
<p>I would like to see the status of the current directory. Because there are lots of changes in sub-directories, which I do <em>not</em> want to see, the following command doesn't do the trick:</p> <pre><code>git status . </code></pre> <p>Is there any way of getting this kind of report, short of grepping the output ...
3,488
647,991
2024-04-16 22:09:26
29,124,682
11
2015-03-18 14:25:31
2,541,573
2024-04-16 22:09:26
https://stackoverflow.com/q/29124247
https://stackoverflow.com/a/29124682
<h2>Use <code>git-status -- &lt;pathspec&gt;...</code></h2> <p>The synopsis of the <a href="http://git-scm.com/docs/git-status" rel="nofollow noreferrer"><code>git-status</code> man page</a> tells you that you can filter by paths:</p> <pre><code>git status [&lt;options&gt;...] [--] [&lt;pathspec&gt;...] </code></pre> <...
<h2>Use <code>git-status -- &lt;pathspec&gt;...</code></h2> <p>The synopsis of the <a href="http://git-scm.com/docs/git-status" rel="nofollow noreferrer"><code>git-status</code> man page</a> tells you that you can filter by paths:</p> <pre><code>git status [&lt;options&gt;...] [--] [&lt;pathspec&gt;...] </code></pre> <...
119, 54839
git, git-status
<h1>How can I restrict git status to regular files in the current directory only?</h1> <p>I would like to see the status of the current directory. Because there are lots of changes in sub-directories, which I do <em>not</em> want to see, the following command doesn't do the trick:</p> <pre><code>git status . </code></...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,331
git
# How can I restrict git status to regular files in the current directory only? I would like to see the status of the current directory. Because there are lots of changes in sub-directories, which I do *not* want to see, the following command doesn't do the trick: ``` git status . ``` Is there any way of getting thi...
## Use `git-status -- <pathspec>...` The synopsis of the [`git-status` man page](http://git-scm.com/docs/git-status) tells you that you can filter by paths: ``` git status [<options>...] [--] [<pathspec>...] ``` Therefore, all you have to do is get a list of paths corresponding to the regular (non-directory) files i...
8198966
How do I fix a failed git commit?
21
2011-11-20 02:18:45
<p>I am new to <code>git</code> and was trying to commit, but I got stuck in what looked like <code>vi</code> which I'm not familiar with. I managed to get out of it, but I think I got out the wrong way because my git status says "changes not staged," but I still can't try again. Could someone tell me what I can do to ...
66,314
234,670
2018-02-13 01:43:25
8,199,031
11
2011-11-20 02:34:37
129,655
2016-10-06 14:10:29
https://stackoverflow.com/q/8198966
https://stackoverflow.com/a/8199031
<p>Assuming you're not doing anything with git at the moment (i.e., not doing a push or pull or running a git script in the repository, for any reason), you could just remove the lock file manually and try again.</p> <p>Also, git expects a "commit message" describing your changes. Assuming you don't want an editor to ...
<p>Assuming you're not doing anything with git at the moment (i.e., not doing a push or pull or running a git script in the repository, for any reason), you could just remove the lock file manually and try again.</p> <p>Also, git expects a "commit message" describing your changes. Assuming you don't want an editor to ...
119
git
<h1>How do I fix a failed git commit?</h1> <p>I am new to <code>git</code> and was trying to commit, but I got stuck in what looked like <code>vi</code> which I'm not familiar with. I managed to get out of it, but I think I got out the wrong way because my git status says "changes not staged," but I still can't try aga...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,332
git
# How do I fix a failed git commit? I am new to `git` and was trying to commit, but I got stuck in what looked like `vi` which I'm not familiar with. I managed to get out of it, but I think I got out the wrong way because my git status says "changes not staged," but I still can't try again. Could someone tell me what ...
Assuming you're not doing anything with git at the moment (i.e., not doing a push or pull or running a git script in the repository, for any reason), you could just remove the lock file manually and try again. Also, git expects a "commit message" describing your changes. Assuming you don't want an editor to open, you ...
12668711
Git using subtree or submodule to manage external resources
20
2012-10-01 06:54:36
<p>I read much about how awful the git submodule is supposed to be, but I am not sure if that is just the groaning of people who feel it limits or if it has serious issues (especially concerning my use case).</p> <p>I just want to include different repos into my repo like this</p> <pre><code>website/ libs/ js/ ...
10,028
197,134
2015-11-17 07:24:10
12,669,096
11
2012-10-01 07:31:57
6,309
2013-07-29 12:30:31
https://stackoverflow.com/q/12668711
https://stackoverflow.com/a/12669096
<p>Submodule is well-suited to your case, especially since you don't mind included those subrepos in their own subdirectory.</p> <p>The main serious issue you could have using submodules is when updating them while having updates in progress, as described in "<a href="https://stackoverflow.com/questions/12078365/how-e...
<p>Submodule is well-suited to your case, especially since you don't mind included those subrepos in their own subdirectory.</p> <p>The main serious issue you could have using submodules is when updating them while having updates in progress, as described in "<a href="https://stackoverflow.com/questions/12078365/how-e...
119, 41612, 68200
git, git-submodules, git-subtree
<h1>Git using subtree or submodule to manage external resources</h1> <p>I read much about how awful the git submodule is supposed to be, but I am not sure if that is just the groaning of people who feel it limits or if it has serious issues (especially concerning my use case).</p> <p>I just want to include different r...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,337
git
# Git using subtree or submodule to manage external resources I read much about how awful the git submodule is supposed to be, but I am not sure if that is just the groaning of people who feel it limits or if it has serious issues (especially concerning my use case). I just want to include different repos into my rep...
Submodule is well-suited to your case, especially since you don't mind included those subrepos in their own subdirectory. The main serious issue you could have using submodules is when updating them while having updates in progress, as described in "[how exactly does git submodule work](https://stackoverflow.com/quest...
8156299
Why doesn't gitignore work in this case?
20
2011-11-16 17:53:03
<p>I have two files I wish to ignore:</p> <ul> <li>.idea/workspace.xml</li> <li>someapp/src/.idea/workspace.xml</li> </ul> <p>I thought adding this single rule to .gitignore will suffice:</p> <pre><code>.idea/workspace.xml </code></pre> <p>But it only catches the top-level .idea/workspace.xml (git status shows some...
17,818
11,236
2013-10-24 05:33:48
8,156,479
11
2011-11-16 18:05:52
216,074
2011-11-16 18:05:52
https://stackoverflow.com/q/8156299
https://stackoverflow.com/a/8156479
<blockquote> <ul> <li>[…]</li> <li>If the pattern does not contain a slash /, git treats it as a shell glob pattern and checks for a match against the pathname relative to the location of the .gitignore file (relative to the toplevel of the work tree if not from a .gitignore file). </li> <li>Otherwise, git trea...
<blockquote> <ul> <li>[…]</li> <li>If the pattern does not contain a slash /, git treats it as a shell glob pattern and checks for a match against the pathname relative to the location of the .gitignore file (relative to the toplevel of the work tree if not from a .gitignore file). </li> <li>Otherwise, git trea...
119, 25056
git, gitignore
<h1>Why doesn't gitignore work in this case?</h1> <p>I have two files I wish to ignore:</p> <ul> <li>.idea/workspace.xml</li> <li>someapp/src/.idea/workspace.xml</li> </ul> <p>I thought adding this single rule to .gitignore will suffice:</p> <pre><code>.idea/workspace.xml </code></pre> <p>But it only catches the to...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,338
git
# Why doesn't gitignore work in this case? I have two files I wish to ignore: - .idea/workspace.xml - someapp/src/.idea/workspace.xml I thought adding this single rule to .gitignore will suffice: ``` .idea/workspace.xml ``` But it only catches the top-level .idea/workspace.xml (git status shows someapp/src/.idea/w...
> - […] > - If the pattern does not contain a slash /, git treats it as a shell glob pattern and checks for a match against the pathname relative to the location of the .gitignore file (relative to the toplevel of the work tree if not from a .gitignore file). > - Otherwise, git treats the pattern as a shell glob suitab...
2730866
Git rebase branch with all parent branches (or dependent sub-branches)
19
2010-04-28 15:27:16
<p>Is it possible to rebase a branch with all its parent branches with Git? (I think &quot;parent branches&quot; is the correct form to use here. Depending on your viewpoint, you might also call them dependent sub-branches. Yet, following the parent-pointers of the commits will get you to those branches, so IMHO it is ...
6,387
112,968
2022-10-18 09:46:16
6,489,904
11
2011-06-27 07:39:42
112,968
2022-10-18 09:20:55
https://stackoverflow.com/q/2730866
https://stackoverflow.com/a/6489904
<p>Looks like this feature is slowly getting into Git. <code>rebase</code> will gain the option <code>--rebase-refs</code> which will do exactly what my original answer asked. For the proposed patch series see the thread <a href="http://thread.gmane.org/gmane.comp.version-control.git/176339" rel="noreferrer">rebase: co...
<p>Looks like this feature is slowly getting into Git. <code>rebase</code> will gain the option <code>--rebase-refs</code> which will do exactly what my original answer asked. For the proposed patch series see the thread <a href="http://thread.gmane.org/gmane.comp.version-control.git/176339" rel="noreferrer">rebase: co...
119, 1879, 8974, 29934
branch, git, git-rebase, rebase
<h1>Git rebase branch with all parent branches (or dependent sub-branches)</h1> <p>Is it possible to rebase a branch with all its parent branches with Git? (I think &quot;parent branches&quot; is the correct form to use here. Depending on your viewpoint, you might also call them dependent sub-branches. Yet, following t...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,340
git
# Git rebase branch with all parent branches (or dependent sub-branches) Is it possible to rebase a branch with all its parent branches with Git? (I think "parent branches" is the correct form to use here. Depending on your viewpoint, you might also call them dependent sub-branches. Yet, following the parent-pointers ...
Looks like this feature is slowly getting into Git. `rebase` will gain the option `--rebase-refs` which will do exactly what my original answer asked. For the proposed patch series see the thread [rebase: command "ref" and options --rewrite-{refs,heads,tags}](http://thread.gmane.org/gmane.comp.version-control.git/17633...
47190265
How do you use the `git rebase --edit-todo` cmd in interactive rebase when all current to-do's are set to `reword`?
18
2017-11-08 21:47:57
<p>I've ended up not having the time to finish a rebase. The problem is I don't know how to edit my original to-do list because all my current to-do's are <code>reword</code> and after each time I finish rewording a commit message it automatically opens the next commit in Vim to be reworded.</p> <p>If I were editing a...
37,623
6,496,965
2021-12-11 09:59:18
47,191,050
11
2017-11-08 22:50:13
1,256,452
2017-11-08 22:50:13
https://stackoverflow.com/q/47190265
https://stackoverflow.com/a/47191050
<p>Try starting another shell instance somewhere, e.g., in another window or using <code>:shell</code> from within vim. Make sure this shell instance is in the correct repository directory (<code>cd path/to/repo</code> if necessary) and run <code>git rebase --edit-todo</code> there. Write out the updated instructions...
<p>Try starting another shell instance somewhere, e.g., in another window or using <code>:shell</code> from within vim. Make sure this shell instance is in the correct repository directory (<code>cd path/to/repo</code> if necessary) and run <code>git rebase --edit-todo</code> there. Write out the updated instructions...
119
git
<h1>How do you use the `git rebase --edit-todo` cmd in interactive rebase when all current to-do's are set to `reword`?</h1> <p>I've ended up not having the time to finish a rebase. The problem is I don't know how to edit my original to-do list because all my current to-do's are <code>reword</code> and after each time ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,344
git
# How do you use the `git rebase --edit-todo` cmd in interactive rebase when all current to-do's are set to `reword`? I've ended up not having the time to finish a rebase. The problem is I don't know how to edit my original to-do list because all my current to-do's are `reword` and after each time I finish rewording a...
Try starting another shell instance somewhere, e.g., in another window or using `:shell` from within vim. Make sure this shell instance is in the correct repository directory (`cd path/to/repo` if necessary) and run `git rebase --edit-todo` there. Write out the updated instructions and exit this editor, and then go bac...
40739305
Default behaviour of 'git pull'
18
2016-11-22 10:23:37
<p>Why is that <code>git pull</code> pulls everything including newly created remote branches but <code>git pull origin master</code> does not?</p> <p>I'm using <code>git version 2.9.3.windows.2</code>.</p>
38,519
744,534
2020-01-30 14:14:55
40,739,835
11
2016-11-22 10:47:29
711,006
2016-11-22 13:11:31
https://stackoverflow.com/q/40739305
https://stackoverflow.com/a/40739835
<p>When you specify no branches, the default settings are used. The default means to fetch and update <em>all</em> branches existing in the remote repository.</p> <p>See documentation for details:</p> <blockquote> <pre><code>git pull [options] [&lt;repository&gt; [&lt;refspec&gt;…​]] </code></pre> <p><code>&lt;refspec&...
<p>When you specify no branches, the default settings are used. The default means to fetch and update <em>all</em> branches existing in the remote repository.</p> <p>See documentation for details:</p> <blockquote> <pre><code>git pull [options] [&lt;repository&gt; [&lt;refspec&gt;…​]] </code></pre> <p><code>&lt;refspec&...
119, 28896
git, git-pull
<h1>Default behaviour of 'git pull'</h1> <p>Why is that <code>git pull</code> pulls everything including newly created remote branches but <code>git pull origin master</code> does not?</p> <p>I'm using <code>git version 2.9.3.windows.2</code>.</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,345
git
# Default behaviour of 'git pull' Why is that `git pull` pulls everything including newly created remote branches but `git pull origin master` does not? I'm using `git version 2.9.3.windows.2`.
When you specify no branches, the default settings are used. The default means to fetch and update *all* branches existing in the remote repository. See documentation for details: > ``` > git pull [options] [<repository> [<refspec>…​]] > ``` > > `<refspec>` specifies which refs to fetch and which local refs to update...
38177026
What does `cat-file` stand for in git?
18
2016-07-04 04:35:55
<p>In git, what does <code>cat-file</code> stand for in this command?</p> <pre><code>$ git cat-file &lt;...&gt; </code></pre> <p>My first thought is "concatenate file" because the Unix command <code>cat</code> stands for "concatenate", but this doesn't correspond to the function of <code>git cat-file</code>.</p>
35,821
5,674,394
2024-09-07 18:28:49
38,177,147
11
2016-07-04 04:51:18
145,279
2016-07-04 04:51:18
https://stackoverflow.com/q/38177026
https://stackoverflow.com/a/38177147
<p>While <a href="https://en.wikipedia.org/wiki/Cat_(Unix)" rel="noreferrer"><code>cat</code></a> does stand for &quot;concatenate&quot;, what it actually does is simply display one or multiple files, in order of their appearance in the command line arguments to <code>cat</code>. The common pattern to <em>view</em> the...
<p>While <a href="https://en.wikipedia.org/wiki/Cat_(Unix)" rel="noreferrer"><code>cat</code></a> does stand for &quot;concatenate&quot;, what it actually does is simply display one or multiple files, in order of their appearance in the command line arguments to <code>cat</code>. The common pattern to <em>view</em> the...
119, 22820
cat, git
<h1>What does `cat-file` stand for in git?</h1> <p>In git, what does <code>cat-file</code> stand for in this command?</p> <pre><code>$ git cat-file &lt;...&gt; </code></pre> <p>My first thought is "concatenate file" because the Unix command <code>cat</code> stands for "concatenate", but this doesn't correspond to the...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,346
git
# What does `cat-file` stand for in git? In git, what does `cat-file` stand for in this command? ``` $ git cat-file <...> ``` My first thought is "concatenate file" because the Unix command `cat` stands for "concatenate", but this doesn't correspond to the function of `git cat-file`.
While [`cat`](https://en.wikipedia.org/wiki/Cat_(Unix)) does stand for "concatenate", what it actually does is simply display one or multiple files, in order of their appearance in the command line arguments to `cat`. The common pattern to *view* the contents of a file on Linux or *nix systems is: ``` cat <file> ``` ...
23584990
What data is being signed when you `git commit --gpg-sign=<key-id>`?
18
2014-05-10 18:50:09
<p>I'm trying to figure out how to sign/verify commits by hand, but I can't figure out what data is being signed to create the signature. In other words, I can't figure out what <code>&lt;data&gt;</code> in <code>gpg --verify &lt;commit-sig&gt; &lt;data&gt;</code> needs to be.</p> <p>Here's the relevant bit of git's s...
2,322
511,200
2022-01-10 14:44:28
23,612,051
11
2014-05-12 14:41:43
1,571,575
2021-06-10 12:33:34
https://stackoverflow.com/q/23584990
https://stackoverflow.com/a/23612051
<p>After reading the code in <strong>commit_tree_extended</strong>, it seems the data used to sign is the part from &quot;tree&quot; to the end of the comment, of course excluding the signature.</p> <p>In your example, it should be:</p> <pre class="lang-none prettyprint-override"><code>tree 70e7c184c3a89c749174b4987830...
<p>After reading the code in <strong>commit_tree_extended</strong>, it seems the data used to sign is the part from &quot;tree&quot; to the end of the comment, of course excluding the signature.</p> <p>In your example, it should be:</p> <pre class="lang-none prettyprint-override"><code>tree 70e7c184c3a89c749174b4987830...
119, 6735
git, gnupg
<h1>What data is being signed when you `git commit --gpg-sign=<key-id>`?</h1> <p>I'm trying to figure out how to sign/verify commits by hand, but I can't figure out what data is being signed to create the signature. In other words, I can't figure out what <code>&lt;data&gt;</code> in <code>gpg --verify &lt;commit-sig&g...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,347
git
# What data is being signed when you `git commit --gpg-sign=`? I'm trying to figure out how to sign/verify commits by hand, but I can't figure out what data is being signed to create the signature. In other words, I can't figure out what `<data>` in `gpg --verify <commit-sig> <data>` needs to be. Here's the relevant ...
After reading the code in **commit_tree_extended**, it seems the data used to sign is the part from "tree" to the end of the comment, of course excluding the signature. In your example, it should be: ``` tree 70e7c184c3a89c749174b4987830c287fd78952d author Dan Neumann <danrodneu@gmail.com> 1399683715 -0500 committer ...
21306821
Why won't "git reset HEAD" undo my uncommitted, unstaged changes?
18
2014-01-23 11:27:21
<p>I've previously been able to undo changes through SourceTree by performing the "Discard" function, which under the hood produces this command:</p> <pre><code>git -c diff.mnemonicprefix=false -c core.quotepath=false reset -q HEAD -- myproj.csproj git -c diff.mnemonicprefix=false -c core.quotepath=false checkout HEA...
19,502
507,339
2017-10-27 19:50:10
21,306,974
11
2014-01-23 11:33:45
1,403,095
2014-01-23 13:17:50
https://stackoverflow.com/q/21306821
https://stackoverflow.com/a/21306974
<p>If you need to remove local changes then run following command</p> <pre><code>git checkout -- file_name </code></pre> <p><code>git reset HEAD</code> does not remove local changes.</p>
<p>If you need to remove local changes then run following command</p> <pre><code>git checkout -- file_name </code></pre> <p><code>git reset HEAD</code> does not remove local changes.</p>
119
git
<h1>Why won't "git reset HEAD" undo my uncommitted, unstaged changes?</h1> <p>I've previously been able to undo changes through SourceTree by performing the "Discard" function, which under the hood produces this command:</p> <pre><code>git -c diff.mnemonicprefix=false -c core.quotepath=false reset -q HEAD -- myproj.cs...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,348
git
# Why won't "git reset HEAD" undo my uncommitted, unstaged changes? I've previously been able to undo changes through SourceTree by performing the "Discard" function, which under the hood produces this command: ``` git -c diff.mnemonicprefix=false -c core.quotepath=false reset -q HEAD -- myproj.csproj git -c diff.mn...
If you need to remove local changes then run following command ``` git checkout -- file_name ``` `git reset HEAD` does not remove local changes.
19618112
How do I stash uncommitted changes in Visual Studio 2013
18
2013-10-27 12:38:44
<p>Need some help on how I can shelve uncommited changes in a Git repository using Visual Studio 2013. I come from PHPStorm where you can shelve uncommited changes on one branch, switch to another and unshelve.</p> <p>However, I can't find/see how this can be done in Visual Studio. Could someone shed some light on thi...
22,008
1,084,514
2019-02-12 18:22:08
19,618,492
11
2013-10-27 13:19:05
749,284
2017-08-11 01:52:29
https://stackoverflow.com/q/19618112
https://stackoverflow.com/a/19618492
<p>In <code>git</code> the concept you're looking for is <code>stash</code>. You add your changes as if you are going to commit them, and you then stash them with <code>git stash</code>. After changing branches, you can <code>git stash apply</code> or <code>git stash pop</code> (with the former leaving the stash availa...
<p>In <code>git</code> the concept you're looking for is <code>stash</code>. You add your changes as if you are going to commit them, and you then stash them with <code>git stash</code>. After changing branches, you can <code>git stash apply</code> or <code>git stash pop</code> (with the former leaving the stash availa...
119, 33953, 93364
git, visual-studio, visual-studio-2013
<h1>How do I stash uncommitted changes in Visual Studio 2013</h1> <p>Need some help on how I can shelve uncommited changes in a Git repository using Visual Studio 2013. I come from PHPStorm where you can shelve uncommited changes on one branch, switch to another and unshelve.</p> <p>However, I can't find/see how this ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,349
git
# How do I stash uncommitted changes in Visual Studio 2013 Need some help on how I can shelve uncommited changes in a Git repository using Visual Studio 2013. I come from PHPStorm where you can shelve uncommited changes on one branch, switch to another and unshelve. However, I can't find/see how this can be done in V...
In `git` the concept you're looking for is `stash`. You add your changes as if you are going to commit them, and you then stash them with `git stash`. After changing branches, you can `git stash apply` or `git stash pop` (with the former leaving the stash available for reuse). I'm familiar with the `shelf` concept fro...
52968175
How to prevent a specific branch from being merged in git?
17
2018-10-24 11:45:09
<p>We have a <code>master</code> branch where the released production code lives, a <code>dev</code> branch where the code for the test server lives, and various feature branches (branched from <code>master</code>) as each developer sees fit.</p> <p>Over the course of time the <code>dev</code> branch has diverged some...
22,911
41,360
2019-09-16 02:36:40
52,971,840
11
2018-10-24 14:42:29
157,675
2018-10-24 14:42:29
https://stackoverflow.com/q/52968175
https://stackoverflow.com/a/52971840
<p>It's possible with <a href="https://git-scm.com/book/zh-tw/v2/Customizing-Git-Git-Hooks#pre-receive" rel="noreferrer">Git Hooks</a>. Put the following POC script to <code>.git/hooks/pre-receive</code> on your remote (server-side) repository and give it right permission to execute.</p> <p>Configure the branch you wa...
<p>It's possible with <a href="https://git-scm.com/book/zh-tw/v2/Customizing-Git-Git-Hooks#pre-receive" rel="noreferrer">Git Hooks</a>. Put the following POC script to <code>.git/hooks/pre-receive</code> on your remote (server-side) repository and give it right permission to execute.</p> <p>Configure the branch you wa...
119, 43087
git, githooks
<h1>How to prevent a specific branch from being merged in git?</h1> <p>We have a <code>master</code> branch where the released production code lives, a <code>dev</code> branch where the code for the test server lives, and various feature branches (branched from <code>master</code>) as each developer sees fit.</p> <p>O...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,351
git
# How to prevent a specific branch from being merged in git? We have a `master` branch where the released production code lives, a `dev` branch where the code for the test server lives, and various feature branches (branched from `master`) as each developer sees fit. Over the course of time the `dev` branch has diver...
It's possible with [Git Hooks](https://git-scm.com/book/zh-tw/v2/Customizing-Git-Git-Hooks#pre-receive). Put the following POC script to `.git/hooks/pre-receive` on your remote (server-side) repository and give it right permission to execute. Configure the branch you want to protect, for example `master` ``` $ git co...
47877925
fatal: pathspec 'README.txt' did not match any files
17
2017-12-18 23:26:09
<p>Really getting stuck on this one. I've googled a lot and can't figure out what I've done wrong...</p> <p>I'm trying to create a new file, via the <code>git add README.txt</code> command in terminal...</p> <p>(So far I've created a new folder <code>Fundamentals</code>. Created a sub-folder <code>git-practice</code...
64,620
9,115,678
2020-05-23 11:51:53
47,877,962
11
2017-12-18 23:30:58
1,440,565
2020-02-15 16:08:59
https://stackoverflow.com/q/47877925
https://stackoverflow.com/a/47877962
<blockquote> <p>fatal: pathspec 'README.txt' did not match any files</p> </blockquote> <p>You get this error because there is no file named <code>README.txt</code> in the current directory. Git is in the business of managing files that you create with other programs, usually a text editor or IDE. <code>git add</code...
<blockquote> <p>fatal: pathspec 'README.txt' did not match any files</p> </blockquote> <p>You get this error because there is no file named <code>README.txt</code> in the current directory. Git is in the business of managing files that you create with other programs, usually a text editor or IDE. <code>git add</code...
119
git
<h1>fatal: pathspec 'README.txt' did not match any files</h1> <p>Really getting stuck on this one. I've googled a lot and can't figure out what I've done wrong...</p> <p>I'm trying to create a new file, via the <code>git add README.txt</code> command in terminal...</p> <p>(So far I've created a new folder <code>Fund...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,352
git
# fatal: pathspec 'README.txt' did not match any files Really getting stuck on this one. I've googled a lot and can't figure out what I've done wrong... I'm trying to create a new file, via the `git add README.txt` command in terminal... (So far I've created a new folder `Fundamentals`. Created a sub-folder `git-pra...
> fatal: pathspec 'README.txt' did not match any files You get this error because there is no file named `README.txt` in the current directory. Git is in the business of managing files that you create with other programs, usually a text editor or IDE. `git add` only adds the file to the index. It does not create any f...
45267653
git selective revert (equivalent of `git revert --patch`)
17
2017-07-23 16:57:08
<p>Is there a preferred method of reverting part of a previous commit, along the lines of partially reverting unstaged changes (<code>git checkout -p</code>) and partially adding unstaged changes (<code>git add -p</code>)?</p> <p>i.e. I have a commit several (or even, many) commits back that contains both wanted and u...
4,764
17,027
2020-05-26 07:09:22
45,267,948
11
2017-07-23 17:26:45
1,290,731
2020-05-26 07:09:22
https://stackoverflow.com/q/45267653
https://stackoverflow.com/a/45267948
<pre><code>git revert --no-commit git reset --patch # or `git checkout --patch` if you're sure </code></pre>
<pre><code>git revert --no-commit git reset --patch # or `git checkout --patch` if you're sure </code></pre>
119, 34403
git, git-revert
<h1>git selective revert (equivalent of `git revert --patch`)</h1> <p>Is there a preferred method of reverting part of a previous commit, along the lines of partially reverting unstaged changes (<code>git checkout -p</code>) and partially adding unstaged changes (<code>git add -p</code>)?</p> <p>i.e. I have a commit s...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,353
git
# git selective revert (equivalent of `git revert --patch`) Is there a preferred method of reverting part of a previous commit, along the lines of partially reverting unstaged changes (`git checkout -p`) and partially adding unstaged changes (`git add -p`)? i.e. I have a commit several (or even, many) commits back th...
``` git revert --no-commit git reset --patch # or `git checkout --patch` if you're sure ```
22527867
Adding svn-remote to existing git repo
17
2014-03-20 08:55:34
<p>I have a git repo, and my company assigned me an empty svn repo to store my code in. So what I'd like to do is just add that svn repo as a remote to my existing git repo and then push to it.</p> <p>Now, all git-svn tutorials start with &quot;first clone the svn repo, then add code&quot;. That doesn't work for me, si...
11,008
178,331
2020-08-04 04:15:33
22,535,247
11
2014-03-20 13:58:56
792,416
2019-07-14 16:32:28
https://stackoverflow.com/q/22527867
https://stackoverflow.com/a/22535247
<p><strong>Short Answer</strong></p> <p>You should init this svn repo with some commit by svn client first, like this.</p> <pre><code>$ touch foobar $ svn add foobar $ svn ci -m "init svn repo for git svn can detect upstream" </code></pre> <hr> <p><strong>Long Answer</strong></p> <p>if svn repo is empty when you <...
<p><strong>Short Answer</strong></p> <p>You should init this svn repo with some commit by svn client first, like this.</p> <pre><code>$ touch foobar $ svn add foobar $ svn ci -m "init svn repo for git svn can detect upstream" </code></pre> <hr> <p><strong>Long Answer</strong></p> <p>if svn repo is empty when you <...
119, 6452
git, git-svn
<h1>Adding svn-remote to existing git repo</h1> <p>I have a git repo, and my company assigned me an empty svn repo to store my code in. So what I'd like to do is just add that svn repo as a remote to my existing git repo and then push to it.</p> <p>Now, all git-svn tutorials start with &quot;first clone the svn repo, t...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,358
git
# Adding svn-remote to existing git repo I have a git repo, and my company assigned me an empty svn repo to store my code in. So what I'd like to do is just add that svn repo as a remote to my existing git repo and then push to it. Now, all git-svn tutorials start with "first clone the svn repo, then add code". That ...
**Short Answer** You should init this svn repo with some commit by svn client first, like this. ``` $ touch foobar $ svn add foobar $ svn ci -m "init svn repo for git svn can detect upstream" ``` --- **Long Answer** if svn repo is empty when you `git svn clone xxx`, git client can't detect the upstream svn informa...
14717957
Why does git not recognize "origin/master" as a valid object name?
17
2013-02-05 22:10:02
<pre><code>~/www&gt; git branch --track live origin/master fatal: Not a valid object name: 'origin/master'. ~/www&gt; git remote origin ~/www&gt; git branch * master test_branch working_branch </code></pre> <p>I also tried creating a tracking branch with:</p> <pre><code>git branch live git branch --set-upstream l...
26,691
365,298
2021-07-07 08:51:44
14,721,970
11
2013-02-06 05:05:23
1,002,260
2013-08-02 21:57:09
https://stackoverflow.com/q/14717957
https://stackoverflow.com/a/14721970
<pre><code>$ git branch -r origin/1.x origin/1.x@60 origin/1.x@63 origin/HEAD -&gt; origin/master origin/master $ git branch --track live origin/blah fatal: Not a valid object name: 'origin/blah'. </code></pre> <p>As has been suggested you can only track a remote if it has been added. Perhaps add the remote...
<pre><code>$ git branch -r origin/1.x origin/1.x@60 origin/1.x@63 origin/HEAD -&gt; origin/master origin/master $ git branch --track live origin/blah fatal: Not a valid object name: 'origin/blah'. </code></pre> <p>As has been suggested you can only track a remote if it has been added. Perhaps add the remote...
119
git
<h1>Why does git not recognize "origin/master" as a valid object name?</h1> <pre><code>~/www&gt; git branch --track live origin/master fatal: Not a valid object name: 'origin/master'. ~/www&gt; git remote origin ~/www&gt; git branch * master test_branch working_branch </code></pre> <p>I also tried creating a track...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,359
git
# Why does git not recognize "origin/master" as a valid object name? ``` ~/www> git branch --track live origin/master fatal: Not a valid object name: 'origin/master'. ~/www> git remote origin ~/www> git branch * master test_branch working_branch ``` I also tried creating a tracking branch with: ``` git branch li...
``` $ git branch -r origin/1.x origin/1.x@60 origin/1.x@63 origin/HEAD -> origin/master origin/master $ git branch --track live origin/blah fatal: Not a valid object name: 'origin/blah'. ``` As has been suggested you can only track a remote if it has been added. Perhaps add the remote like this ``` $ git r...
9987759
Undo git stash pop on dirty working tree
17
2012-04-03 05:50:12
<p>This seems very foolish mistake, I just did a <code>git stash pop</code> on a dirty working tree. I do not know any way of keeping the desired changes and undoing the <code>stash pop</code>. Does one exist? Or such a mistake is unforgivable?</p>
4,511
860,421
2015-05-12 14:39:06
9,987,866
11
2012-04-03 06:02:26
27,835
2013-10-07 13:35:52
https://stackoverflow.com/q/9987759
https://stackoverflow.com/a/9987866
<p>If you still have that stash's SHA1, you can generate a patch from it (<code>git format-patch SHA1</code>) and apply the patch in reverse (<code>git apply -R filename.patch</code>).</p> <p>If you lost the SHA1, see <a href="https://stackoverflow.com/questions/89332/recover-dropped-stash-in-git">How to recover a dro...
<p>If you still have that stash's SHA1, you can generate a patch from it (<code>git format-patch SHA1</code>) and apply the patch in reverse (<code>git apply -R filename.patch</code>).</p> <p>If you lost the SHA1, see <a href="https://stackoverflow.com/questions/89332/recover-dropped-stash-in-git">How to recover a dro...
119, 13091
git, git-stash
<h1>Undo git stash pop on dirty working tree</h1> <p>This seems very foolish mistake, I just did a <code>git stash pop</code> on a dirty working tree. I do not know any way of keeping the desired changes and undoing the <code>stash pop</code>. Does one exist? Or such a mistake is unforgivable?</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,361
git
# Undo git stash pop on dirty working tree This seems very foolish mistake, I just did a `git stash pop` on a dirty working tree. I do not know any way of keeping the desired changes and undoing the `stash pop`. Does one exist? Or such a mistake is unforgivable?
If you still have that stash's SHA1, you can generate a patch from it (`git format-patch SHA1`) and apply the patch in reverse (`git apply -R filename.patch`). If you lost the SHA1, see [How to recover a dropped stash in Git?](https://stackoverflow.com/questions/89332/recover-dropped-stash-in-git)
14264467
How to recover the index after a git stash / git stash pop?
16
2013-01-10 18:08:54
<p>After adding some changes to the index with git add -p, I then issued a git stash but forgot to add --keep-index. Then I stupidly did a git stash pop, and all my changes to the index were gone. Is there a way to recover the index to the state before the git stash?</p>
5,656
823,078
2017-10-10 00:27:07
46,655,281
11
2017-10-09 21:31:25
3,075,942
2017-10-10 00:27:07
https://stackoverflow.com/q/14264467
https://stackoverflow.com/a/46655281
<p>When you've just done <code>git stash pop</code>, the last line in the output is:</p> <pre><code>Dropped refs/stash@{0} (ca82a6dff817ec66f44342007202690a93763949) </code></pre> <p>If you've lost it, see <a href="https://stackoverflow.com/a/91795">How to recover a dropped stash in Git?</a> to find the commit hash.<...
<p>When you've just done <code>git stash pop</code>, the last line in the output is:</p> <pre><code>Dropped refs/stash@{0} (ca82a6dff817ec66f44342007202690a93763949) </code></pre> <p>If you've lost it, see <a href="https://stackoverflow.com/a/91795">How to recover a dropped stash in Git?</a> to find the commit hash.<...
119, 13091
git, git-stash
<h1>How to recover the index after a git stash / git stash pop?</h1> <p>After adding some changes to the index with git add -p, I then issued a git stash but forgot to add --keep-index. Then I stupidly did a git stash pop, and all my changes to the index were gone. Is there a way to recover the index to the state befor...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,363
git
# How to recover the index after a git stash / git stash pop? After adding some changes to the index with git add -p, I then issued a git stash but forgot to add --keep-index. Then I stupidly did a git stash pop, and all my changes to the index were gone. Is there a way to recover the index to the state before the git...
When you've just done `git stash pop`, the last line in the output is: ``` Dropped refs/stash@{0} (ca82a6dff817ec66f44342007202690a93763949) ``` If you've lost it, see [How to recover a dropped stash in Git?](https://stackoverflow.com/a/91795) to find the commit hash. Once you have the hash, **either**: - Drop all ...
34899662
Git default merge commit message not including conflicts
16
2016-01-20 12:07:52
<p>After doing a merge from the <code>origin/base</code> branch into my <code>feature</code> branch, I had to resolve one conflict on the file <code>Parameter.java</code>. I launched my Git merge tool and I resolved it. Once it was resolved, I performed a <code>git commit</code> and this opened Vim with the default mer...
8,083
2,418,066
2018-10-20 05:05:59
34,996,199
11
2016-01-25 15:27:01
3,306,465
2016-01-26 21:54:33
https://stackoverflow.com/q/34899662
https://stackoverflow.com/a/34996199
<p>You can use the <code>prepare-commit-msg</code> hook to do so.</p> <p>Copy <code>.git/hooks/prepare-commit-msg.sample</code> to <code>.git/hooks/prepare-commit-msg</code></p> <p>The example inside it actually adds # to the Conflicts part:</p> <pre><code>case "$2,$3" in merge,) /usr/bin/perl -i.bak -ne 's/^/...
<p>You can use the <code>prepare-commit-msg</code> hook to do so.</p> <p>Copy <code>.git/hooks/prepare-commit-msg.sample</code> to <code>.git/hooks/prepare-commit-msg</code></p> <p>The example inside it actually adds # to the Conflicts part:</p> <pre><code>case "$2,$3" in merge,) /usr/bin/perl -i.bak -ne 's/^/...
119, 717, 5597
commit, git, merge
<h1>Git default merge commit message not including conflicts</h1> <p>After doing a merge from the <code>origin/base</code> branch into my <code>feature</code> branch, I had to resolve one conflict on the file <code>Parameter.java</code>. I launched my Git merge tool and I resolved it. Once it was resolved, I performed ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,364
git
# Git default merge commit message not including conflicts After doing a merge from the `origin/base` branch into my `feature` branch, I had to resolve one conflict on the file `Parameter.java`. I launched my Git merge tool and I resolved it. Once it was resolved, I performed a `git commit` and this opened Vim with th...
You can use the `prepare-commit-msg` hook to do so. Copy `.git/hooks/prepare-commit-msg.sample` to `.git/hooks/prepare-commit-msg` The example inside it actually adds # to the Conflicts part: ``` case "$2,$3" in merge,) /usr/bin/perl -i.bak -ne 's/^/# /, s/^# #/#/ if /^Conflicts/ .. /#/; print' "$1" ;; ``` Th...
34679725
Switch between Git and TFS source control in visual studio
16
2016-01-08 14:46:57
<p>I'm in a situation where I need to run both TFS and Git side by side. I will need to switch between the two. Git is installed and configure to run locally. TFS is run on a company server. How do I switch between the two environments in Visual Studio 2013?</p> <p>I am open to switching to VS 2015 if git integrat...
26,401
87,796
2017-10-24 07:46:21
34,680,279
11
2016-01-08 15:16:17
568,475
2016-01-08 15:16:17
https://stackoverflow.com/q/34679725
https://stackoverflow.com/a/34680279
<p>If you want to use a TFS workspace and also use GIT then you can switch between them using Team Explorer. Hit the "plug" looking item at the top of the screen and you can switch between them there. The screen shot is from VS 2015 but the UI hasn't changed much from 2013 </p> <p><a href="https://i.sstatic.net/wxwdb....
<p>If you want to use a TFS workspace and also use GIT then you can switch between them using Team Explorer. Hit the "plug" looking item at the top of the screen and you can switch between them there. The screen shot is from VS 2015 but the UI hasn't changed much from 2013 </p> <p><a href="https://i.sstatic.net/wxwdb....
119, 733, 93364
git, tfs, visual-studio-2013
<h1>Switch between Git and TFS source control in visual studio</h1> <p>I'm in a situation where I need to run both TFS and Git side by side. I will need to switch between the two. Git is installed and configure to run locally. TFS is run on a company server. How do I switch between the two environments in Visual St...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,365
git
# Switch between Git and TFS source control in visual studio I'm in a situation where I need to run both TFS and Git side by side. I will need to switch between the two. Git is installed and configure to run locally. TFS is run on a company server. How do I switch between the two environments in Visual Studio 2013? I...
If you want to use a TFS workspace and also use GIT then you can switch between them using Team Explorer. Hit the "plug" looking item at the top of the screen and you can switch between them there. The screen shot is from VS 2015 but the UI hasn't changed much from 2013 [![Team Explorer](https://i.sstatic.net/wxwdb.pn...
18122778
What Git '--progress' flag is for and how to use it
16
2013-08-08 09:44:18
<p>Today I have noticed in my IDE (IntelliJ) that when I do 'commit and push' from the IDE level I can see in the version control output tab that IntelliJ is using the following command:</p> <pre><code>git push --progress origin storyBranchA:storyBranchA </code></pre> <p>I wonder how I can use that 'progress' flag ou...
10,897
266,956
2013-08-08 13:08:15
18,123,717
11
2013-08-08 10:29:47
683,080
2013-08-08 13:08:15
https://stackoverflow.com/q/18122778
https://stackoverflow.com/a/18123717
<p>The <a href="http://git-scm.com/docs/git-push" rel="noreferrer">man page for <code>git push</code></a> seems to have documented the flag:</p> <blockquote> <p><code>--progress</code></p> <p>Progress status is reported on the standard error stream by default when it is attached to a terminal, unless <code>-q</code> is...
<p>The <a href="http://git-scm.com/docs/git-push" rel="noreferrer">man page for <code>git push</code></a> seems to have documented the flag:</p> <blockquote> <p><code>--progress</code></p> <p>Progress status is reported on the standard error stream by default when it is attached to a terminal, unless <code>-q</code> is...
119, 8945
git, intellij-idea
<h1>What Git '--progress' flag is for and how to use it</h1> <p>Today I have noticed in my IDE (IntelliJ) that when I do 'commit and push' from the IDE level I can see in the version control output tab that IntelliJ is using the following command:</p> <pre><code>git push --progress origin storyBranchA:storyBranchA </c...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,366
git
# What Git '--progress' flag is for and how to use it Today I have noticed in my IDE (IntelliJ) that when I do 'commit and push' from the IDE level I can see in the version control output tab that IntelliJ is using the following command: ``` git push --progress origin storyBranchA:storyBranchA ``` I wonder how I can...
The [man page for `git push`](http://git-scm.com/docs/git-push) seems to have documented the flag: > `--progress` > > Progress status is reported on the standard error stream by default when it is attached to a terminal, unless `-q` is specified. This flag forces progress status even if the standard error stream is no...
15163916
Git-svn - import full history
16
2013-03-01 17:53:50
<p><strong>Problem</strong></p> <p>By default <em>git svn clone</em> imports history only from branch creation onwards, despite the fact, that history for files is present in SVN repository prior branch creation.</p> <p>Our SVN branch was created by <code>svn copy</code>, if that matters.</p> <p><strong>My attempts<...
15,523
2,099,146
2018-05-17 09:59:41
15,169,641
11
2013-03-02 01:31:00
43,681
2013-03-04 23:59:19
https://stackoverflow.com/q/15163916
https://stackoverflow.com/a/15169641
<blockquote> <p>By default git svn clone imports history only from branch creation onwards, despite the fact, that history for files is present in svn repository prior branch creation.</p> </blockquote> <p>Yes. that is true. <code>git svn</code> will only try to import branches as branches if it is told so. From...
<blockquote> <p>By default git svn clone imports history only from branch creation onwards, despite the fact, that history for files is present in svn repository prior branch creation.</p> </blockquote> <p>Yes. that is true. <code>git svn</code> will only try to import branches as branches if it is told so. From...
63, 119, 6452
git, git-svn, svn
<h1>Git-svn - import full history</h1> <p><strong>Problem</strong></p> <p>By default <em>git svn clone</em> imports history only from branch creation onwards, despite the fact, that history for files is present in SVN repository prior branch creation.</p> <p>Our SVN branch was created by <code>svn copy</code>, if tha...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,367
git
# Git-svn - import full history **Problem** By default *git svn clone* imports history only from branch creation onwards, despite the fact, that history for files is present in SVN repository prior branch creation. Our SVN branch was created by `svn copy`, if that matters. **My attempts** I've tried `--no-minimize...
> By default git svn clone imports history only from branch creation > onwards, despite the fact, that history for files is present in svn > repository prior branch creation. Yes. that is true. `git svn` will only try to import branches as branches if it is told so. From the manpage of git-svn: > When cloning an SVN ...
12658838
Git error when pushing: object 15abe3addde5ad5f7d25e8f0f220d2e9faf3cb22:contains entries pointing to null
16
2012-09-30 05:16:41
<p>I'm not sure how I have got myself into this mess. But I am running into <code>error: object 15abe3addde5ad5f7d25e8f0f220d2e9faf3cb22:contains entries pointing to null</code> when trying to push my repository to GitHub. The full push: <pre>[ashinn@puppet1 puppet]$ git push Counting objects: 27, done. Delta compressi...
7,045
684,908
2014-08-25 20:11:29
14,739,771
11
2013-02-06 22:05:55
684,908
2014-08-25 20:11:29
https://stackoverflow.com/q/12658838
https://stackoverflow.com/a/14739771
<p>I was able to finally solve this issue. Here is what I did to solve it:</p> <p>In article <a href="https://help.github.com/articles/remove-sensitive-data" rel="noreferrer">https://help.github.com/articles/remove-sensitive-data</a> there is a heading for <strong>Purge the file from your repo</strong>. I following th...
<p>I was able to finally solve this issue. Here is what I did to solve it:</p> <p>In article <a href="https://help.github.com/articles/remove-sensitive-data" rel="noreferrer">https://help.github.com/articles/remove-sensitive-data</a> there is a heading for <strong>Purge the file from your repo</strong>. I following th...
119, 456, 41612
git, git-submodules, version-control
<h1>Git error when pushing: object 15abe3addde5ad5f7d25e8f0f220d2e9faf3cb22:contains entries pointing to null</h1> <p>I'm not sure how I have got myself into this mess. But I am running into <code>error: object 15abe3addde5ad5f7d25e8f0f220d2e9faf3cb22:contains entries pointing to null</code> when trying to push my repo...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,368
git
# Git error when pushing: object 15abe3addde5ad5f7d25e8f0f220d2e9faf3cb22:contains entries pointing to null I'm not sure how I have got myself into this mess. But I am running into `error: object 15abe3addde5ad5f7d25e8f0f220d2e9faf3cb22:contains entries pointing to null` when trying to push my repository to GitHub. Th...
I was able to finally solve this issue. Here is what I did to solve it: In article <https://help.github.com/articles/remove-sensitive-data> there is a heading for **Purge the file from your repo**. I following their example for removing the Rakefile but used the problematic folder instead: `git filter-branch --index-...
1983254
Git to TFS Source Control Migration
16
2009-12-31 00:13:55
<p>I'd like to see how TFS will work for my command. So I'd like to move our current GIT repository to TFS database. We've used GIT for it's prevailed branching support so I'd like to use TFS 2010 to address that issue.</p> <p>Now question is. How do I export our GIT repo to TFS. Obviously it's some kind of script. Do...
9,879
2,313
2016-11-27 17:13:47
11,966,977
11
2012-08-15 09:32:12
7,093
2012-08-15 09:41:38
https://stackoverflow.com/q/1983254
https://stackoverflow.com/a/11966977
<p>Microsoft have now released their own GIT &lt;--> TFS extension for GIT: <a href="http://gittf.codeplex.com/" rel="nofollow noreferrer">GIT-TF</a></p> <p>This allows pulling a new GIT repository from TFS or configuring to allow GIT to TFS pushes, which is what you want to do:</p> <p>(from the documentation)</p> <...
<p>Microsoft have now released their own GIT &lt;--> TFS extension for GIT: <a href="http://gittf.codeplex.com/" rel="nofollow noreferrer">GIT-TF</a></p> <p>This allows pulling a new GIT repository from TFS or configuring to allow GIT to TFS pushes, which is what you want to do:</p> <p>(from the documentation)</p> <...
119, 456, 733, 101396
git, tfs, tfs-migration, version-control
<h1>Git to TFS Source Control Migration</h1> <p>I'd like to see how TFS will work for my command. So I'd like to move our current GIT repository to TFS database. We've used GIT for it's prevailed branching support so I'd like to use TFS 2010 to address that issue.</p> <p>Now question is. How do I export our GIT repo t...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,369
git
# Git to TFS Source Control Migration I'd like to see how TFS will work for my command. So I'd like to move our current GIT repository to TFS database. We've used GIT for it's prevailed branching support so I'd like to use TFS 2010 to address that issue. Now question is. How do I export our GIT repo to TFS. Obviously...
Microsoft have now released their own GIT <--> TFS extension for GIT: [GIT-TF](http://gittf.codeplex.com/) This allows pulling a new GIT repository from TFS or configuring to allow GIT to TFS pushes, which is what you want to do: (from the documentation) > For a team working with an existing Git repo, a developer sh...
5837921
git-flow: how to checkout release branch from origin?
16
2011-04-29 22:11:35
<p>What is the perferred workflow to pull a published release branch from the central repo using <a href="https://github.com/nvie/gitflow" rel="noreferrer">git-flow</a>?</p> <p>eg:<br> Mike made a release branch, he published it through "git flow release publish 1.0"<br> Jane would like to work on that release branch ...
28,866
187,018
2013-11-22 20:37:09
6,661,693
11
2011-07-12 08:57:18
187,018
2011-07-12 08:57:18
https://stackoverflow.com/q/5837921
https://stackoverflow.com/a/6661693
<p>All that is needed is setting up a local tracking branch, no git-flow specific commands are needed. Git-flow apparently only cares about the name of the branch and if it is prefixed with the "release/" string.</p> <p>So setting up a local tracking branch like <code>git branch --track release/1.5 origin/release/1.5<...
<p>All that is needed is setting up a local tracking branch, no git-flow specific commands are needed. Git-flow apparently only cares about the name of the branch and if it is prefixed with the "release/" string.</p> <p>So setting up a local tracking branch like <code>git branch --track release/1.5 origin/release/1.5<...
119, 64339, 76220
git, git-branch, git-flow
<h1>git-flow: how to checkout release branch from origin?</h1> <p>What is the perferred workflow to pull a published release branch from the central repo using <a href="https://github.com/nvie/gitflow" rel="noreferrer">git-flow</a>?</p> <p>eg:<br> Mike made a release branch, he published it through "git flow release p...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,371
git
# git-flow: how to checkout release branch from origin? What is the perferred workflow to pull a published release branch from the central repo using [git-flow](https://github.com/nvie/gitflow)? eg: Mike made a release branch, he published it through "git flow release publish 1.0" Jane would like to work on that ...
All that is needed is setting up a local tracking branch, no git-flow specific commands are needed. Git-flow apparently only cares about the name of the branch and if it is prefixed with the "release/" string. So setting up a local tracking branch like `git branch --track release/1.5 origin/release/1.5` is all there i...
6013261
Disable Git Rename Detection
16
2011-05-16 04:47:18
<ol> <li>I have a file, <code>foo.txt</code></li> <li>Create and checkout branch 'branch_A'</li> <li><code>git mv foo.txt bar.txt</code> followed by <code>git add -A</code> then <code>git commit -m "renamed foo.txt"</code></li> <li>Checkout master, <code>git checkout master</code></li> <li>remove foo.txt and commit.</l...
20,877
615,315
2023-03-01 11:38:44
6,013,497
11
2011-05-16 05:27:18
526,535
2023-03-01 11:38:44
https://stackoverflow.com/q/6013261
https://stackoverflow.com/a/6013497
<p>Can you try with:</p> <pre><code>git merge -s resolve branch_A </code></pre> <p>This will enable <em>resolve</em> merge strategy, which does not try to detect renames:</p> <blockquote> <p><code>resolve</code></p> <p>This can only resolve two heads (i.e. the current branch and another branch you pulled from) using a ...
<p>Can you try with:</p> <pre><code>git merge -s resolve branch_A </code></pre> <p>This will enable <em>resolve</em> merge strategy, which does not try to detect renames:</p> <blockquote> <p><code>resolve</code></p> <p>This can only resolve two heads (i.e. the current branch and another branch you pulled from) using a ...
119, 717, 4510
git, merge, rename
<h1>Disable Git Rename Detection</h1> <ol> <li>I have a file, <code>foo.txt</code></li> <li>Create and checkout branch 'branch_A'</li> <li><code>git mv foo.txt bar.txt</code> followed by <code>git add -A</code> then <code>git commit -m "renamed foo.txt"</code></li> <li>Checkout master, <code>git checkout master</code><...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,372
git
# Disable Git Rename Detection 1. I have a file, `foo.txt` 2. Create and checkout branch 'branch_A' 3. `git mv foo.txt bar.txt` followed by `git add -A` then `git commit -m "renamed foo.txt"` 4. Checkout master, `git checkout master` 5. remove foo.txt and commit. 6. Now merge branch_A, `git merge branch_A` And with t...
Can you try with: ``` git merge -s resolve branch_A ``` This will enable *resolve* merge strategy, which does not try to detect renames: > `resolve` > > This can only resolve two heads (i.e. the current branch and another branch you pulled from) using a 3-way merge algorithm. It tries to carefully detect criss-cross...
2919517
Google App Engine and Git best practices
16
2010-05-27 08:25:21
<p>I'm developing a small pet project on Google App Engine and I would like to keep the source code under source control using <a href="http://www.github.com" rel="noreferrer">github</a>; this will allow a friend of mine to checkout and modify the sources.</p> <p>I just have a <code>PetProject</code> directory with al...
7,465
130,929
2012-01-18 16:38:37
2,919,644
11
2010-05-27 08:44:34
6,309
2010-05-28 18:19:23
https://stackoverflow.com/q/2919517
https://stackoverflow.com/a/2919644
<p>You can create a git repo directly within your current PetProject directory. </p> <p>One trick would be to clone your new (and empty) GitHub repo in a local directory, and then copy the <code>.git</code> subdirectory in your PetProject directory.<br> That way, you have a Git repo already connected to a remote GitH...
<p>You can create a git repo directly within your current PetProject directory. </p> <p>One trick would be to clone your new (and empty) GitHub repo in a local directory, and then copy the <code>.git</code> subdirectory in your PetProject directory.<br> That way, you have a Git repo already connected to a remote GitH...
119, 984
git, google-app-engine
<h1>Google App Engine and Git best practices</h1> <p>I'm developing a small pet project on Google App Engine and I would like to keep the source code under source control using <a href="http://www.github.com" rel="noreferrer">github</a>; this will allow a friend of mine to checkout and modify the sources.</p> <p>I jus...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,374
git
# Google App Engine and Git best practices I'm developing a small pet project on Google App Engine and I would like to keep the source code under source control using [github](http://www.github.com); this will allow a friend of mine to checkout and modify the sources. I just have a `PetProject` directory with all the...
You can create a git repo directly within your current PetProject directory. One trick would be to clone your new (and empty) GitHub repo in a local directory, and then copy the `.git` subdirectory in your PetProject directory. That way, you have a Git repo already connected to a remote GitHub upstream repo. Modify...
2219424
How to push/pull Git rebase
16
2010-02-08 03:38:26
<p>I'd like to use <code>git rebase</code> so as to cleanly merge a feature in the master branch (in less commits or at least at the top of the change log). Note that <em>I'm the only one working on the repository</em>.</p> <p>After reading <a href="https://stackoverflow.com/questions/457927/git-workflow-and-rebase-vs...
25,039
167,897
2010-02-10 18:06:39
2,219,681
11
2010-02-08 05:01:19
123,109
2010-02-08 05:01:19
https://stackoverflow.com/q/2219424
https://stackoverflow.com/a/2219681
<p>Remember that <code>git rebase</code> replays changes and creates new commits. By rebasing and forcing pushes all over the place, you're going against the grain of the tool. Note how the <a href="http://kernel.org/pub/software/scm/git/docs/git-rebase.html#_recovering_from_upstream_rebase" rel="noreferrer">"Recoverin...
<p>Remember that <code>git rebase</code> replays changes and creates new commits. By rebasing and forcing pushes all over the place, you're going against the grain of the tool. Note how the <a href="http://kernel.org/pub/software/scm/git/docs/git-rebase.html#_recovering_from_upstream_rebase" rel="noreferrer">"Recoverin...
119, 28896, 28897, 29934
git, git-merge, git-pull, git-rebase
<h1>How to push/pull Git rebase</h1> <p>I'd like to use <code>git rebase</code> so as to cleanly merge a feature in the master branch (in less commits or at least at the top of the change log). Note that <em>I'm the only one working on the repository</em>.</p> <p>After reading <a href="https://stackoverflow.com/questi...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,375
git
# How to push/pull Git rebase I'd like to use `git rebase` so as to cleanly merge a feature in the master branch (in less commits or at least at the top of the change log). Note that *I'm the only one working on the repository*. After reading [Git workflow and rebase vs merge questions](https://stackoverflow.com/ques...
Remember that `git rebase` replays changes and creates new commits. By rebasing and forcing pushes all over the place, you're going against the grain of the tool. Note how the ["Recovering from an upstream rebase"](http://kernel.org/pub/software/scm/git/docs/git-rebase.html#_recovering_from_upstream_rebase) section of ...
75949578
How to fix Git for Windows keeps asking for Github credentials
15
2023-04-06 12:34:00
<p>I always clone private Github repos via HTTPS. I have personal access token to use as &quot;password&quot; when git asked for it for the first time.</p> <p>For a very long time, I was able to do git operations without git asking for credentials for every single command when I run things in command line.</p> <p>But t...
17,389
6,521,181
2024-05-18 21:36:07
76,035,763
11
2023-04-17 13:35:50
6,521,181
2023-04-17 13:35:50
https://stackoverflow.com/q/75949578
https://stackoverflow.com/a/76035763
<p>I finally found the root cause</p> <p>Apparently it is because <code>git-credential-manager.exe</code> is not found in <code>PATH</code></p> <p>Once I do <code>set PATH=C:\Git\mingw64\bin;%PATH%</code> and do one <code>git push</code>, I am prompted with web browser Github login, and then things just work now</p>
<p>I finally found the root cause</p> <p>Apparently it is because <code>git-credential-manager.exe</code> is not found in <code>PATH</code></p> <p>Once I do <code>set PATH=C:\Git\mingw64\bin;%PATH%</code> and do one <code>git push</code>, I am prompted with web browser Github login, and then things just work now</p>
64, 119
git, windows
<h1>How to fix Git for Windows keeps asking for Github credentials</h1> <p>I always clone private Github repos via HTTPS. I have personal access token to use as &quot;password&quot; when git asked for it for the first time.</p> <p>For a very long time, I was able to do git operations without git asking for credentials ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,376
git
# How to fix Git for Windows keeps asking for Github credentials I always clone private Github repos via HTTPS. I have personal access token to use as "password" when git asked for it for the first time. For a very long time, I was able to do git operations without git asking for credentials for every single command ...
I finally found the root cause Apparently it is because `git-credential-manager.exe` is not found in `PATH` Once I do `set PATH=C:\Git\mingw64\bin;%PATH%` and do one `git push`, I am prompted with web browser Github login, and then things just work now
40452848
Visual Studio Code - Automatic exclude based on .gitignore
15
2016-11-06 18:18:46
<p>I'd like VSCode to automatically exclude files/folders based on my <code>.gitignore</code> configuration.</p> <p>For the explorer exclusion I've found an extension (<code>explorer-excluded-files</code> which manages the <code>files.exclude</code> setting), but for the quick open file (<code>cmd + p</code>) I didn't...
12,151
36,821
2022-05-31 19:07:59
51,680,077
11
2018-08-03 21:06:50
6,309
2022-05-31 19:07:59
https://stackoverflow.com/q/40452848
https://stackoverflow.com/a/51680077
<p>Regarding the explorer, in addition of the existing plugin you have found, there is a request in progress: <a href="https://github.com/Microsoft/vscode/issues/38878" rel="noreferrer"><code>Microsoft/vscode</code> issue 38878</a></p> <p>But regarding Quick Open, <a href="https://github.com/Microsoft/vscode/issues/414...
<p>Regarding the explorer, in addition of the existing plugin you have found, there is a request in progress: <a href="https://github.com/Microsoft/vscode/issues/38878" rel="noreferrer"><code>Microsoft/vscode</code> issue 38878</a></p> <p>But regarding Quick Open, <a href="https://github.com/Microsoft/vscode/issues/414...
25056, 111608
gitignore, visual-studio-code
<h1>Visual Studio Code - Automatic exclude based on .gitignore</h1> <p>I'd like VSCode to automatically exclude files/folders based on my <code>.gitignore</code> configuration.</p> <p>For the explorer exclusion I've found an extension (<code>explorer-excluded-files</code> which manages the <code>files.exclude</code> s...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,378
git
# Visual Studio Code - Automatic exclude based on .gitignore I'd like VSCode to automatically exclude files/folders based on my `.gitignore` configuration. For the explorer exclusion I've found an extension (`explorer-excluded-files` which manages the `files.exclude` setting), but for the quick open file (`cmd + p`) ...
Regarding the explorer, in addition of the existing plugin you have found, there is a request in progress: [`Microsoft/vscode` issue 38878](https://github.com/Microsoft/vscode/issues/38878) But regarding Quick Open, [issue 41495](https://github.com/Microsoft/vscode/issues/41495) includes the comment: > Are those file...
24447047
Remove git-annex repository from file tree
15
2014-06-27 08:13:38
<p>I tried installing git-annex yesterday to backup my files. I ran <code>git annex add .</code> in the root of my repository tree and then a <code>git commit</code>. So far everything is fine.</p> <p>What I didn't know git-annex was doing was turning my entire file tree into a whole bunch of symlinks. Every single...
4,410
1,407,170
2018-12-16 09:10:07
24,464,323
11
2014-06-28 06:39:15
1,407,170
2014-06-28 06:39:15
https://stackoverflow.com/q/24447047
https://stackoverflow.com/a/24464323
<p>Okay, so I stumbled upon some <a href="http://dev.man-online.org/man1/git-annex/" rel="noreferrer">docs for git-annex</a>, and they give two commands that achieve what I wanted to do:</p> <blockquote> <p><strong>unannex [path ...]</strong></p> <p>Use this to undo an accidental git annex add command. You can ...
<p>Okay, so I stumbled upon some <a href="http://dev.man-online.org/man1/git-annex/" rel="noreferrer">docs for git-annex</a>, and they give two commands that achieve what I wanted to do:</p> <blockquote> <p><strong>unannex [path ...]</strong></p> <p>Use this to undo an accidental git annex add command. You can ...
58, 119, 1122, 91745
git, git-annex, linux, symlink
<h1>Remove git-annex repository from file tree</h1> <p>I tried installing git-annex yesterday to backup my files. I ran <code>git annex add .</code> in the root of my repository tree and then a <code>git commit</code>. So far everything is fine.</p> <p>What I didn't know git-annex was doing was turning my entire fil...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,379
git
# Remove git-annex repository from file tree I tried installing git-annex yesterday to backup my files. I ran `git annex add .` in the root of my repository tree and then a `git commit`. So far everything is fine. What I didn't know git-annex was doing was turning my entire file tree into a whole bunch of symlinks. E...
Okay, so I stumbled upon some [docs for git-annex](http://dev.man-online.org/man1/git-annex/), and they give two commands that achieve what I wanted to do: > **unannex [path ...]** > > Use this to undo an accidental git annex add command. You can use git annex unannex to move content out of the annex at any point, eve...
12457517
git merge repeating conflicts
15
2012-09-17 10:35:33
<p>I have a branch <code>master</code> and a branch <code>feature</code> which was checked out from <code>master</code>.</p> <p><code>master</code> gets commits pushed into it from other developers and I regularly merge <code>master</code> back into <code>feature</code>, so that it keeps up with new developments from ...
3,952
693,154
2024-08-22 06:55:08
12,457,571
11
2012-09-17 10:39:30
1,119,701
2016-11-24 10:23:45
https://stackoverflow.com/q/12457517
https://stackoverflow.com/a/12457571
<p>First consider not merging integration branches into feature branches.</p> <p>Second have a look to <a href="http://gitster.livejournal.com/41795.html" rel="noreferrer">git rerere</a> command and use it:</p> <pre><code>$ git config --global rerere.enabled true </code></pre> <blockquote> <p>NAME</p> <pre><code>...
<p>First consider not merging integration branches into feature branches.</p> <p>Second have a look to <a href="http://gitster.livejournal.com/41795.html" rel="noreferrer">git rerere</a> command and use it:</p> <pre><code>$ git config --global rerere.enabled true </code></pre> <blockquote> <p>NAME</p> <pre><code>...
119, 717
git, merge
<h1>git merge repeating conflicts</h1> <p>I have a branch <code>master</code> and a branch <code>feature</code> which was checked out from <code>master</code>.</p> <p><code>master</code> gets commits pushed into it from other developers and I regularly merge <code>master</code> back into <code>feature</code>, so that ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,380
git
# git merge repeating conflicts I have a branch `master` and a branch `feature` which was checked out from `master`. `master` gets commits pushed into it from other developers and I regularly merge `master` back into `feature`, so that it keeps up with new developments from other branches. However, I keep getting th...
First consider not merging integration branches into feature branches. Second have a look to [git rerere](http://gitster.livejournal.com/41795.html) command and use it: ``` $ git config --global rerere.enabled true ``` > NAME > > ``` > git-rerere - Reuse recorded resolution of conflicted merges > ``` > > DESCRIPTI...
11498059
Strange .gitignore behavior for emacs temporary files
15
2012-07-16 04:23:43
<p>If I edit <code>new_file.txt</code> with emacs, there will be temporary files like <code>#new_file.txt#</code> and <code>.#new_file.txt</code> when the files are unsaved, and <code>new_file.txt~</code> when saved. I want to exclude these files. So I write my <code>.gitignore</code> like this:</p> <pre><code>#This ...
4,504
1,527,875
2013-04-04 21:35:52
11,498,417
11
2012-07-16 05:10:08
815,632
2012-07-16 05:10:08
https://stackoverflow.com/q/11498059
https://stackoverflow.com/a/11498417
<p>Comments on <code>.gitignore</code> files must be on their own line - any comment trailing a file pattern is interpreted as part of that pattern.</p> <p>Move your comments to the line before the pattern, and it should return to its initial behavior.</p>
<p>Comments on <code>.gitignore</code> files must be on their own line - any comment trailing a file pattern is interpreted as part of that pattern.</p> <p>Move your comments to the line before the pattern, and it should return to its initial behavior.</p>
119, 371
emacs, git
<h1>Strange .gitignore behavior for emacs temporary files</h1> <p>If I edit <code>new_file.txt</code> with emacs, there will be temporary files like <code>#new_file.txt#</code> and <code>.#new_file.txt</code> when the files are unsaved, and <code>new_file.txt~</code> when saved. I want to exclude these files. So I wri...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,381
git
# Strange .gitignore behavior for emacs temporary files If I edit `new_file.txt` with emacs, there will be temporary files like `#new_file.txt#` and `.#new_file.txt` when the files are unsaved, and `new_file.txt~` when saved. I want to exclude these files. So I write my `.gitignore` like this: ``` #This is a comment ...
Comments on `.gitignore` files must be on their own line - any comment trailing a file pattern is interpreted as part of that pattern. Move your comments to the line before the pattern, and it should return to its initial behavior.
10753330
Moving master head to a branch
15
2012-05-25 11:05:53
<p>I have several feature branches and a master branch. Feature2 is done. Normally I would rebase (working with a remote SVN repo and would like to keep the history, so no regular merge) and ff-merge. But since master hasnt changed since I branched, I would like to move the master head (at <code>E</code>) to <code>G</c...
23,057
216,021
2012-05-25 22:29:16
10,762,046
11
2012-05-25 22:29:16
1,407,067
2012-05-25 22:29:16
https://stackoverflow.com/q/10753330
https://stackoverflow.com/a/10762046
<p>A regular merge of G into master will do the trick, no need to rebase:</p> <pre><code> feature1 C-D / master A-B-E \ feature2 F-G git checkout master git merge feature2 feature1 C-D ...
<p>A regular merge of G into master will do the trick, no need to rebase:</p> <pre><code> feature1 C-D / master A-B-E \ feature2 F-G git checkout master git merge feature2 feature1 C-D ...
119, 456, 1879, 3346, 53847
branch, branching-and-merging, dvcs, git, version-control
<h1>Moving master head to a branch</h1> <p>I have several feature branches and a master branch. Feature2 is done. Normally I would rebase (working with a remote SVN repo and would like to keep the history, so no regular merge) and ff-merge. But since master hasnt changed since I branched, I would like to move the maste...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,382
git
# Moving master head to a branch I have several feature branches and a master branch. Feature2 is done. Normally I would rebase (working with a remote SVN repo and would like to keep the history, so no regular merge) and ff-merge. But since master hasnt changed since I branched, I would like to move the master head (a...
A regular merge of G into master will do the trick, no need to rebase: ``` feature1 C-D / master A-B-E \ feature2 F-G git checkout master git merge feature2 feature1 C-D / ...
8566429
Can git be configured to disable merges for particular file types?
15
2011-12-19 19:30:36
<p>For example, Apple's Interface Builder file format (<code>xib</code>) is, for all practical purposes, impossible to merge. However, because it's a text format, git will happily try to merge files of this type, and this will almost certainly result in corruption if git "succeeds".</p> <p>Can git be configured to <em...
1,619
26,628
2011-12-19 19:53:08
8,566,625
11
2011-12-19 19:46:43
1,080,745
2011-12-19 19:53:08
https://stackoverflow.com/q/8566429
https://stackoverflow.com/a/8566625
<p>Yes. There is a great file called <code>.gitattributes</code>, which allows you to set individual properties for files in your git project. For your purposes, you would fill your <code>.gitattributes</code> with this line</p> <pre><code>*.xib -crlf -diff </code></pre> <p>This turns off line-feed correction and dis...
<p>Yes. There is a great file called <code>.gitattributes</code>, which allows you to set individual properties for files in your git project. For your purposes, you would fill your <code>.gitattributes</code> with this line</p> <pre><code>*.xib -crlf -diff </code></pre> <p>This turns off line-feed correction and dis...
119
git
<h1>Can git be configured to disable merges for particular file types?</h1> <p>For example, Apple's Interface Builder file format (<code>xib</code>) is, for all practical purposes, impossible to merge. However, because it's a text format, git will happily try to merge files of this type, and this will almost certainly ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,383
git
# Can git be configured to disable merges for particular file types? For example, Apple's Interface Builder file format (`xib`) is, for all practical purposes, impossible to merge. However, because it's a text format, git will happily try to merge files of this type, and this will almost certainly result in corruption...
Yes. There is a great file called `.gitattributes`, which allows you to set individual properties for files in your git project. For your purposes, you would fill your `.gitattributes` with this line ``` *.xib -crlf -diff ``` This turns off line-feed correction and disables diff on this file. You can read a little mo...
55703344
How to get latest commit hash from remote?
14
2019-04-16 08:03:49
<p>I wish to retrieve the latest commit hash on the remote repository, regardless of branch.</p> <p>I've tried <code>git ls-remote &lt;remote&gt;</code> and <code>git ls-remote --tags &lt;remote&gt;</code> but both of these seemingly sort by tag name, which does not make it possible to find out which is the latest.</p...
26,189
5,010,082
2023-12-14 23:09:29
55,704,573
11
2019-04-16 09:12:32
2,298,385
2019-04-16 09:12:32
https://stackoverflow.com/q/55703344
https://stackoverflow.com/a/55704573
<p>Recent versions of git (don't know which - 2.14 didn't, 2.21 does) allow a "--sort" option in ls-remote. You can easily do:</p> <pre><code>git ls-remote --sort=committerdate </code></pre> <p>But be aware - if it is necessary to look into objects to achieve the sorting (as in the above example), the objects must be...
<p>Recent versions of git (don't know which - 2.14 didn't, 2.21 does) allow a "--sort" option in ls-remote. You can easily do:</p> <pre><code>git ls-remote --sort=committerdate </code></pre> <p>But be aware - if it is necessary to look into objects to achieve the sorting (as in the above example), the objects must be...
119
git
<h1>How to get latest commit hash from remote?</h1> <p>I wish to retrieve the latest commit hash on the remote repository, regardless of branch.</p> <p>I've tried <code>git ls-remote &lt;remote&gt;</code> and <code>git ls-remote --tags &lt;remote&gt;</code> but both of these seemingly sort by tag name, which does not ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,386
git
# How to get latest commit hash from remote? I wish to retrieve the latest commit hash on the remote repository, regardless of branch. I've tried `git ls-remote <remote>` and `git ls-remote --tags <remote>` but both of these seemingly sort by tag name, which does not make it possible to find out which is the latest. ...
Recent versions of git (don't know which - 2.14 didn't, 2.21 does) allow a "--sort" option in ls-remote. You can easily do: ``` git ls-remote --sort=committerdate ``` But be aware - if it is necessary to look into objects to achieve the sorting (as in the above example), the objects must be locally available. Otherwi...
10693820
Is it possible to do a shallow git clone based on datetime?
14
2012-05-21 23:13:58
<p>I know I can do a shallow clone by specifying the <code>--depth</code> flag. However, this takes in an integer as its value. Is there any way to have the identical behavior with a <code>datetime</code>? I do not wish to clone the entire repository and checkout a previous state.</p>
4,668
1,394,473
2020-09-14 09:31:55
39,994,584
11
2016-10-12 09:02:30
6,309
2020-09-14 09:31:55
https://stackoverflow.com/q/10693820
https://stackoverflow.com/a/39994584
<p>Why yes it is. At least only with Git 2.11 (Q4 2016)</p> <p>See <a href="https://github.com/git/git/commit/cccf74e2da85808478c784e403a69bbfe2b9f518" rel="noreferrer">commit cccf74e</a>, <a href="https://github.com/git/git/commit/079aa97e24daff1329f041e00ba621b0afd59163" rel="noreferrer">commit 079aa97</a>, <a href="...
<p>Why yes it is. At least only with Git 2.11 (Q4 2016)</p> <p>See <a href="https://github.com/git/git/commit/cccf74e2da85808478c784e403a69bbfe2b9f518" rel="noreferrer">commit cccf74e</a>, <a href="https://github.com/git/git/commit/079aa97e24daff1329f041e00ba621b0afd59163" rel="noreferrer">commit 079aa97</a>, <a href="...
119, 5002, 34099
date, git, git-clone
<h1>Is it possible to do a shallow git clone based on datetime?</h1> <p>I know I can do a shallow clone by specifying the <code>--depth</code> flag. However, this takes in an integer as its value. Is there any way to have the identical behavior with a <code>datetime</code>? I do not wish to clone the entire repository ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,387
git
# Is it possible to do a shallow git clone based on datetime? I know I can do a shallow clone by specifying the `--depth` flag. However, this takes in an integer as its value. Is there any way to have the identical behavior with a `datetime`? I do not wish to clone the entire repository and checkout a previous state.
Why yes it is. At least only with Git 2.11 (Q4 2016) See [commit cccf74e](https://github.com/git/git/commit/cccf74e2da85808478c784e403a69bbfe2b9f518), [commit 079aa97](https://github.com/git/git/commit/079aa97e24daff1329f041e00ba621b0afd59163), [commit 2997178](https://github.com/git/git/commit/2997178ee63c76a4c449f35...
35379277
Why does git log with --follow and --reverse return only last commit?
14
2016-02-13 11:28:55
<p>I wanted to view all the commits of a file from the beginning in reverse I ran </p> <pre><code>git log --reverse [file] </code></pre> <p>And it worked as expected. but for a renamed file it shows only from the commit in which it was renamed so I added --follow in it.</p> <pre><code>git log --reverse --follow [fi...
1,493
3,623,892
2023-05-05 15:37:29
35,380,344
11
2016-02-13 13:15:17
724,411
2023-05-05 15:37:29
https://stackoverflow.com/q/35379277
https://stackoverflow.com/a/35380344
<p>This seems to be <a href="https://lore.kernel.org/git/20130524012324.295dec77@hugo.daonet.home/" rel="nofollow noreferrer">known bug</a> in git. The only work around I can see is if you know what the file was named before, pass it along with the current file to the command, i.e.</p> <pre><code> git log --reverse --f...
<p>This seems to be <a href="https://lore.kernel.org/git/20130524012324.295dec77@hugo.daonet.home/" rel="nofollow noreferrer">known bug</a> in git. The only work around I can see is if you know what the file was named before, pass it along with the current file to the command, i.e.</p> <pre><code> git log --reverse --f...
119
git
<h1>Why does git log with --follow and --reverse return only last commit?</h1> <p>I wanted to view all the commits of a file from the beginning in reverse I ran </p> <pre><code>git log --reverse [file] </code></pre> <p>And it worked as expected. but for a renamed file it shows only from the commit in which it was re...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,389
git
# Why does git log with --follow and --reverse return only last commit? I wanted to view all the commits of a file from the beginning in reverse I ran ``` git log --reverse [file] ``` And it worked as expected. but for a renamed file it shows only from the commit in which it was renamed so I added --follow in it. `...
This seems to be [known bug](https://lore.kernel.org/git/20130524012324.295dec77@hugo.daonet.home/) in git. The only work around I can see is if you know what the file was named before, pass it along with the current file to the command, i.e. ``` git log --reverse --follow -- oldfilename currentfilename ``` **Edit:*...
26368703
git status of another remote
14
2014-10-14 19:23:01
<p>I added a second remote by issuing:</p> <pre><code>git remote add stash ... </code></pre> <p>However, when I do </p> <pre><code>git status </code></pre> <p>It checks for the status of origin/master. How can I issue a git status to check for the status of the second remote, in this case "stash". I tried the follo...
8,480
3,088,280
2014-10-15 01:03:23
26,372,834
11
2014-10-15 01:03:23
4,021,077
2014-10-15 01:03:23
https://stackoverflow.com/q/26368703
https://stackoverflow.com/a/26372834
<p><code>git status</code> uses the configured information for the branch in the repository config file ( (repo)/.git/config) to show status.</p> <p>If you wish to change that, you will need to change what your branch is tracking. You can do that a variety of ways. For newer versions of git use</p> <p><code>git bra...
<p><code>git status</code> uses the configured information for the branch in the repository config file ( (repo)/.git/config) to show status.</p> <p>If you wish to change that, you will need to change what your branch is tracking. You can do that a variety of ways. For newer versions of git use</p> <p><code>git bra...
119, 6951
git, status
<h1>git status of another remote</h1> <p>I added a second remote by issuing:</p> <pre><code>git remote add stash ... </code></pre> <p>However, when I do </p> <pre><code>git status </code></pre> <p>It checks for the status of origin/master. How can I issue a git status to check for the status of the second remote, i...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,391
git
# git status of another remote I added a second remote by issuing: ``` git remote add stash ... ``` However, when I do ``` git status ``` It checks for the status of origin/master. How can I issue a git status to check for the status of the second remote, in this case "stash". I tried the following commands, but t...
`git status` uses the configured information for the branch in the repository config file ( (repo)/.git/config) to show status. If you wish to change that, you will need to change what your branch is tracking. You can do that a variety of ways. For newer versions of git use `git branch --set-upstream-to=stash/master`...
18301284
Git Commit Parents' Order
14
2013-08-18 16:30:59
<p>Is there some convention for the order of a commit's parents?</p> <p>Because one of the commit's parents should be to be to <em>previous commit on the current branch</em> that is being merged into and the rest are <em>previous commits of the other merging branches</em>.</p> <p>I would like to <strong>identify the ...
3,817
220,710
2020-07-09 05:37:42
18,301,726
11
2013-08-18 17:19:57
1,370,215
2013-08-18 17:19:57
https://stackoverflow.com/q/18301284
https://stackoverflow.com/a/18301726
<p><code>libgit2</code> and its bindings return the parents in the order that they're stored in the commit, which is the order of the commits as they were given on e.g. the command-line for <code>git merge</code>, and it's a constant that the first parent is the current commit when creating a new one (either through me...
<p><code>libgit2</code> and its bindings return the parents in the order that they're stored in the commit, which is the order of the commits as they were given on e.g. the command-line for <code>git merge</code>, and it's a constant that the first parent is the current commit when creating a new one (either through me...
119, 66800, 91899
git, libgit2, pygit2
<h1>Git Commit Parents' Order</h1> <p>Is there some convention for the order of a commit's parents?</p> <p>Because one of the commit's parents should be to be to <em>previous commit on the current branch</em> that is being merged into and the rest are <em>previous commits of the other merging branches</em>.</p> <p>I ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,393
git
# Git Commit Parents' Order Is there some convention for the order of a commit's parents? Because one of the commit's parents should be to be to *previous commit on the current branch* that is being merged into and the rest are *previous commits of the other merging branches*. I would like to **identify the previous...
`libgit2` and its bindings return the parents in the order that they're stored in the commit, which is the order of the commits as they were given on e.g. the command-line for `git merge`, and it's a constant that the first parent is the current commit when creating a new one (either through merge or normal `git commit...
15283332
Git apply doesn't create new files?
14
2013-03-07 22:49:27
<p>I'm trying to create patch by <code>diff</code> and <code>apply</code> it. My patch has new file and after <code>apply</code> I'm getting an error.</p> <pre><code>git diff master origin/master &gt; patch1.diff git apply patch1.diff -v Checking patch test3... error: test3: No such file or directory </code></pre> <...
13,773
1,442,283
2013-03-07 22:55:11
15,283,421
11
2013-03-07 22:55:11
116,908
2013-03-07 22:55:11
https://stackoverflow.com/q/15283332
https://stackoverflow.com/a/15283421
<p>You're creating your patch backwards - that patch is trying to <em>delete</em> that file. I think you wanted:</p> <pre><code>git diff origin/master master &gt; patch1.diff </code></pre> <p>You might find <code>git format-patch</code> to be helpful. If you currently have <code>master</code> checked out, you can j...
<p>You're creating your patch backwards - that patch is trying to <em>delete</em> that file. I think you wanted:</p> <pre><code>git diff origin/master master &gt; patch1.diff </code></pre> <p>You might find <code>git format-patch</code> to be helpful. If you currently have <code>master</code> checked out, you can j...
119, 606
diff, git
<h1>Git apply doesn't create new files?</h1> <p>I'm trying to create patch by <code>diff</code> and <code>apply</code> it. My patch has new file and after <code>apply</code> I'm getting an error.</p> <pre><code>git diff master origin/master &gt; patch1.diff git apply patch1.diff -v Checking patch test3... error: test...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,395
git
# Git apply doesn't create new files? I'm trying to create patch by `diff` and `apply` it. My patch has new file and after `apply` I'm getting an error. ``` git diff master origin/master > patch1.diff git apply patch1.diff -v Checking patch test3... error: test3: No such file or directory ``` Patch: ``` diff --git...
You're creating your patch backwards - that patch is trying to *delete* that file. I think you wanted: ``` git diff origin/master master > patch1.diff ``` You might find `git format-patch` to be helpful. If you currently have `master` checked out, you can just do: ``` git format-patch origin/master ``` That command...
15067561
git: create "temporary" integration branch
14
2013-02-25 12:58:32
<p>I am relatively new to using git.</p> <p>recently from master we branched +-10 feature branches. lets call them A, B, C, etc.</p> <p>I want to merge these all together for testing. is it fine if I create a new branch, and merge in my features?</p> <p>eg</p> <pre><code>[master] git checkout -b integration [integ...
14,845
818,316
2017-02-24 12:58:09
15,068,867
11
2013-02-25 14:07:53
752,411
2013-02-25 14:07:53
https://stackoverflow.com/q/15067561
https://stackoverflow.com/a/15068867
<p>Short answer: yes.</p> <p>Long answer: yes and, assuming no changes are made to your master branch in the meantime, your merge to master will be a "fast forward" merge so after <code>[master] git merge integration</code>, the master branch will look like the integration branch prior to the merge.</p> <p>The "branc...
<p>Short answer: yes.</p> <p>Long answer: yes and, assuming no changes are made to your master branch in the meantime, your merge to master will be a "fast forward" merge so after <code>[master] git merge integration</code>, the master branch will look like the integration branch prior to the merge.</p> <p>The "branc...
119
git
<h1>git: create "temporary" integration branch</h1> <p>I am relatively new to using git.</p> <p>recently from master we branched +-10 feature branches. lets call them A, B, C, etc.</p> <p>I want to merge these all together for testing. is it fine if I create a new branch, and merge in my features?</p> <p>eg</p> <pr...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,396
git
# git: create "temporary" integration branch I am relatively new to using git. recently from master we branched +-10 feature branches. lets call them A, B, C, etc. I want to merge these all together for testing. is it fine if I create a new branch, and merge in my features? eg ``` [master] git checkout -b integrat...
Short answer: yes. Long answer: yes and, assuming no changes are made to your master branch in the meantime, your merge to master will be a "fast forward" merge so after `[master] git merge integration`, the master branch will look like the integration branch prior to the merge. The "branch history" will appear in th...
8350567
Git Pull - Everything up to date, but it's not
14
2011-12-02 01:07:06
<p>I'm trying to pull from a repository which has about 10 files. On my local repository, I only have one file. When I type</p> <pre><code>git pull origin master </code></pre> <p>I get back "Everything up to date"</p> <p>However, I'm still missing those 9 or so files on the repository. Any ideas as to why this might...
33,023
895,603
2022-07-28 15:59:58
8,350,595
11
2011-12-02 01:11:36
1,047,642
2013-11-26 13:00:57
https://stackoverflow.com/q/8350567
https://stackoverflow.com/a/8350595
<p>Check whether you are on the right branch and have checked out the same revision you are comparing to: <code>git checkout HEAD</code></p>
<p>Check whether you are on the right branch and have checked out the same revision you are comparing to: <code>git checkout HEAD</code></p>
119
git
<h1>Git Pull - Everything up to date, but it's not</h1> <p>I'm trying to pull from a repository which has about 10 files. On my local repository, I only have one file. When I type</p> <pre><code>git pull origin master </code></pre> <p>I get back "Everything up to date"</p> <p>However, I'm still missing those 9 or so...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,398
git
# Git Pull - Everything up to date, but it's not I'm trying to pull from a repository which has about 10 files. On my local repository, I only have one file. When I type ``` git pull origin master ``` I get back "Everything up to date" However, I'm still missing those 9 or so files on the repository. Any ideas as t...
Check whether you are on the right branch and have checked out the same revision you are comparing to: `git checkout HEAD`
5508583
Can I git-svn clone an svn repo with multiple standard directory layouts
14
2011-04-01 02:32:54
<p>I have an SVN repo with a layout like<br> project1/trunk<br> project1/branches<br> project1/tags<br> project2/trunk<br> project2/branches<br> project2/tags<br> etc.</p> <p>For a number of reasons, I'd like a git-svn repo that allows me to work on any of these projects and fetch/dcommit from/to all of them at once. ...
6,392
636,917
2014-04-30 14:38:54
5,508,750
11
2011-04-01 03:12:17
638,877
2011-04-01 03:48:44
https://stackoverflow.com/q/5508583
https://stackoverflow.com/a/5508750
<p>This is how I did it. There may be simpler ways, though.</p> <ol> <li><p>Select the first project with the standard layout you'd like to work on and <code>git svn clone</code> it: </p> <p><code>git svn clone --stdlayout http://sample.com/svn/repository-name/project-name repository-name</code></p></li> <li><p>Go i...
<p>This is how I did it. There may be simpler ways, though.</p> <ol> <li><p>Select the first project with the standard layout you'd like to work on and <code>git svn clone</code> it: </p> <p><code>git svn clone --stdlayout http://sample.com/svn/repository-name/project-name repository-name</code></p></li> <li><p>Go i...
63, 119, 6452
git, git-svn, svn
<h1>Can I git-svn clone an svn repo with multiple standard directory layouts</h1> <p>I have an SVN repo with a layout like<br> project1/trunk<br> project1/branches<br> project1/tags<br> project2/trunk<br> project2/branches<br> project2/tags<br> etc.</p> <p>For a number of reasons, I'd like a git-svn repo that allows m...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,399
git
# Can I git-svn clone an svn repo with multiple standard directory layouts I have an SVN repo with a layout like project1/trunk project1/branches project1/tags project2/trunk project2/branches project2/tags etc. For a number of reasons, I'd like a git-svn repo that allows me to work on any of these proj...
This is how I did it. There may be simpler ways, though. 1. Select the first project with the standard layout you'd like to work on and `git svn clone` it: `git svn clone --stdlayout http://sample.com/svn/repository-name/project-name repository-name` 2. Go into the `repository-name` directory and edit its `.git/co...
61022208
Should linters config files be in .gitignore?
13
2020-04-04 00:11:52
<p>Files like eslintrc, prettierrc or .editorconfig should be in .gitignore? Exist any good practice related to linters config?</p>
8,782
null
2020-04-04 01:28:34
61,022,484
11
2020-04-04 00:51:02
8,705,432
2020-04-04 01:28:34
https://stackoverflow.com/q/61022208
https://stackoverflow.com/a/61022484
<p>You should check in (that is commit and not ignore) linter configuration files and editor-independent style and formatting configuration files (like <code>.editorconfig</code> or <code>.clang-format</code>). It's important that these live in the repository because they set a style applicable to all developers and l...
<p>You should check in (that is commit and not ignore) linter configuration files and editor-independent style and formatting configuration files (like <code>.editorconfig</code> or <code>.clang-format</code>). It's important that these live in the repository because they set a style applicable to all developers and l...
119, 2666
git, static-analysis
<h1>Should linters config files be in .gitignore?</h1> <p>Files like eslintrc, prettierrc or .editorconfig should be in .gitignore? Exist any good practice related to linters config?</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,400
git
# Should linters config files be in .gitignore? Files like eslintrc, prettierrc or .editorconfig should be in .gitignore? Exist any good practice related to linters config?
You should check in (that is commit and not ignore) linter configuration files and editor-independent style and formatting configuration files (like `.editorconfig` or `.clang-format`). It's important that these live in the repository because they set a style applicable to all developers and let all developers apply th...
60878838
Git RPC failed; curl 18 transfer closed with outstanding read data remaining
13
2020-03-27 01:47:58
<p>Any git clone of a repo above a certain size fails halfway through, I can use ssh method however for this case http is required as it is a secondary action as part of brew install. </p> <pre><code>$ brew cask install homebrew/cask-versions/adoptopenjdk8 ==&gt; Tapping homebrew/cask Cloning into '/usr/local/Homebre...
40,445
8,958,754
2024-08-31 11:37:02
60,880,552
11
2020-03-27 05:38:04
6,309
2020-03-27 05:38:04
https://stackoverflow.com/q/60878838
https://stackoverflow.com/a/60880552
<p>If the issue persists, meaning if you see the same error message when trying yourself:</p> <pre><code>git clone https://github.com/Homebrew/homebrew-cask /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask </code></pre> <p>Then try:</p> <ul> <li><p>either an SSH clone:</p> <pre><code>git clone git@github.com...
<p>If the issue persists, meaning if you see the same error message when trying yourself:</p> <pre><code>git clone https://github.com/Homebrew/homebrew-cask /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask </code></pre> <p>Then try:</p> <ul> <li><p>either an SSH clone:</p> <pre><code>git clone git@github.com...
119, 103514
git, homebrew-cask
<h1>Git RPC failed; curl 18 transfer closed with outstanding read data remaining</h1> <p>Any git clone of a repo above a certain size fails halfway through, I can use ssh method however for this case http is required as it is a secondary action as part of brew install. </p> <pre><code>$ brew cask install homebrew/cask...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,401
git
# Git RPC failed; curl 18 transfer closed with outstanding read data remaining Any git clone of a repo above a certain size fails halfway through, I can use ssh method however for this case http is required as it is a secondary action as part of brew install. ``` $ brew cask install homebrew/cask-versions/adoptopenjd...
If the issue persists, meaning if you see the same error message when trying yourself: ``` git clone https://github.com/Homebrew/homebrew-cask /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask ``` Then try: - either an SSH clone: ``` git clone git@github.com:Homebrew/homebrew-cask /usr/local/Homebrew/Libr...
56752967
Prevent Master Branch from being ahead of dev
13
2019-06-25 11:23:45
<p>we got a pretty standard git workflow, but i am annoyed by one thing: The master is ahead of development because every deployment we create a merge-commit from dev to master.</p> <p>At first our workflow:</p> <ul> <li><code>master branch</code> - always clean and available for a deployment</li> <li><code>developme...
8,625
1,841,828
2019-06-25 14:01:47
56,755,857
11
2019-06-25 14:01:47
3,980,115
2019-06-25 14:01:47
https://stackoverflow.com/q/56752967
https://stackoverflow.com/a/56755857
<p>What you're asking for is called a "fast forward" merge. Since you mention pull-requests, I assume you're using something to manage your branches for you (GitHub, BitBucket, etc.), so the exact instructions to accomplish what you want may vary.</p> <hr> <p>Given this state:</p> <pre><code>master o-o-o-o ...
<p>What you're asking for is called a "fast forward" merge. Since you mention pull-requests, I assume you're using something to manage your branches for you (GitHub, BitBucket, etc.), so the exact instructions to accomplish what you want may vary.</p> <hr> <p>Given this state:</p> <pre><code>master o-o-o-o ...
119, 717, 1879, 8974, 55606
branch, git, git-workflow, merge, rebase
<h1>Prevent Master Branch from being ahead of dev</h1> <p>we got a pretty standard git workflow, but i am annoyed by one thing: The master is ahead of development because every deployment we create a merge-commit from dev to master.</p> <p>At first our workflow:</p> <ul> <li><code>master branch</code> - always clean ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,402
git
# Prevent Master Branch from being ahead of dev we got a pretty standard git workflow, but i am annoyed by one thing: The master is ahead of development because every deployment we create a merge-commit from dev to master. At first our workflow: - `master branch` - always clean and available for a deployment - `deve...
What you're asking for is called a "fast forward" merge. Since you mention pull-requests, I assume you're using something to manage your branches for you (GitHub, BitBucket, etc.), so the exact instructions to accomplish what you want may vary. --- Given this state: ``` master o-o-o-o \ development ...
55431768
What's different between `--abort` and `--quit` as sequencer subcommands for `cherry-pick`?
13
2019-03-30 13:10:00
<p>As per the <a href="https://git-scm.com/docs/git-cherry-pick#_sequencer_subcommands" rel="noreferrer">doc</a>, among the three sequencer subcommands for <code>cherry-pick</code>, we have these two which are, to me, oddly similar :</p> <pre><code>--quit </code></pre> <blockquote> <p>Forget about the current opera...
2,985
1,057,485
2022-04-14 23:02:11
55,433,382
11
2019-03-30 16:17:01
1,256,452
2022-04-14 23:02:11
https://stackoverflow.com/q/55431768
https://stackoverflow.com/a/55433382
<p>If you remember that <code>git rebase</code> is a sequence of <code>git cherry-pick</code> operations,<sup>1</sup> plus a couple of useful gimmicks at the start and end, it makes more sense.</p> <p>Imagine you have the following series of commits:</p> <pre><code>...--o--*--...--o &lt;-- mainline \ ...
<p>If you remember that <code>git rebase</code> is a sequence of <code>git cherry-pick</code> operations,<sup>1</sup> plus a couple of useful gimmicks at the start and end, it makes more sense.</p> <p>Imagine you have the following series of commits:</p> <pre><code>...--o--*--...--o &lt;-- mainline \ ...
119, 78810
git, git-cherry-pick
<h1>What's different between `--abort` and `--quit` as sequencer subcommands for `cherry-pick`?</h1> <p>As per the <a href="https://git-scm.com/docs/git-cherry-pick#_sequencer_subcommands" rel="noreferrer">doc</a>, among the three sequencer subcommands for <code>cherry-pick</code>, we have these two which are, to me, o...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,403
git
# What's different between `--abort` and `--quit` as sequencer subcommands for `cherry-pick`? As per the [doc](https://git-scm.com/docs/git-cherry-pick#_sequencer_subcommands), among the three sequencer subcommands for `cherry-pick`, we have these two which are, to me, oddly similar : ``` --quit ``` > Forget about t...
If you remember that `git rebase` is a sequence of `git cherry-pick` operations,1 plus a couple of useful gimmicks at the start and end, it makes more sense. Imagine you have the following series of commits: ``` ...--o--*--...--o <-- mainline \ A--B--C <-- feature ``` You want to bring `featur...
39697282
How to list all changed files in a particular branch?
13
2016-09-26 07:46:07
<p>I have created one branch xyz from master. I have done approximately 1000 commits and probably modified 20 files in xyz branch. Now I want to list all the files which I have modified in xyz branch. </p> <p>Following command lists files modified in both branches. </p> <pre><code>git diff --name-only master...xyz </...
17,261
6,527,049
2016-09-28 15:19:34
39,699,006
11
2016-09-26 09:20:15
1,256,452
2016-09-26 09:26:23
https://stackoverflow.com/q/39697282
https://stackoverflow.com/a/39699006
<p>The fundamental problem here is that <code>git diff</code> compares two specific commits.<sup>1</sup> No matter what arguments you give it, it's <em>still</em> going to choose two specific commits, and compare those two.<sup>2</sup></p> <p>What this means is that to get <code>git diff</code> to show you what you h...
<p>The fundamental problem here is that <code>git diff</code> compares two specific commits.<sup>1</sup> No matter what arguments you give it, it's <em>still</em> going to choose two specific commits, and compare those two.<sup>2</sup></p> <p>What this means is that to get <code>git diff</code> to show you what you h...
119
git
<h1>How to list all changed files in a particular branch?</h1> <p>I have created one branch xyz from master. I have done approximately 1000 commits and probably modified 20 files in xyz branch. Now I want to list all the files which I have modified in xyz branch. </p> <p>Following command lists files modified in both ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,406
git
# How to list all changed files in a particular branch? I have created one branch xyz from master. I have done approximately 1000 commits and probably modified 20 files in xyz branch. Now I want to list all the files which I have modified in xyz branch. Following command lists files modified in both branches. ``` gi...
The fundamental problem here is that `git diff` compares two specific commits.1 No matter what arguments you give it, it's *still* going to choose two specific commits, and compare those two.2 What this means is that to get `git diff` to show you what you have done in some branch, you must pick two commits within that...
38460008
Automate Git commit + versioning + tag by npm node
13
2016-07-19 13:27:46
<p>What I have been trying to get is, work with npm version to update the package.json and create a tag and then commit my changes. In this way, I will be able to have tags by version, auto versioning and commit with the info.</p> <p>The problem I am having is, when I am using npm version, it's doing a tag + commit au...
27,700
4,775,350
2021-10-01 10:29:51
38,484,417
11
2016-07-20 14:43:44
4,775,350
2016-07-20 14:43:44
https://stackoverflow.com/q/38460008
https://stackoverflow.com/a/38484417
<p>Ok guys, I got it! What I was looking for is to run a simple command and automate some boring tasks we have to do always in the same order for Git.</p> <p>So, What I do here is, first I run this command:</p> <pre><code>$&gt; npm run commit -- 'v.1.0.1: Fixes' </code></pre> <p>What it happens is that I firstly cle...
<p>Ok guys, I got it! What I was looking for is to run a simple command and automate some boring tasks we have to do always in the same order for Git.</p> <p>So, What I do here is, first I run this command:</p> <pre><code>$&gt; npm run commit -- 'v.1.0.1: Fixes' </code></pre> <p>What it happens is that I firstly cle...
119, 46426, 61387, 99715
git, gulp, node.js, npm
<h1>Automate Git commit + versioning + tag by npm node</h1> <p>What I have been trying to get is, work with npm version to update the package.json and create a tag and then commit my changes. In this way, I will be able to have tags by version, auto versioning and commit with the info.</p> <p>The problem I am having i...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,407
git
# Automate Git commit + versioning + tag by npm node What I have been trying to get is, work with npm version to update the package.json and create a tag and then commit my changes. In this way, I will be able to have tags by version, auto versioning and commit with the info. The problem I am having is, when I am usi...
Ok guys, I got it! What I was looking for is to run a simple command and automate some boring tasks we have to do always in the same order for Git. So, What I do here is, first I run this command: ``` $> npm run commit -- 'v.1.0.1: Fixes' ``` What it happens is that I firstly clean of folders/files and I dont need/w...
30560256
How to get commit where merged branch forked from
13
2015-05-31 17:17:27
<pre><code>o---1---o---o---o---o master \ / o---o---2 feature </code></pre> <p>Is it possible to get commit 1 without using reflog ? Using git 2.4.2</p> <p>I tried:</p> <pre><code>git merge-base master feature git merge-base feature master returns: commit 2 git merge-base --fork-poi...
3,261
867,294
2020-10-14 17:33:35
30,563,070
11
2015-05-31 21:49:45
867,294
2015-05-31 21:55:41
https://stackoverflow.com/q/30560256
https://stackoverflow.com/a/30563070
<p>Found my answer as a subset from this question: ( backporting was in fact also my usecase ! ) <a href="https://stackoverflow.com/a/16718891/867294">https://stackoverflow.com/a/16718891/867294</a></p> <pre><code>[alias] oldest-ancestor = !bash -c 'diff -u &lt;(git rev-list --first-parent "${1:-master}") &lt;(git...
<p>Found my answer as a subset from this question: ( backporting was in fact also my usecase ! ) <a href="https://stackoverflow.com/a/16718891/867294">https://stackoverflow.com/a/16718891/867294</a></p> <pre><code>[alias] oldest-ancestor = !bash -c 'diff -u &lt;(git rev-list --first-parent "${1:-master}") &lt;(git...
119, 1879
branch, git
<h1>How to get commit where merged branch forked from</h1> <pre><code>o---1---o---o---o---o master \ / o---o---2 feature </code></pre> <p>Is it possible to get commit 1 without using reflog ? Using git 2.4.2</p> <p>I tried:</p> <pre><code>git merge-base master feature git merge-base ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,409
git
# How to get commit where merged branch forked from ``` o---1---o---o---o---o master \ / o---o---2 feature ``` Is it possible to get commit 1 without using reflog ? Using git 2.4.2 I tried: ``` git merge-base master feature git merge-base feature master returns: commit 2 git merge-...
Found my answer as a subset from this question: ( backporting was in fact also my usecase ! ) <https://stackoverflow.com/a/16718891/867294> ``` [alias] oldest-ancestor = !bash -c 'diff -u <(git rev-list --first-parent "${1:-master}") <(git rev-list --first-parent "${2:-HEAD}") | sed -ne \"s/^ //p\" | head -1' - ``...
28228016
git svn clone died of signal 11 on OSX
13
2015-01-30 01:52:43
<p>I'm trying to migrate a project from svn to git. I was using the osx svn package, but I also tried installing with homebrew. I keep getting this same error.</p> <pre><code>git svn clone http://myserver/myrepo error: git-svn died of signal 11 </code></pre> <p>Version information:</p> <pre><code>git --version git v...
6,864
3,213,313
2021-02-08 09:58:52
28,242,820
11
2015-01-30 18:58:10
14,660
2016-08-17 08:18:19
https://stackoverflow.com/q/28228016
https://stackoverflow.com/a/28242820
<p><code>git svn</code> executes <code>git-svn</code> which is a Perl program which uses bindings to libsvn and those bindings are touchy. If Perl changes, or SVN changes, that could cause a segfault. Both could happen in an OS upgrade.</p> <p>Find out which version of the SVN bindings your git is using. Here's wha...
<p><code>git svn</code> executes <code>git-svn</code> which is a Perl program which uses bindings to libsvn and those bindings are touchy. If Perl changes, or SVN changes, that could cause a segfault. Both could happen in an OS upgrade.</p> <p>Find out which version of the SVN bindings your git is using. Here's wha...
63, 119, 6452, 104811
git, git-svn, osx-yosemite, svn
<h1>git svn clone died of signal 11 on OSX</h1> <p>I'm trying to migrate a project from svn to git. I was using the osx svn package, but I also tried installing with homebrew. I keep getting this same error.</p> <pre><code>git svn clone http://myserver/myrepo error: git-svn died of signal 11 </code></pre> <p>Version ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,410
git
# git svn clone died of signal 11 on OSX I'm trying to migrate a project from svn to git. I was using the osx svn package, but I also tried installing with homebrew. I keep getting this same error. ``` git svn clone http://myserver/myrepo error: git-svn died of signal 11 ``` Version information: ``` git --version g...
`git svn` executes `git-svn` which is a Perl program which uses bindings to libsvn and those bindings are touchy. If Perl changes, or SVN changes, that could cause a segfault. Both could happen in an OS upgrade. Find out which version of the SVN bindings your git is using. Here's what I get for OS X 10.10.1 ``` $ /us...
25796533
How can I place my Meteor apps version number in the UI?
13
2014-09-11 20:39:38
<p>I have a meteor application that has different branches for different clients. This is because clients want special things. Of course right?</p> <p>I would like to be able to place the git branch and tag/hash for the deployed version of the app for that client in the UI somewhere.</p> <p>The question is how? Is th...
6,517
1,828,110
2020-03-31 17:33:12
25,801,605
11
2014-09-12 05:51:53
1,185,866
2015-06-03 14:11:21
https://stackoverflow.com/q/25796533
https://stackoverflow.com/a/25801605
<p>In my production apps I solved this issue in this way:</p> <h2>Files</h2> <p><strong><a href="https://gist.github.com/parhelium/26973d2439cc53560bc1" rel="noreferrer">App/.git/hooks/post.commit</a></strong></p> <p><strong><a href="https://gist.github.com/parhelium/cbba266a8da5ac102993" rel="noreferrer">App/Meteor...
<p>In my production apps I solved this issue in this way:</p> <h2>Files</h2> <p><strong><a href="https://gist.github.com/parhelium/26973d2439cc53560bc1" rel="noreferrer">App/.git/hooks/post.commit</a></strong></p> <p><strong><a href="https://gist.github.com/parhelium/cbba266a8da5ac102993" rel="noreferrer">App/Meteor...
119, 79111
git, meteor
<h1>How can I place my Meteor apps version number in the UI?</h1> <p>I have a meteor application that has different branches for different clients. This is because clients want special things. Of course right?</p> <p>I would like to be able to place the git branch and tag/hash for the deployed version of the app for t...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,411
git
# How can I place my Meteor apps version number in the UI? I have a meteor application that has different branches for different clients. This is because clients want special things. Of course right? I would like to be able to place the git branch and tag/hash for the deployed version of the app for that client in th...
In my production apps I solved this issue in this way: ## Files **[App/.git/hooks/post.commit](https://gist.github.com/parhelium/26973d2439cc53560bc1)** **[App/MeteorApp/hooks/post-commit-version](https://gist.github.com/parhelium/cbba266a8da5ac102993)** ## App structure: ``` App .git hooks post-comm...
23604935
GIT Renaming a branch and keeping all commit history
13
2014-05-12 09:03:13
<p>I have a question regarding renaming a branch in git. I created a local branch <code>dev</code> and pushed branch to remote. I did lots of work on the <code>dev</code> branch and am updating remote branch regularly. </p> <p>Now I want to change the name of the branch from <code>dev</code> to <code>development</code...
10,219
1,903,387
2024-07-26 05:15:57
23,605,062
11
2014-05-12 09:09:39
119,669
2015-06-08 09:32:29
https://stackoverflow.com/q/23604935
https://stackoverflow.com/a/23605062
<blockquote> <p>Now I want to change the name of the branch from dev to development, I know how to rename branch in GIT. My question is like if I rename the branch, does commit history to the dev-branch will be lost or not? If yes, how do i keep my commit-history?</p> </blockquote> <p>You can simply create a new bra...
<blockquote> <p>Now I want to change the name of the branch from dev to development, I know how to rename branch in GIT. My question is like if I rename the branch, does commit history to the dev-branch will be lost or not? If yes, how do i keep my commit-history?</p> </blockquote> <p>You can simply create a new bra...
119, 456
git, version-control
<h1>GIT Renaming a branch and keeping all commit history</h1> <p>I have a question regarding renaming a branch in git. I created a local branch <code>dev</code> and pushed branch to remote. I did lots of work on the <code>dev</code> branch and am updating remote branch regularly. </p> <p>Now I want to change the name ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,412
git
# GIT Renaming a branch and keeping all commit history I have a question regarding renaming a branch in git. I created a local branch `dev` and pushed branch to remote. I did lots of work on the `dev` branch and am updating remote branch regularly. Now I want to change the name of the branch from `dev` to `developmen...
> Now I want to change the name of the branch from dev to development, I know how to rename branch in GIT. My question is like if I rename the branch, does commit history to the dev-branch will be lost or not? If yes, how do i keep my commit-history? You can simply create a new branch from your `dev` branch, and then ...
15552959
GIT: How to keep ignored files when switching branches?
13
2013-03-21 16:25:46
<p>I have an App.Local.config file which each developer has their own settings in. I do not want this file checked versioned in the GIT repo as every time it would be overwritten by another developers changes.</p> <p>So I deleted the file from the repo and added it to the ignore file. But now when developers switch ...
7,406
2,140,834
2018-01-13 05:56:18
15,553,660
11
2013-03-21 17:01:27
2,114,871
2013-03-21 17:01:27
https://stackoverflow.com/q/15552959
https://stackoverflow.com/a/15553660
<p>What probably happened is that you removed the file from your workspace but not from the index. If you did that git thinks that removing this file is a change and it will remove it from then on.</p> <p>The way to go is to remove the file you don't want to track anymore from the index with</p> <pre><code>git rm --c...
<p>What probably happened is that you removed the file from your workspace but not from the index. If you did that git thinks that removing this file is a change and it will remove it from then on.</p> <p>The way to go is to remove the file you don't want to track anymore from the index with</p> <pre><code>git rm --c...
119, 25056, 76220
git, git-branch, gitignore
<h1>GIT: How to keep ignored files when switching branches?</h1> <p>I have an App.Local.config file which each developer has their own settings in. I do not want this file checked versioned in the GIT repo as every time it would be overwritten by another developers changes.</p> <p>So I deleted the file from the repo ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,413
git
# GIT: How to keep ignored files when switching branches? I have an App.Local.config file which each developer has their own settings in. I do not want this file checked versioned in the GIT repo as every time it would be overwritten by another developers changes. So I deleted the file from the repo and added it to t...
What probably happened is that you removed the file from your workspace but not from the index. If you did that git thinks that removing this file is a change and it will remove it from then on. The way to go is to remove the file you don't want to track anymore from the index with ``` git rm --cached App.Local.confi...
15199996
What would be the opposite of "git fetch"?
13
2013-03-04 11:01:07
<p>If I do git fetch from repo <code>A</code> to <code>B</code>, the master branch in <code>B</code> doesn't change - changes only <code>remotes/origin/master</code>, and <code>git status</code> reminds me of it.</p> <p>But now I want to do the opposite - update <code>B</code> from <code>A</code>, something like pushi...
2,427
486,057
2013-03-04 12:26:03
15,200,058
11
2013-03-04 11:04:15
11,343
2013-03-04 12:26:03
https://stackoverflow.com/q/15199996
https://stackoverflow.com/a/15200058
<p><code>git fetch A</code>, run from <code>B</code>, will store all current branches of <code>A</code> in <code>refs/remotes/A</code>. As you can do pretty much everything with <a href="http://git-scm.com/book/ch9-5.html">refspecs</a>, it's possible to do the same for a <code>git push</code>, but run from <code>A</cod...
<p><code>git fetch A</code>, run from <code>B</code>, will store all current branches of <code>A</code> in <code>refs/remotes/A</code>. As you can do pretty much everything with <a href="http://git-scm.com/book/ch9-5.html">refspecs</a>, it's possible to do the same for a <code>git push</code>, but run from <code>A</cod...
119, 33720
git, git-fetch
<h1>What would be the opposite of "git fetch"?</h1> <p>If I do git fetch from repo <code>A</code> to <code>B</code>, the master branch in <code>B</code> doesn't change - changes only <code>remotes/origin/master</code>, and <code>git status</code> reminds me of it.</p> <p>But now I want to do the opposite - update <cod...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,414
git
# What would be the opposite of "git fetch"? If I do git fetch from repo `A` to `B`, the master branch in `B` doesn't change - changes only `remotes/origin/master`, and `git status` reminds me of it. But now I want to do the opposite - update `B` from `A`, something like pushing from `A:master` to `B:remotes/origin/m...
`git fetch A`, run from `B`, will store all current branches of `A` in `refs/remotes/A`. As you can do pretty much everything with [refspecs](http://git-scm.com/book/ch9-5.html), it's possible to do the same for a `git push`, but run from `A` and targeting `B`. A refspec has two parts, separated by a semicolon. In the...
13861630
Structure in git with multiple websites
13
2012-12-13 14:11:06
<p>I have a website that i keep in git. It is a asp.net webforms website (but that is probably unimportant to this question).</p> <p>The website is used by our customer for 2 (in the future 4) websites. Most of the functionality is shared. But a few things like web.config and a folder with css is unique for each webs...
1,422
4,189
2012-12-24 07:25:42
14,016,740
11
2012-12-24 03:30:57
1,538,968
2012-12-24 07:25:42
https://stackoverflow.com/q/13861630
https://stackoverflow.com/a/14016740
<p>Assuming that your master branch contains your entire project:</p> <pre><code>|--BackOffice | \--UI |--BackOffice.UI | \--WebControls |--BackOfficeTests |--Deployment | \--db |--BusinessLogicLayer | |--bin | |--obj | \--Properties |--scripts |--Website | |--admin | |--App_Browsers | |--App_Code | |--App_D...
<p>Assuming that your master branch contains your entire project:</p> <pre><code>|--BackOffice | \--UI |--BackOffice.UI | \--WebControls |--BackOfficeTests |--Deployment | \--db |--BusinessLogicLayer | |--bin | |--obj | \--Properties |--scripts |--Website | |--admin | |--App_Browsers | |--App_Code | |--App_D...
119
git
<h1>Structure in git with multiple websites</h1> <p>I have a website that i keep in git. It is a asp.net webforms website (but that is probably unimportant to this question).</p> <p>The website is used by our customer for 2 (in the future 4) websites. Most of the functionality is shared. But a few things like web.conf...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,415
git
# Structure in git with multiple websites I have a website that i keep in git. It is a asp.net webforms website (but that is probably unimportant to this question). The website is used by our customer for 2 (in the future 4) websites. Most of the functionality is shared. But a few things like web.config and a folder ...
Assuming that your master branch contains your entire project: ``` |--BackOffice | \--UI |--BackOffice.UI | \--WebControls |--BackOfficeTests |--Deployment | \--db |--BusinessLogicLayer | |--bin | |--obj | \--Properties |--scripts |--Website | |--admin | |--App_Browsers | |--App_Code | |--App_Data | |--Styl...
5558395
How do you reclaim disk space after adding an alternate in git?
13
2011-04-05 20:55:01
<p>I have a git working directory and have added to <code>.git/objects/info/alternates</code> so that this working directory does not need to store duplicate data that's already in another working directory on my machine. (This is what <code>git clone --reference=DIRECTORY</code> does). However, duplicate objects alr...
1,046
280,043
2011-04-06 15:08:33
5,558,414
11
2011-04-05 20:57:23
280,043
2011-04-06 15:08:33
https://stackoverflow.com/q/5558395
https://stackoverflow.com/a/5558414
<pre><code>git repack -adl </code></pre> <p>The <code>-l</code> option in particular omits objects that are borrowed from an alternate. See <code>git help repack</code> and <code>git help pack-objects</code>.</p>
<pre><code>git repack -adl </code></pre> <p>The <code>-l</code> option in particular omits objects that are borrowed from an alternate. See <code>git help repack</code> and <code>git help pack-objects</code>.</p>
119, 3039, 5036
diskspace, git, reference
<h1>How do you reclaim disk space after adding an alternate in git?</h1> <p>I have a git working directory and have added to <code>.git/objects/info/alternates</code> so that this working directory does not need to store duplicate data that's already in another working directory on my machine. (This is what <code>git ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,417
git
# How do you reclaim disk space after adding an alternate in git? I have a git working directory and have added to `.git/objects/info/alternates` so that this working directory does not need to store duplicate data that's already in another working directory on my machine. (This is what `git clone --reference=DIRECTOR...
``` git repack -adl ``` The `-l` option in particular omits objects that are borrowed from an alternate. See `git help repack` and `git help pack-objects`.
33406739
Git treat nested git repos as regular file/folders
12
2015-10-29 05:42:47
<p>I have a top level git repo organized like so:</p> <ul> <li>.git/</li> <li>repoA/ <ul> <li>.git/</li> <li>file</li> <li>file2</li> <li>folder/</li> <li>...</li> </ul></li> <li>file</li> <li>file2</li> <li>folder/</li> <li>...</li> </ul> <p>How can I get git to <code>add</code> and <code>commit</code> <code>repoA<...
2,999
1,059,070
2021-05-05 17:42:51
67,368,137
11
2021-05-03 11:23:16
6,394,138
2021-05-05 17:42:51
https://stackoverflow.com/q/33406739
https://stackoverflow.com/a/67368137
<p>This is not directly possible. The <code>.git</code> directory has a special meaning for <code>git</code>. When you run git operations from inside a git work-tree (not necessarily from the top level) without explicitly specifying the path to the repository (via the <a href="https://www.git-scm.com/docs/git#Documenta...
<p>This is not directly possible. The <code>.git</code> directory has a special meaning for <code>git</code>. When you run git operations from inside a git work-tree (not necessarily from the top level) without explicitly specifying the path to the repository (via the <a href="https://www.git-scm.com/docs/git#Documenta...
119
git
<h1>Git treat nested git repos as regular file/folders</h1> <p>I have a top level git repo organized like so:</p> <ul> <li>.git/</li> <li>repoA/ <ul> <li>.git/</li> <li>file</li> <li>file2</li> <li>folder/</li> <li>...</li> </ul></li> <li>file</li> <li>file2</li> <li>folder/</li> <li>...</li> </ul> <p>How can I get ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,421
git
# Git treat nested git repos as regular file/folders I have a top level git repo organized like so: - .git/ - repoA/ - .git/ - file - file2 - folder/ - ... - file - file2 - folder/ - ... How can I get git to `add` and `commit` `repoA` (and `repoA/.git`) as if they were regular files/folders? Specifically,...
This is not directly possible. The `.git` directory has a special meaning for `git`. When you run git operations from inside a git work-tree (not necessarily from the top level) without explicitly specifying the path to the repository (via the [`--git-dir`](https://www.git-scm.com/docs/git#Documentation/git.txt---git-d...
66483436
Suppress git warning about default initial branch name
12
2021-03-04 21:39:15
<p>When creating a new Git repo you now see this message:</p> <pre><code>Initialized empty Git repository in /private/var/folders/g5/8twmk1xj481_6btvppyw5j4h0000gp/T/.tmpNYVg6H/.git/ hint: Using 'master' as the name for the initial branch. This default branch name hint: is subject to change. To configure the initial br...
6,600
265,521
2021-06-09 02:40:50
66,483,477
11
2021-03-04 21:42:05
265,521
2021-03-04 21:46:47
https://stackoverflow.com/q/66483436
https://stackoverflow.com/a/66483477
<p>It seems like you can do</p> <pre><code>git init --quiet # or git init -q </code></pre> <p>I'm not exactly sure what other information that will suppress but it suppresses this notice.</p> <p>However it does mean that the initial branch name is not well defined (they might change it to e.g. <code>main</code> later...
<p>It seems like you can do</p> <pre><code>git init --quiet # or git init -q </code></pre> <p>I'm not exactly sure what other information that will suppress but it suppresses this notice.</p> <p>However it does mean that the initial branch name is not well defined (they might change it to e.g. <code>main</code> later...
119
git
<h1>Suppress git warning about default initial branch name</h1> <p>When creating a new Git repo you now see this message:</p> <pre><code>Initialized empty Git repository in /private/var/folders/g5/8twmk1xj481_6btvppyw5j4h0000gp/T/.tmpNYVg6H/.git/ hint: Using 'master' as the name for the initial branch. This default bra...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,423
git
# Suppress git warning about default initial branch name When creating a new Git repo you now see this message: ``` Initialized empty Git repository in /private/var/folders/g5/8twmk1xj481_6btvppyw5j4h0000gp/T/.tmpNYVg6H/.git/ hint: Using 'master' as the name for the initial branch. This default branch name hint: is s...
It seems like you can do ``` git init --quiet # or git init -q ``` I'm not exactly sure what other information that will suppress but it suppresses this notice. However it does mean that the initial branch name is not well defined (they might change it to e.g. `main` later), so it's probably best to do this: ``` ...
58113639
How to properly fork a local git repository?
12
2019-09-26 09:26:45
<p>I have a local git repo. I want to fork it and use it as the basis of a new project. The new project should never be able to push anything back to the original project. Here is what I <em>think</em> I should do...</p> <pre><code>git clone originalproject newproject git remote remove origin </code></pre> <p>Is there ...
16,440
201,436
2023-08-28 06:21:19
58,113,672
11
2019-09-26 09:28:59
1,755,598
2019-09-26 09:28:59
https://stackoverflow.com/q/58113639
https://stackoverflow.com/a/58113672
<p>Yep, it will work but instead of removing the origin update it to the new link</p> <pre><code># Clone the existing project to a new location git clone originalproject newproject # Update the remote to the new git repository URL git remote set-url &lt;remote&gt; &lt;url&gt; </code></pre> <hr> <h3>Note</h3> <p>If...
<p>Yep, it will work but instead of removing the origin update it to the new link</p> <pre><code># Clone the existing project to a new location git clone originalproject newproject # Update the remote to the new git repository URL git remote set-url &lt;remote&gt; &lt;url&gt; </code></pre> <hr> <h3>Note</h3> <p>If...
119, 79324
git, git-fork
<h1>How to properly fork a local git repository?</h1> <p>I have a local git repo. I want to fork it and use it as the basis of a new project. The new project should never be able to push anything back to the original project. Here is what I <em>think</em> I should do...</p> <pre><code>git clone originalproject newproje...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,425
git
# How to properly fork a local git repository? I have a local git repo. I want to fork it and use it as the basis of a new project. The new project should never be able to push anything back to the original project. Here is what I *think* I should do... ``` git clone originalproject newproject git remote remove origi...
Yep, it will work but instead of removing the origin update it to the new link ``` # Clone the existing project to a new location git clone originalproject newproject # Update the remote to the new git repository URL git remote set-url <remote> <url> ``` --- ### Note If you have git hooks on your original reposito...
57472371
husky+lint-staged runs on unstaged files
12
2019-08-13 06:40:17
<p>I'm trying to add a pre-commit git hook that will run my linter only on touched (staged) files. My project is based on Create React App.</p> <p>I added the following to my <code>package.json</code>:</p> <pre><code> "scripts": { "lint": "eslint 'src/**/*.js'", "lintfix": "eslint 'src/**/*.js' --fix" }, ...
8,904
977,890
2019-08-13 07:05:19
57,472,700
11
2019-08-13 07:05:19
4,762,763
2019-08-13 07:05:19
https://stackoverflow.com/q/57472371
https://stackoverflow.com/a/57472700
<p>From lint-staged <a href="https://github.com/okonet/lint-staged" rel="noreferrer">readme.md</a> :</p> <blockquote> <pre><code>{ "*": "your-cmd" } </code></pre> <p>This config will execute <code>your-cmd</code> with the list of currently staged files passed as arguments.</p> <p>So, considering you did gi...
<p>From lint-staged <a href="https://github.com/okonet/lint-staged" rel="noreferrer">readme.md</a> :</p> <blockquote> <pre><code>{ "*": "your-cmd" } </code></pre> <p>This config will execute <code>your-cmd</code> with the list of currently staged files passed as arguments.</p> <p>So, considering you did gi...
43087, 46426, 92497, 94800
eslint, githooks, node.js, reactjs
<h1>husky+lint-staged runs on unstaged files</h1> <p>I'm trying to add a pre-commit git hook that will run my linter only on touched (staged) files. My project is based on Create React App.</p> <p>I added the following to my <code>package.json</code>:</p> <pre><code> "scripts": { "lint": "eslint 'src/**/*.js'", ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,426
git
# husky+lint-staged runs on unstaged files I'm trying to add a pre-commit git hook that will run my linter only on touched (staged) files. My project is based on Create React App. I added the following to my `package.json`: ``` "scripts": { "lint": "eslint 'src/**/*.js'", "lintfix": "eslint 'src/**/*.js' -...
From lint-staged [readme.md](https://github.com/okonet/lint-staged) : > ``` > { "*": "your-cmd" } > ``` > > This config will execute `your-cmd` with the list of currently staged > files passed as arguments. > > So, considering you did git add file1.ext file2.ext, lint-staged will > run the following command: > > `your...
47072267
How to check that all git-lfs tracked and committed files are pointers?
12
2017-11-02 09:54:03
<p>As git-lfs requires some manual setup (install git-lfs, run <code>git lfs install</code> once) this can lead to developers not committing git-lfs tracked file types correctly. I would like to check that for pull requests on our continuous integration system.</p> <p>How to check that all git-lfs tracked and committe...
5,345
80,480
2024-07-03 10:27:28
57,428,477
11
2019-08-09 10:47:59
8,705,432
2019-10-29 00:03:23
https://stackoverflow.com/q/47072267
https://stackoverflow.com/a/57428477
<p>Git LFS doesn't have a way to do this natively, although you could open an issue on the GitHub repository if you'd like to see support for it. In the mean time, you can implement this using a technique like the following:</p> <pre><code>git ls-files | git check-attr --stdin filter | \ awk -F': ' '$3 ~ /lfs/ { print...
<p>Git LFS doesn't have a way to do this natively, although you could open an issue on the GitHub repository if you'd like to see support for it. In the mean time, you can implement this using a technique like the following:</p> <pre><code>git ls-files | git check-attr --stdin filter | \ awk -F': ' '$3 ~ /lfs/ { print...
119, 1066, 64512, 115244
continuous-integration, git, git-lfs, pull-request
<h1>How to check that all git-lfs tracked and committed files are pointers?</h1> <p>As git-lfs requires some manual setup (install git-lfs, run <code>git lfs install</code> once) this can lead to developers not committing git-lfs tracked file types correctly. I would like to check that for pull requests on our continuo...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,427
git
# How to check that all git-lfs tracked and committed files are pointers? As git-lfs requires some manual setup (install git-lfs, run `git lfs install` once) this can lead to developers not committing git-lfs tracked file types correctly. I would like to check that for pull requests on our continuous integration syste...
Git LFS doesn't have a way to do this natively, although you could open an issue on the GitHub repository if you'd like to see support for it. In the mean time, you can implement this using a technique like the following: ``` git ls-files | git check-attr --stdin filter | \ awk -F': ' '$3 ~ /lfs/ { print $1}' | \ xarg...
49665094
Verify if a tag was done in the master branch
12
2018-04-05 05:56:25
<p>In this project I am working, we do deployments based on tags. Whilst it's obligatory that the tags are done against the master branch (after you merge the release there), sometimes by mistake someone can tag against a dev or release branch, which is incorrect. That causes several problems.</p> <p>In our deployment...
9,754
2,001,849
2023-08-16 06:32:18
49,675,667
11
2018-04-05 15:04:25
1,256,452
2018-04-05 15:04:25
https://stackoverflow.com/q/49665094
https://stackoverflow.com/a/49675667
<p>As several people noted, your question cannot really be answered until it is reformulated. This is because a Git tag or branch name simply identifies <em>one specific commit.</em> The desired effect of a branch name is to identify the <em>tip</em> commit of a branch, which changes over time, so that the specific c...
<p>As several people noted, your question cannot really be answered until it is reformulated. This is because a Git tag or branch name simply identifies <em>one specific commit.</em> The desired effect of a branch name is to identify the <em>tip</em> commit of a branch, which changes over time, so that the specific c...
119, 456, 3346, 7330, 60718
dvcs, git, git-tag, repository, version-control
<h1>Verify if a tag was done in the master branch</h1> <p>In this project I am working, we do deployments based on tags. Whilst it's obligatory that the tags are done against the master branch (after you merge the release there), sometimes by mistake someone can tag against a dev or release branch, which is incorrect. ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,428
git
# Verify if a tag was done in the master branch In this project I am working, we do deployments based on tags. Whilst it's obligatory that the tags are done against the master branch (after you merge the release there), sometimes by mistake someone can tag against a dev or release branch, which is incorrect. That caus...
As several people noted, your question cannot really be answered until it is reformulated. This is because a Git tag or branch name simply identifies *one specific commit.* The desired effect of a branch name is to identify the *tip* commit of a branch, which changes over time, so that the specific commit it identifies...
44160735
Trying to undo/ignore by adding slnx.sqlite file in .git-ignore file in visual studio 2017,But still it shows uncommitted.
12
2017-05-24 14:03:44
<p>as am working on a project in visual studio and am trying to commit the changes and i have added the files in the .gitignore which i do not want to commit them. as well as i have added /.vs/slnx.sqlite in the .gitignore file but still it is showing as an uncommitted file. what i have to do. <strong>Please help me wi...
34,046
6,552,843
2023-07-14 02:19:04
44,160,895
11
2017-05-24 14:10:53
2,437,508
2017-05-24 14:10:53
https://stackoverflow.com/q/44160735
https://stackoverflow.com/a/44160895
<p>it's showing up as <strong>uncommitted</strong>? If that's the case then adding it to .gitignore changes nothing because .gitignore only works for <strong>untracked</strong> files (files that git hasn't been tracking so far.... if a file has already been committed on a previous revision [and therefore is part of HEA...
<p>it's showing up as <strong>uncommitted</strong>? If that's the case then adding it to .gitignore changes nothing because .gitignore only works for <strong>untracked</strong> files (files that git hasn't been tracking so far.... if a file has already been committed on a previous revision [and therefore is part of HEA...
119, 121
git, sqlite
<h1>Trying to undo/ignore by adding slnx.sqlite file in .git-ignore file in visual studio 2017,But still it shows uncommitted.</h1> <p>as am working on a project in visual studio and am trying to commit the changes and i have added the files in the .gitignore which i do not want to commit them. as well as i have added ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,429
git
# Trying to undo/ignore by adding slnx.sqlite file in .git-ignore file in visual studio 2017,But still it shows uncommitted. as am working on a project in visual studio and am trying to commit the changes and i have added the files in the .gitignore which i do not want to commit them. as well as i have added /.vs/slnx...
it's showing up as **uncommitted**? If that's the case then adding it to .gitignore changes nothing because .gitignore only works for **untracked** files (files that git hasn't been tracking so far.... if a file has already been committed on a previous revision [and therefore is part of HEAD] then .gitignore changes no...
42839127
git pull a specific tag only
12
2017-03-16 16:01:31
<p>I looking for command to make my life easiest.</p> <p><strong>The issue:</strong> have a project with sources. along of time i pushed more versions: v1.0.1 until v1.0.14 (latest) the version v1.0.12 is an patch and fixes special for myserver, but the myserver actually have installed v1.0.10 (I should update from v...
31,543
2,725,235
2018-11-29 06:46:04
42,854,068
11
2017-03-17 09:45:08
2,725,235
2018-11-29 06:46:04
https://stackoverflow.com/q/42839127
https://stackoverflow.com/a/42854068
<p>the solution that I find is:</p> <ol> <li><code>$ git fetch -unf origin 1.0.12:refs/tags/1.0.12</code></li> <li><code>$ git checkout 1.0.12</code></li> </ol> <p>if remote changes wants to merge with current will make a: <code>$ git merger 1.0.12</code></p> <p>please tell me if my way is right</p>
<p>the solution that I find is:</p> <ol> <li><code>$ git fetch -unf origin 1.0.12:refs/tags/1.0.12</code></li> <li><code>$ git checkout 1.0.12</code></li> </ol> <p>if remote changes wants to merge with current will make a: <code>$ git merger 1.0.12</code></p> <p>please tell me if my way is right</p>
119, 28896
git, git-pull
<h1>git pull a specific tag only</h1> <p>I looking for command to make my life easiest.</p> <p><strong>The issue:</strong> have a project with sources. along of time i pushed more versions: v1.0.1 until v1.0.14 (latest) the version v1.0.12 is an patch and fixes special for myserver, but the myserver actually have ins...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,430
git
# git pull a specific tag only I looking for command to make my life easiest. **The issue:** have a project with sources. along of time i pushed more versions: v1.0.1 until v1.0.14 (latest) the version v1.0.12 is an patch and fixes special for myserver, but the myserver actually have installed v1.0.10 (I should updat...
the solution that I find is: 1. `$ git fetch -unf origin 1.0.12:refs/tags/1.0.12` 2. `$ git checkout 1.0.12` if remote changes wants to merge with current will make a: `$ git merger 1.0.12` please tell me if my way is right
40003831
Push changes from git subtree to a branch for a pull request
12
2016-10-12 16:35:12
<p>How can I create local changes to a <code>git subtree</code> and then push those changes to a branch in the subtree's repo so that I can then create a pull request to merge the changes from that branch into the subtree's <code>master</code>?</p> <p>Assume I have two repos, <code>project</code> and <code>protocols</...
6,573
955,273
2016-10-13 14:40:43
40,024,109
11
2016-10-13 14:40:43
955,273
2016-10-13 14:40:43
https://stackoverflow.com/q/40003831
https://stackoverflow.com/a/40024109
<blockquote> <p><strong>create a branch in the protocols repo and push my local changes from project/protocols subtree to that branch</strong></p> </blockquote> <p>You can achieve that with a single command, <code>subtree push</code>, specifying a new remote branch:</p> <pre><code>$ git subtree push --prefix=protoc...
<blockquote> <p><strong>create a branch in the protocols repo and push my local changes from project/protocols subtree to that branch</strong></p> </blockquote> <p>You can achieve that with a single command, <code>subtree push</code>, specifying a new remote branch:</p> <pre><code>$ git subtree push --prefix=protoc...
119, 68200
git, git-subtree
<h1>Push changes from git subtree to a branch for a pull request</h1> <p>How can I create local changes to a <code>git subtree</code> and then push those changes to a branch in the subtree's repo so that I can then create a pull request to merge the changes from that branch into the subtree's <code>master</code>?</p> ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,431
git
# Push changes from git subtree to a branch for a pull request How can I create local changes to a `git subtree` and then push those changes to a branch in the subtree's repo so that I can then create a pull request to merge the changes from that branch into the subtree's `master`? Assume I have two repos, `project` ...
> **create a branch in the protocols repo and push my local changes from project/protocols subtree to that branch** You can achieve that with a single command, `subtree push`, specifying a new remote branch: ``` $ git subtree push --prefix=protocols protocols feature ``` This will create a new branch, `feature` in t...
39462991
How to push new branch to remote repository with tracking option
12
2016-09-13 05:51:09
<p>I am working on a local branch (feature1) created from mainline branch. I would like to push this local branch to remote repository. How to achieve this in git along with tracking option.</p>
8,576
1,249,519
2016-09-13 06:11:52
39,463,048
11
2016-09-13 05:55:48
6,711,406
2016-09-13 06:11:52
https://stackoverflow.com/q/39462991
https://stackoverflow.com/a/39463048
<p>Push with the <code>-u</code> option:</p> <pre><code>git push -u origin &lt;branch&gt; </code></pre> <p><code>-u</code>, short for <code>--set-upstream</code>, that is set the upstream in <code>origin</code> to the <code>&lt;branch&gt;</code> name. If you omit the branch name, the local branch name is used instead...
<p>Push with the <code>-u</code> option:</p> <pre><code>git push -u origin &lt;branch&gt; </code></pre> <p><code>-u</code>, short for <code>--set-upstream</code>, that is set the upstream in <code>origin</code> to the <code>&lt;branch&gt;</code> name. If you omit the branch name, the local branch name is used instead...
119
git
<h1>How to push new branch to remote repository with tracking option</h1> <p>I am working on a local branch (feature1) created from mainline branch. I would like to push this local branch to remote repository. How to achieve this in git along with tracking option.</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,432
git
# How to push new branch to remote repository with tracking option I am working on a local branch (feature1) created from mainline branch. I would like to push this local branch to remote repository. How to achieve this in git along with tracking option.
Push with the `-u` option: ``` git push -u origin <branch> ``` `-u`, short for `--set-upstream`, that is set the upstream in `origin` to the `<branch>` name. If you omit the branch name, the local branch name is used instead. Full story on [Git's documentation](https://git-scm.com/docs/git-push).
39015416
Create JWT token without signature?
12
2016-08-18 10:07:15
<p>Is it possible to create JWT tokens without signature?</p> <p>We have a case where we would not need the signature, but all the rest of the token would be needed. So is it possible to create the JWT token without the signature?</p> <p>Based on the documentation, you create the token by:</p> <pre><code>var token =...
17,412
4,662,347
2016-08-18 11:50:13
39,017,477
11
2016-08-18 11:50:13
2,295,964
2016-08-18 11:50:13
https://stackoverflow.com/q/39015416
https://stackoverflow.com/a/39017477
<p>According to <a href="https://www.rfc-editor.org/rfc/rfc7519#section-6" rel="noreferrer">RFC 7519</a>:</p> <blockquote> <p>To support use cases in which the JWT content is secured by a means other than a signature and/or encryption contained within the JWT (such as a signature on a data structure containing the JWT)...
<p>According to <a href="https://www.rfc-editor.org/rfc/rfc7519#section-6" rel="noreferrer">RFC 7519</a>:</p> <blockquote> <p>To support use cases in which the JWT content is secured by a means other than a signature and/or encryption contained within the JWT (such as a signature on a data structure containing the JWT)...
3, 17782, 46426, 65223
digital-signature, javascript, jwt, node.js
<h1>Create JWT token without signature?</h1> <p>Is it possible to create JWT tokens without signature?</p> <p>We have a case where we would not need the signature, but all the rest of the token would be needed. So is it possible to create the JWT token without the signature?</p> <p>Based on the documentation, you cre...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,433
git
# Create JWT token without signature? Is it possible to create JWT tokens without signature? We have a case where we would not need the signature, but all the rest of the token would be needed. So is it possible to create the JWT token without the signature? Based on the documentation, you create the token by: ``` ...
According to [RFC 7519](https://www.rfc-editor.org/rfc/rfc7519#section-6): > To support use cases in which the JWT content is secured by a means > other than a signature and/or encryption contained within the JWT > (such as a signature on a data structure containing the JWT), JWTs > MAY also be created without a signa...
37483375
How to cherry-pick changes from one file to another file?
12
2016-05-27 12:17:30
<p>I have two files called <code>vvn.c</code> and <code>aqu.c</code> I did changes to <code>vvn.c</code> and I have that commit in my git. How to cherry-pick the same changes to <code>aqu.c</code> The only difference is the API's.</p> <p><code>vvn.c</code> contains API's as <code>vvn_function_names()</code></p> <p>w...
9,141
3,178,797
2019-09-19 19:26:29
37,483,523
11
2016-05-27 12:24:16
1,761,457
2016-05-27 12:24:16
https://stackoverflow.com/q/37483375
https://stackoverflow.com/a/37483523
<p>Not exactly cherry-pick, but you might want to use:</p> <p><code>git checkout &lt;branch or sha of commit&gt; -- filename</code></p> <p>This checkouts the file by its version in another branch; it is the easiest possible solution, if it satisfy your needs (i.e., if you don't need to actually merge changes to the f...
<p>Not exactly cherry-pick, but you might want to use:</p> <p><code>git checkout &lt;branch or sha of commit&gt; -- filename</code></p> <p>This checkouts the file by its version in another branch; it is the easiest possible solution, if it satisfy your needs (i.e., if you don't need to actually merge changes to the f...
119, 36489, 78810
cherry-pick, git, git-cherry-pick
<h1>How to cherry-pick changes from one file to another file?</h1> <p>I have two files called <code>vvn.c</code> and <code>aqu.c</code> I did changes to <code>vvn.c</code> and I have that commit in my git. How to cherry-pick the same changes to <code>aqu.c</code> The only difference is the API's.</p> <p><code>vvn.c</...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,434
git
# How to cherry-pick changes from one file to another file? I have two files called `vvn.c` and `aqu.c` I did changes to `vvn.c` and I have that commit in my git. How to cherry-pick the same changes to `aqu.c` The only difference is the API's. `vvn.c` contains API's as `vvn_function_names()` whereas `aqu.c` contains...
Not exactly cherry-pick, but you might want to use: `git checkout <branch or sha of commit> -- filename` This checkouts the file by its version in another branch; it is the easiest possible solution, if it satisfy your needs (i.e., if you don't need to actually merge changes to the file from two separate branches) T...
32260956
Show Git version in R Code
12
2015-08-27 23:20:11
<p>I am using Git as a version control (currently the centralised workflow, but I would like to move to feature branch or gitflow workflow). I use RStudio/Knitr to compile PDF documents and would like to know how I can automatically include the current Git version in the PDF - if that works? That way, when somebody c...
2,387
1,420,372
2022-02-02 08:50:40
32,261,354
11
2015-08-28 00:03:36
1,457,051
2022-02-02 08:50:40
https://stackoverflow.com/q/32260956
https://stackoverflow.com/a/32261354
<p>Doing this only for presenting a soup-to-nuts example. It was @Wander Nauta's idea (from comments on the question).</p> <p>Here's a tiny knitr doc:</p> <pre><code>--- output: pdf_document --- ```{r} print(system(&quot;git rev-parse --short HEAD&quot;, intern = TRUE)) ``` </code></pre> <p>that I have in a freshly cr...
<p>Doing this only for presenting a soup-to-nuts example. It was @Wander Nauta's idea (from comments on the question).</p> <p>Here's a tiny knitr doc:</p> <pre><code>--- output: pdf_document --- ```{r} print(system(&quot;git rev-parse --short HEAD&quot;, intern = TRUE)) ``` </code></pre> <p>that I have in a freshly cr...
119, 4452, 67746, 75535
git, knitr, r, rstudio
<h1>Show Git version in R Code</h1> <p>I am using Git as a version control (currently the centralised workflow, but I would like to move to feature branch or gitflow workflow). I use RStudio/Knitr to compile PDF documents and would like to know how I can automatically include the current Git version in the PDF - if th...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,436
git
# Show Git version in R Code I am using Git as a version control (currently the centralised workflow, but I would like to move to feature branch or gitflow workflow). I use RStudio/Knitr to compile PDF documents and would like to know how I can automatically include the current Git version in the PDF - if that works? ...
Doing this only for presenting a soup-to-nuts example. It was @Wander Nauta's idea (from comments on the question). Here's a tiny knitr doc: ``` --- output: pdf_document --- ```{r} print(system("git rev-parse --short HEAD", intern = TRUE)) ``` ``` that I have in a freshly created local git repo. When I knit to PDF...
21155191
How to commit the staged files and excluding modified files
12
2014-01-16 06:56:15
<p>I thought git commit will only commit the staged file to repo,</p> <p><code>git ci a.txt</code></p> <p>Then the modified <code>a.txt</code> (content: b) was committed to the repo, but not the staged <code>a.txt</code> (content: a)</p> <p>So What's the command can git commits the staged file to repo , and keep the...
28,037
551,273
2021-12-14 11:27:57
21,155,372
11
2014-01-16 07:07:35
513,508
2021-12-14 10:17:37
https://stackoverflow.com/q/21155191
https://stackoverflow.com/a/21155372
<p>When you do <code>git commit</code> (without a pathspec) you only commit staged changes. So, in order not to commit the new changes to <code>a.txt</code>, instead of doing <code>git ci a.txt</code> just do <code>git commit</code>, which will not commit the new unstaged changes.</p>
<p>When you do <code>git commit</code> (without a pathspec) you only commit staged changes. So, in order not to commit the new changes to <code>a.txt</code>, instead of doing <code>git ci a.txt</code> just do <code>git commit</code>, which will not commit the new unstaged changes.</p>
119
git
<h1>How to commit the staged files and excluding modified files</h1> <p>I thought git commit will only commit the staged file to repo,</p> <p><code>git ci a.txt</code></p> <p>Then the modified <code>a.txt</code> (content: b) was committed to the repo, but not the staged <code>a.txt</code> (content: a)</p> <p>So What...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,437
git
# How to commit the staged files and excluding modified files I thought git commit will only commit the staged file to repo, `git ci a.txt` Then the modified `a.txt` (content: b) was committed to the repo, but not the staged `a.txt` (content: a) So What's the command can git commits the staged file to repo , and ke...
When you do `git commit` (without a pathspec) you only commit staged changes. So, in order not to commit the new changes to `a.txt`, instead of doing `git ci a.txt` just do `git commit`, which will not commit the new unstaged changes.
17379010
How can I decorate a git log with its nearest tag?
12
2013-06-29 10:04:07
<p><code>git log --decorate</code> adds information about related refs to the log output:</p> <pre><code>commit 9e895ace5d82df8929b16f58e9f515f6d54ab82d (tag: v3.10-rc7) Author: Linus Torvalds &lt;torvalds@linux-foundation.org&gt; Date: Sat Jun 22 09:47:31 2013 -1000 Linux 3.10-rc7 </code></pre> <p>This inform...
3,216
427,545
2013-11-23 13:06:18
20,161,796
11
2013-11-23 11:34:40
427,545
2013-11-23 13:06:18
https://stackoverflow.com/q/17379010
https://stackoverflow.com/a/20161796
<p>The <code>--first-parent</code> parameter of <code>git describe</code> (introduced with git 1.8.4) shows where a commit is <em>derived from</em>. In order to see a relation to the <em>first tag following the commit</em>, use <code>git describe --contains</code>. This options gets very slow (~6 seconds) when you delv...
<p>The <code>--first-parent</code> parameter of <code>git describe</code> (introduced with git 1.8.4) shows where a commit is <em>derived from</em>. In order to see a relation to the <em>first tag following the commit</em>, use <code>git describe --contains</code>. This options gets very slow (~6 seconds) when you delv...
119
git
<h1>How can I decorate a git log with its nearest tag?</h1> <p><code>git log --decorate</code> adds information about related refs to the log output:</p> <pre><code>commit 9e895ace5d82df8929b16f58e9f515f6d54ab82d (tag: v3.10-rc7) Author: Linus Torvalds &lt;torvalds@linux-foundation.org&gt; Date: Sat Jun 22 09:47:31 ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,438
git
# How can I decorate a git log with its nearest tag? `git log --decorate` adds information about related refs to the log output: ``` commit 9e895ace5d82df8929b16f58e9f515f6d54ab82d (tag: v3.10-rc7) Author: Linus Torvalds <torvalds@linux-foundation.org> Date: Sat Jun 22 09:47:31 2013 -1000 Linux 3.10-rc7 ``` T...
The `--first-parent` parameter of `git describe` (introduced with git 1.8.4) shows where a commit is *derived from*. In order to see a relation to the *first tag following the commit*, use `git describe --contains`. This options gets very slow (~6 seconds) when you delve deeper in the history though. Available since gi...
6897654
How to go back to previous version in git
12
2011-08-01 11:20:16
<p>I have a checkout copy of a remote git repository in my workstation. I have accidentally committed a change in my local and pushed to remote. Now I want to remove the last commit and go back to the previous commit and the same should be pushed to remote.</p> <p>I am okay if it is a new commit with a commit message....
24,147
863,378
2011-08-01 11:32:31
6,897,795
11
2011-08-01 11:32:31
21,699
2011-08-01 11:32:31
https://stackoverflow.com/q/6897654
https://stackoverflow.com/a/6897795
<p>I'd advise against pushing with --force an alternative history. Anyone who already pulled your changes will have a completely screwed history to deal with when pulling new stuff.</p> <p>A far safer option is to simply do </p> <pre><code>git revert HEAD~1 git push origin master </code></pre> <p><a href="http://ww...
<p>I'd advise against pushing with --force an alternative history. Anyone who already pulled your changes will have a completely screwed history to deal with when pulling new stuff.</p> <p>A far safer option is to simply do </p> <pre><code>git revert HEAD~1 git push origin master </code></pre> <p><a href="http://ww...
119
git
<h1>How to go back to previous version in git</h1> <p>I have a checkout copy of a remote git repository in my workstation. I have accidentally committed a change in my local and pushed to remote. Now I want to remove the last commit and go back to the previous commit and the same should be pushed to remote.</p> <p>I a...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,440
git
# How to go back to previous version in git I have a checkout copy of a remote git repository in my workstation. I have accidentally committed a change in my local and pushed to remote. Now I want to remove the last commit and go back to the previous commit and the same should be pushed to remote. I am okay if it is ...
I'd advise against pushing with --force an alternative history. Anyone who already pulled your changes will have a completely screwed history to deal with when pulling new stuff. A far safer option is to simply do ``` git revert HEAD~1 git push origin master ``` [git revert](http://www.kernel.org/pub/software/scm/g...
6795342
Git ignore & changing the past
12
2011-07-22 19:52:46
<p>I only recently added a <code>.gitignore</code> file to ignore some specific data files in a subdirectory of mine. I'd <em>really</em> like to go back in time and remove them from previous commits/history as well. </p> <p>Is this easily accomplished? Where/how should I start?</p>
5,111
26,196
2020-09-03 15:05:23
6,795,435
11
2011-07-22 20:00:42
501,250
2012-02-28 21:45:32
https://stackoverflow.com/q/6795342
https://stackoverflow.com/a/6795435
<p>This will be a two-step procedure:</p> <h2>Introduce the .gitignore file</h2> <p>For this to work, the early commits are going to have to have your <code>.gitignore</code> file. So, you need to:</p> <ol> <li>Check out the root commit: <code>git checkout -b temp $(git rev-list HEAD | tail -1)</code></li> <li>Add ...
<p>This will be a two-step procedure:</p> <h2>Introduce the .gitignore file</h2> <p>For this to work, the early commits are going to have to have your <code>.gitignore</code> file. So, you need to:</p> <ol> <li>Check out the root commit: <code>git checkout -b temp $(git rev-list HEAD | tail -1)</code></li> <li>Add ...
119, 25056
git, gitignore
<h1>Git ignore & changing the past</h1> <p>I only recently added a <code>.gitignore</code> file to ignore some specific data files in a subdirectory of mine. I'd <em>really</em> like to go back in time and remove them from previous commits/history as well. </p> <p>Is this easily accomplished? Where/how should I start?...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,441
git
# Git ignore & changing the past I only recently added a `.gitignore` file to ignore some specific data files in a subdirectory of mine. I'd *really* like to go back in time and remove them from previous commits/history as well. Is this easily accomplished? Where/how should I start?
This will be a two-step procedure: ## Introduce the .gitignore file For this to work, the early commits are going to have to have your `.gitignore` file. So, you need to: 1. Check out the root commit: `git checkout -b temp $(git rev-list HEAD | tail -1)` 2. Add the `.gitignore` file. 3. `git commit --amend` 4. Rebas...
65808503
pre-commit: How to disable the check for unstaged files?
11
2021-01-20 11:19:32
<p>My <a href="//pre-commit.com" rel="noreferrer">pre-commit.com</a> config looks like this:</p> <pre><code>repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v3.2.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer - id: check-yaml - id: check-added-large-files ...
14,805
633,961
2025-07-04 10:53:25
65,813,728
11
2021-01-20 16:38:45
812,183
2021-01-20 16:38:45
https://stackoverflow.com/q/65808503
https://stackoverflow.com/a/65813728
<p>From your output, you didn't stage any files for commit. so <code>git</code> itself prevented you from committing (not <code>pre-commit</code>) -- if you actually wanted to commit nothing you can use <code>git commit --allow-empty</code>. If you want to stage some files for commit, use <code>git add</code>, or use...
<p>From your output, you didn't stage any files for commit. so <code>git</code> itself prevented you from committing (not <code>pre-commit</code>) -- if you actually wanted to commit nothing you can use <code>git commit --allow-empty</code>. If you want to stage some files for commit, use <code>git add</code>, or use...
119, 139402
git, pre-commit.com
<h1>pre-commit: How to disable the check for unstaged files?</h1> <p>My <a href="//pre-commit.com" rel="noreferrer">pre-commit.com</a> config looks like this:</p> <pre><code>repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v3.2.0 hooks: - id: trailing-whitespace - id: end-of-file...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,448
git
# pre-commit: How to disable the check for unstaged files? My [pre-commit.com](//pre-commit.com) config looks like this: ``` repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v3.2.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer - id: check-yaml - id: check...
From your output, you didn't stage any files for commit. so `git` itself prevented you from committing (not `pre-commit`) -- if you actually wanted to commit nothing you can use `git commit --allow-empty`. If you want to stage some files for commit, use `git add`, or use `git commit -a` Note that there were no errors ...
56817904
How to get the .env file into the remote host server
11
2019-06-29 13:24:10
<p>Quick question how to get the .env conf file into the server. I have three settings file in my project base, development, production. <em>I think testing and staging is an overkill</em></p> <p>It is encouraged to put .env in .gitignore file. so it won't be included in version control. in Heroku, it is easy to set t...
8,106
10,303,173
2024-08-13 08:28:55
56,830,196
11
2019-07-01 05:02:45
1,043,118
2019-07-01 05:02:45
https://stackoverflow.com/q/56817904
https://stackoverflow.com/a/56830196
<p>You are correct. You should put your <code>.env</code> file in <code>.gitignore</code> and create <code>.env</code> file on server manually - either by connecting to server (SSH) and creating file or transfer file using one of secure transfer protocols (SCP, SFTP).</p>
<p>You are correct. You should put your <code>.env</code> file in <code>.gitignore</code> and create <code>.env</code> file on server manually - either by connecting to server (SSH) and creating file or transfer file using one of secure transfer protocols (SCP, SFTP).</p>
243, 9013, 25056
django, environment-variables, gitignore
<h1>How to get the .env file into the remote host server</h1> <p>Quick question how to get the .env conf file into the server. I have three settings file in my project base, development, production. <em>I think testing and staging is an overkill</em></p> <p>It is encouraged to put .env in .gitignore file. so it won't ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,451
git
# How to get the .env file into the remote host server Quick question how to get the .env conf file into the server. I have three settings file in my project base, development, production. *I think testing and staging is an overkill* It is encouraged to put .env in .gitignore file. so it won't be included in version ...
You are correct. You should put your `.env` file in `.gitignore` and create `.env` file on server manually - either by connecting to server (SSH) and creating file or transfer file using one of secure transfer protocols (SCP, SFTP).
45253550
How to check if a merge commit contains manual changes (e.g. resolved conflicts)?
11
2017-07-22 10:36:48
<p>How can I find out if there were conflicts when merging a branch and what shenanigans did the person have to do to resolve those conflicts? </p> <p><code>git log -p</code> seems to show empty diffs for all merge commits, regardless whether they have manual changes or not.</p>
2,521
244,297
2017-07-22 10:44:38
45,253,620
11
2017-07-22 10:44:38
244,297
2017-07-22 10:44:38
https://stackoverflow.com/q/45253550
https://stackoverflow.com/a/45253620
<p><a href="https://git-scm.com/docs/git-show" rel="noreferrer"><code>git show</code></a> produces a <a href="https://git-scm.com/docs/git-diff-tree#_combined_diff_format" rel="noreferrer"><em>combined diff</em></a> for a merge commit by default, which will contain only the lines that changed as part of the conflict re...
<p><a href="https://git-scm.com/docs/git-show" rel="noreferrer"><code>git show</code></a> produces a <a href="https://git-scm.com/docs/git-diff-tree#_combined_diff_format" rel="noreferrer"><em>combined diff</em></a> for a merge commit by default, which will contain only the lines that changed as part of the conflict re...
119, 717, 53850
git, git-commit, merge
<h1>How to check if a merge commit contains manual changes (e.g. resolved conflicts)?</h1> <p>How can I find out if there were conflicts when merging a branch and what shenanigans did the person have to do to resolve those conflicts? </p> <p><code>git log -p</code> seems to show empty diffs for all merge commits, reg...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,453
git
# How to check if a merge commit contains manual changes (e.g. resolved conflicts)? How can I find out if there were conflicts when merging a branch and what shenanigans did the person have to do to resolve those conflicts? `git log -p` seems to show empty diffs for all merge commits, regardless whether they have man...
[`git show`](https://git-scm.com/docs/git-show) produces a [*combined diff*](https://git-scm.com/docs/git-diff-tree#_combined_diff_format) for a merge commit by default, which will contain only the lines that changed as part of the conflict resolution. ``` git show <merge_commit_sha1> ``` `git log` takes the `--cc` o...
39867806
Pushing a new branch in Git
11
2016-10-05 07:25:24
<p>I am using Git, and I have created a new branch (named <code>foo</code>) on my local (one that doesn't exist on the repository).</p> <p>I have made some changes to my original project (master) files and committed all those changes in this new branch. Now I would like to push this new branch to the remote repository....
45,091
6,862,012
2024-06-10 14:21:44
39,867,826
11
2016-10-05 07:26:54
4,945,468
2024-04-25 06:21:20
https://stackoverflow.com/q/39867806
https://stackoverflow.com/a/39867826
<p>Yes. It'll prompt you to set the <code>upstream</code>. You can set the upstream branch like this:</p> <pre><code>git branch --set-upstream-to origin/yourbranch </code></pre> <p>It's same for everything except for the branch name. Follow the on screen guidelines.</p>
<p>Yes. It'll prompt you to set the <code>upstream</code>. You can set the upstream branch like this:</p> <pre><code>git branch --set-upstream-to origin/yourbranch </code></pre> <p>It's same for everything except for the branch name. Follow the on screen guidelines.</p>
119
git
<h1>Pushing a new branch in Git</h1> <p>I am using Git, and I have created a new branch (named <code>foo</code>) on my local (one that doesn't exist on the repository).</p> <p>I have made some changes to my original project (master) files and committed all those changes in this new branch. Now I would like to push this...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,454
git
# Pushing a new branch in Git I am using Git, and I have created a new branch (named `foo`) on my local (one that doesn't exist on the repository). I have made some changes to my original project (master) files and committed all those changes in this new branch. Now I would like to push this new branch to the remote ...
Yes. It'll prompt you to set the `upstream`. You can set the upstream branch like this: ``` git branch --set-upstream-to origin/yourbranch ``` It's same for everything except for the branch name. Follow the on screen guidelines.
38644232
How to deal with merges of topic branches after a squashed merge of parent
11
2016-07-28 18:34:06
<p>Say that I have the following scenario:</p> <pre><code>A -- B -- C -- D -- H master \ / E -- F -- G topicA \ I -- J -- K topicB </code></pre> <p><code>topicA</code> was merged into <code>master</code> using the <em>--squash</em> switch, which means that <code>master</...
1,137
2,883,579
2016-07-28 22:09:02
38,646,555
11
2016-07-28 20:54:06
1,256,452
2016-07-28 22:09:02
https://stackoverflow.com/q/38644232
https://stackoverflow.com/a/38646555
<p>As <a href="https://stackoverflow.com/questions/38644232/how-to-deal-with-merges-of-topic-branches-after-a-squashed-merge-of-parent#comment64673697_38644232">DavidN said in a comment</a>, your plan looks sound enough.</p> <p>(The rest of this is far too long and rambly; it was written between / during other tasks.)...
<p>As <a href="https://stackoverflow.com/questions/38644232/how-to-deal-with-merges-of-topic-branches-after-a-squashed-merge-of-parent#comment64673697_38644232">DavidN said in a comment</a>, your plan looks sound enough.</p> <p>(The rest of this is far too long and rambly; it was written between / during other tasks.)...
119, 717, 8974
git, merge, rebase
<h1>How to deal with merges of topic branches after a squashed merge of parent</h1> <p>Say that I have the following scenario:</p> <pre><code>A -- B -- C -- D -- H master \ / E -- F -- G topicA \ I -- J -- K topicB </code></pre> <p><code>topicA</code> was merged into <co...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,455
git
# How to deal with merges of topic branches after a squashed merge of parent Say that I have the following scenario: ``` A -- B -- C -- D -- H master \ / E -- F -- G topicA \ I -- J -- K topicB ``` `topicA` was merged into `master` using the *--squash* switch, which mea...
As [DavidN said in a comment](https://stackoverflow.com/questions/38644232/how-to-deal-with-merges-of-topic-branches-after-a-squashed-merge-of-parent#comment64673697_38644232), your plan looks sound enough. (The rest of this is far too long and rambly; it was written between / during other tasks.) # Digressions and s...
18006757
How to clone a git repo with all branches and tags from refs/remotes?
11
2013-08-02 00:15:19
<p>I have a local git repo that I created from an svn repo:</p> <pre><code>$ git svn clone -s svn:... </code></pre> <p>I then created a backup remote and pushed everything to it:</p> <pre><code>$ git remote add backup git@myhost:mybackup.git $ git push --mirror backup </code></pre> <p>Now, when I try to clone from ...
18,976
2,167,531
2016-03-17 15:30:39
36,065,045
11
2016-03-17 15:30:39
6,077,892
2016-03-17 15:30:39
https://stackoverflow.com/q/18006757
https://stackoverflow.com/a/36065045
<p>There are two ways to improve your command <code>git clone --mirror git@myhost:mybackup.git</code> The one I found is this one, knowing that your command created a mybackup.git directory :</p> <pre><code>mkdir mybackup mv mybackup.git mybackup/.git cd mybackup git init </code></pre> <p>There, you have a full worki...
<p>There are two ways to improve your command <code>git clone --mirror git@myhost:mybackup.git</code> The one I found is this one, knowing that your command created a mybackup.git directory :</p> <pre><code>mkdir mybackup mv mybackup.git mybackup/.git cd mybackup git init </code></pre> <p>There, you have a full worki...
119, 3050, 6452, 7620, 76220
clone, git, git-branch, git-svn, mirror
<h1>How to clone a git repo with all branches and tags from refs/remotes?</h1> <p>I have a local git repo that I created from an svn repo:</p> <pre><code>$ git svn clone -s svn:... </code></pre> <p>I then created a backup remote and pushed everything to it:</p> <pre><code>$ git remote add backup git@myhost:mybackup....
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,457
git
# How to clone a git repo with all branches and tags from refs/remotes? I have a local git repo that I created from an svn repo: ``` $ git svn clone -s svn:... ``` I then created a backup remote and pushed everything to it: ``` $ git remote add backup git@myhost:mybackup.git $ git push --mirror backup ``` Now, whe...
There are two ways to improve your command `git clone --mirror git@myhost:mybackup.git` The one I found is this one, knowing that your command created a mybackup.git directory : ``` mkdir mybackup mv mybackup.git mybackup/.git cd mybackup git init ``` There, you have a full working directory. Alternatively as you ca...
17832616
Make Git use CRLF on its "<<<<<<< HEAD" merge lines
11
2013-07-24 11:25:15
<p>Is it possible to ask Git to use CRLF instead of just LF at the end of the lines it puts into a file when it needs merging?</p> <p><img src="https://i.sstatic.net/IQmv8.png" alt="Merge using LFs"></p> <p>If resolving conflicts in a text editor without visible EOL characters, it is easy to accidentally end up with ...
5,074
1,213,714
2016-02-18 13:06:53
35,474,954
11
2016-02-18 07:06:49
6,309
2016-02-18 13:06:53
https://stackoverflow.com/q/17832616
https://stackoverflow.com/a/35474954
<blockquote> <p>Is it possible to ask Git to use CRLF instead of just LF at the end of the lines it puts into a file when it needs merging?</p> </blockquote> <p>It... actually is possible, from <a href="https://github.com/git/git/blob/0233b800c838ddda41db318ee396320b3c21a560/Documentation/RelNotes/2.7.2.txt#L1-L9" r...
<blockquote> <p>Is it possible to ask Git to use CRLF instead of just LF at the end of the lines it puts into a file when it needs merging?</p> </blockquote> <p>It... actually is possible, from <a href="https://github.com/git/git/blob/0233b800c838ddda41db318ee396320b3c21a560/Documentation/RelNotes/2.7.2.txt#L1-L9" r...
119, 12863
eol, git
<h1>Make Git use CRLF on its "<<<<<<< HEAD" merge lines</h1> <p>Is it possible to ask Git to use CRLF instead of just LF at the end of the lines it puts into a file when it needs merging?</p> <p><img src="https://i.sstatic.net/IQmv8.png" alt="Merge using LFs"></p> <p>If resolving conflicts in a text editor without vi...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,458
git
# Make Git use CRLF on its "<<<<<<< HEAD" merge lines Is it possible to ask Git to use CRLF instead of just LF at the end of the lines it puts into a file when it needs merging? ![Merge using LFs](https://i.sstatic.net/IQmv8.png) If resolving conflicts in a text editor without visible EOL characters, it is easy to a...
> Is it possible to ask Git to use CRLF instead of just LF at the end of the lines it puts into a file when it needs merging? It... actually is possible, from [git 2.7.2+ (February 2016)](https://github.com/git/git/blob/0233b800c838ddda41db318ee396320b3c21a560/Documentation/RelNotes/2.7.2.txt#L1-L9). And you don't h...
24875756
conq: repository does not exist. fatal: Could not read from remote repository
11
2014-07-21 22:16:20
<p>I have the ssh keys added in Bitbucket. If I do <code>ssh -T git@bitbucket.org</code> he says I'm logged in. But when I do a git push/pull I get the following message </p> <pre><code>conq: repository does not exist. fatal: Could not read from remote repository. Please make sure you have the correct access rights a...
13,986
2,244,502
2017-12-26 06:32:14
30,972,673
11
2015-06-22 05:33:15
5,034,876
2015-06-22 06:19:42
https://stackoverflow.com/q/24875756
https://stackoverflow.com/a/30972673
<p>I got the same message, and I had to remove my user id from the path.... So instead of:</p> <pre><code>url = git@bitbucket.org:myUserName/myGitRepo.git </code></pre> <p>What worked was:</p> <pre><code>url = git@bitbucket.org:myGitRepo.git </code></pre>
<p>I got the same message, and I had to remove my user id from the path.... So instead of:</p> <pre><code>url = git@bitbucket.org:myUserName/myGitRepo.git </code></pre> <p>What worked was:</p> <pre><code>url = git@bitbucket.org:myGitRepo.git </code></pre>
119, 8337
bitbucket, git
<h1>conq: repository does not exist. fatal: Could not read from remote repository</h1> <p>I have the ssh keys added in Bitbucket. If I do <code>ssh -T git@bitbucket.org</code> he says I'm logged in. But when I do a git push/pull I get the following message </p> <pre><code>conq: repository does not exist. fatal: Could ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,460
git
# conq: repository does not exist. fatal: Could not read from remote repository I have the ssh keys added in Bitbucket. If I do `ssh -T git@bitbucket.org` he says I'm logged in. But when I do a git push/pull I get the following message ``` conq: repository does not exist. fatal: Could not read from remote repository....
I got the same message, and I had to remove my user id from the path.... So instead of: ``` url = git@bitbucket.org:myUserName/myGitRepo.git ``` What worked was: ``` url = git@bitbucket.org:myGitRepo.git ```
25938711
git: How to automate interactive rebase / replace it by equivalent git commands
11
2014-09-19 16:43:39
<p>I need to automate a interactive rebase or replace it by other commands. Just let me explain my current situation:</p> <p>In an svn->git transition i need to rebase the newly created git repository to fix a "history cut-offs" made during SVN. Here is my manual workflow to fix the problem.</p> <pre><code>branchNEW:...
3,286
2,910,279
2020-08-26 23:21:24
25,941,070
11
2014-09-19 19:26:28
2,910,279
2014-09-22 08:57:57
https://stackoverflow.com/q/25938711
https://stackoverflow.com/a/25941070
<p>I found a possible solution:</p> <p><em>git rebase --interactive</em> sends the "list of rebase commits" (the list where you can pick, stash, edit, ...) to an editor. Which kind of editor can be configured. So the solution is to configure an alternative "editor" just for this interactive rebase. This can be done us...
<p>I found a possible solution:</p> <p><em>git rebase --interactive</em> sends the "list of rebase commits" (the list where you can pick, stash, edit, ...) to an editor. Which kind of editor can be configured. So the solution is to configure an alternative "editor" just for this interactive rebase. This can be done us...
119, 4063, 8974
git, interactive, rebase
<h1>git: How to automate interactive rebase / replace it by equivalent git commands</h1> <p>I need to automate a interactive rebase or replace it by other commands. Just let me explain my current situation:</p> <p>In an svn->git transition i need to rebase the newly created git repository to fix a "history cut-offs" m...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,461
git
# git: How to automate interactive rebase / replace it by equivalent git commands I need to automate a interactive rebase or replace it by other commands. Just let me explain my current situation: In an svn->git transition i need to rebase the newly created git repository to fix a "history cut-offs" made during SVN. ...
I found a possible solution: *git rebase --interactive* sends the "list of rebase commits" (the list where you can pick, stash, edit, ...) to an editor. Which kind of editor can be configured. So the solution is to configure an alternative "editor" just for this interactive rebase. This can be done using the environme...
25766267
How to do a 'git log' in the Windows Git Gui?
11
2014-09-10 13:07:10
<p>I just used the Git Gui to clone a local repo from GitHub, and then I checked out a certain branch. I now want to see the equivalent of doing a <code>git log -50</code>, but can't seem to find anything in the menu options or on the main screen:</p> <p><img src="https://i.sstatic.net/dkofy.png" alt="enter image desc...
21,842
4,009,451
2024-10-15 12:31:24
25,766,479
11
2014-09-10 13:16:39
354,577
2024-10-15 12:31:24
https://stackoverflow.com/q/25766267
https://stackoverflow.com/a/25766479
<p>That GUI isn't just for Windows, it's the standard <code>git-gui</code> that ships with Git.</p> <p>In any case, <code>git-gui</code> itself doesn't show log information. It's for creating new commits, managing branches, etc. The companion program <a href="http://git-scm.com/book/en/Git-Basics-Viewing-the-Commit-His...
<p>That GUI isn't just for Windows, it's the standard <code>git-gui</code> that ships with Git.</p> <p>In any case, <code>git-gui</code> itself doesn't show log information. It's for creating new commits, managing branches, etc. The companion program <a href="http://git-scm.com/book/en/Git-Basics-Viewing-the-Commit-His...
119, 33729, 47913
git, git-gui, git-log
<h1>How to do a 'git log' in the Windows Git Gui?</h1> <p>I just used the Git Gui to clone a local repo from GitHub, and then I checked out a certain branch. I now want to see the equivalent of doing a <code>git log -50</code>, but can't seem to find anything in the menu options or on the main screen:</p> <p><img src=...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,462
git
# How to do a 'git log' in the Windows Git Gui? I just used the Git Gui to clone a local repo from GitHub, and then I checked out a certain branch. I now want to see the equivalent of doing a `git log -50`, but can't seem to find anything in the menu options or on the main screen: ![enter image description here](http...
That GUI isn't just for Windows, it's the standard `git-gui` that ships with Git. In any case, `git-gui` itself doesn't show log information. It's for creating new commits, managing branches, etc. The companion program [`gitk` visualizes the commit graph](http://git-scm.com/book/en/Git-Basics-Viewing-the-Commit-Histor...
22106609
What does the value means in git?
11
2014-02-28 21:58:30
<p>In a <code>.gitattributes</code> file I found the following line</p> <pre><code>*.cs text diff=csharp </code></pre> <p>what does it mean?</p>
2,928
2,445,008
2014-02-28 22:32:49
22,106,661
11
2014-02-28 22:01:24
2,597,135
2014-02-28 22:01:24
https://stackoverflow.com/q/22106609
https://stackoverflow.com/a/22106661
<p>It means that for <code>.cs</code> (CSharp) files, git will use <code>text diff=csharp</code> as the merge/diff mode.</p> <p>This allows git to have a higher probability of success rates while merging.</p> <p>Also see <a href="http://git-scm.com/docs/gitattributes">the gitattributes doc</a>, which states:</p> <pr...
<p>It means that for <code>.cs</code> (CSharp) files, git will use <code>text diff=csharp</code> as the merge/diff mode.</p> <p>This allows git to have a higher probability of success rates while merging.</p> <p>Also see <a href="http://git-scm.com/docs/gitattributes">the gitattributes doc</a>, which states:</p> <pr...
9, 119, 56102
c#, git, gitattributes
<h1>What does the value means in git?</h1> <p>In a <code>.gitattributes</code> file I found the following line</p> <pre><code>*.cs text diff=csharp </code></pre> <p>what does it mean?</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,463
git
# What does the value means in git? In a `.gitattributes` file I found the following line ``` *.cs text diff=csharp ``` what does it mean?
It means that for `.cs` (CSharp) files, git will use `text diff=csharp` as the merge/diff mode. This allows git to have a higher probability of success rates while merging. Also see [the gitattributes doc](http://git-scm.com/docs/gitattributes), which states: ``` Setting the text attribute on a path enables end-of-l...
18587065
What is the mathematical structure that represents a Git repo
11
2013-09-03 08:03:09
<p>I am learning about Git, and it would be great if I had a description of the mathematical structure that represents a Git repo. For instance: it's a directed acyclic graph; its nodes represent commits; its nodes have labels (at most one label per node, no label used twice) that represent branches, etc. (I know this ...
2,420
336,527
2014-11-28 05:49:58
18,588,431
11
2013-09-03 09:16:52
1,256,452
2014-11-28 05:49:58
https://stackoverflow.com/q/18587065
https://stackoverflow.com/a/18588431
<p>In addition to the links in Nevik Rehnel's comment (copied here per request: <a href="http://eagain.net/articles/git-for-computer-scientists" rel="noreferrer">eagain.net/articles/git-for-computer-scientists</a> and <a href="http://gitolite.com/gcs" rel="noreferrer">gitolite.com/gcs</a>), and <a href="https://stackov...
<p>In addition to the links in Nevik Rehnel's comment (copied here per request: <a href="http://eagain.net/articles/git-for-computer-scientists" rel="noreferrer">eagain.net/articles/git-for-computer-scientists</a> and <a href="http://gitolite.com/gcs" rel="noreferrer">gitolite.com/gcs</a>), and <a href="https://stackov...
119, 5382
git, graph
<h1>What is the mathematical structure that represents a Git repo</h1> <p>I am learning about Git, and it would be great if I had a description of the mathematical structure that represents a Git repo. For instance: it's a directed acyclic graph; its nodes represent commits; its nodes have labels (at most one label per...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,464
git
# What is the mathematical structure that represents a Git repo I am learning about Git, and it would be great if I had a description of the mathematical structure that represents a Git repo. For instance: it's a directed acyclic graph; its nodes represent commits; its nodes have labels (at most one label per node, no...
In addition to the links in Nevik Rehnel's comment (copied here per request: [eagain.net/articles/git-for-computer-scientists](http://eagain.net/articles/git-for-computer-scientists) and [gitolite.com/gcs](http://gitolite.com/gcs)), and [sehe's point that the commit graph forms a Merkle Tree](https://stackoverflow.com/...
15310167
Working with git behind proxy
11
2013-03-09 11:31:41
<p>I'm behind a proxy. To get <code>git</code> working I would have to add</p> <pre><code>proxy = http://username:password@proxy.at.your.org:8080 </code></pre> <p>to <code>.gitconfig</code>.</p> <p>Since <code>username</code> and <code>password</code> are my system credentials this solution sucks because I would hav...
8,810
967,164
2016-02-05 11:38:53
15,310,274
11
2013-03-09 11:45:03
6,309
2016-02-05 11:38:53
https://stackoverflow.com/q/15310167
https://stackoverflow.com/a/15310274
<p>Update February 2016:</p> <p>With git 2.8 (March 2016), you don't have to embed in clear text your password in the url.</p> <p>See <a href="https://github.com/git/git/commit/372370f1675c2b935fb703665358dd5567641107" rel="noreferrer">commit 372370f</a>, <a href="https://github.com/git/git/commit/ef976395e26a25fb6d0...
<p>Update February 2016:</p> <p>With git 2.8 (March 2016), you don't have to embed in clear text your password in the url.</p> <p>See <a href="https://github.com/git/git/commit/372370f1675c2b935fb703665358dd5567641107" rel="noreferrer">commit 372370f</a>, <a href="https://github.com/git/git/commit/ef976395e26a25fb6d0...
64, 119, 725, 760
configuration, git, proxy, windows
<h1>Working with git behind proxy</h1> <p>I'm behind a proxy. To get <code>git</code> working I would have to add</p> <pre><code>proxy = http://username:password@proxy.at.your.org:8080 </code></pre> <p>to <code>.gitconfig</code>.</p> <p>Since <code>username</code> and <code>password</code> are my system credentials ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,466
git
# Working with git behind proxy I'm behind a proxy. To get `git` working I would have to add ``` proxy = http://username:password@proxy.at.your.org:8080 ``` to `.gitconfig`. Since `username` and `password` are my system credentials this solution sucks because I would have to store these as `cleartext`. I'm using `...
Update February 2016: With git 2.8 (March 2016), you don't have to embed in clear text your password in the url. See [commit 372370f](https://github.com/git/git/commit/372370f1675c2b935fb703665358dd5567641107), [commit ef97639](https://github.com/git/git/commit/ef976395e26a25fb6d048d859a1c8cddb2640b9a) (26 Jan 2016) ...