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
24039186
How to print a list of all commiters since branch creation
8
2014-06-04 13:46:05
<p>I am looking to print a single list of all users that committed on a branch since it was created from the master (or even as far back as master creation)</p> <p>I've looked at git log and I don't see such an option.</p> <p>Even if I was to use git log, I just want to print an entire list without having to tab thro...
1,292
777,906
2014-06-04 14:16:13
24,039,320
12
2014-06-04 13:51:17
1,843,331
2014-06-04 14:02:26
https://stackoverflow.com/q/24039186
https://stackoverflow.com/a/24039320
<p>To show a list of all committers you can use this command</p> <pre><code>$ git shortlog -sn </code></pre> <p>Output will be similar to</p> <pre><code>42 DJ180 1 Tim Castelijns </code></pre> <p>Naturally this first lists the number of commits and then the person who committed. In this case I made 1 commit and ...
<p>To show a list of all committers you can use this command</p> <pre><code>$ git shortlog -sn </code></pre> <p>Output will be similar to</p> <pre><code>42 DJ180 1 Tim Castelijns </code></pre> <p>Naturally this first lists the number of commits and then the person who committed. In this case I made 1 commit and ...
119
git
<h1>How to print a list of all commiters since branch creation</h1> <p>I am looking to print a single list of all users that committed on a branch since it was created from the master (or even as far back as master creation)</p> <p>I've looked at git log and I don't see such an option.</p> <p>Even if I was to use git...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,164
git
# How to print a list of all commiters since branch creation I am looking to print a single list of all users that committed on a branch since it was created from the master (or even as far back as master creation) I've looked at git log and I don't see such an option. Even if I was to use git log, I just want to pr...
To show a list of all committers you can use this command ``` $ git shortlog -sn ``` Output will be similar to ``` 42 DJ180 1 Tim Castelijns ``` Naturally this first lists the number of commits and then the person who committed. In this case I made 1 commit and you made 42 --- To list only the committers of th...
21309490
How do contents of git index evolve during a merge (and what's in the index after a failed merge)?
8
2014-01-23 13:25:55
<p>I have a fuzzy idea of what the <code>git</code> index contains as one does <code>git-add</code>s and <code>git-commit</code>s, but I don't have a clue of what happens to these contents when one does a <code>git-merge</code>. I'm particularly interested in learning what the index holds when a merge fails (e.g. due ...
1,483
559,827
2014-01-23 15:01:10
21,311,271
12
2014-01-23 14:40:38
1,256,452
2014-01-23 15:01:10
https://stackoverflow.com/q/21309490
https://stackoverflow.com/a/21311271
<p>For any given path, there are up to four "version numbers" in the index, numbered 0 (zero) through 3. I'll call them "slots" as if they were actually there for every entry, and then easily indexed (this makes them easier to think about), although actually extra versions are introduced dynamically only when needed. ...
<p>For any given path, there are up to four "version numbers" in the index, numbered 0 (zero) through 3. I'll call them "slots" as if they were actually there for every entry, and then easily indexed (this makes them easier to think about), although actually extra versions are introduced dynamically only when needed. ...
119, 28897, 68400
git, git-index, git-merge
<h1>How do contents of git index evolve during a merge (and what's in the index after a failed merge)?</h1> <p>I have a fuzzy idea of what the <code>git</code> index contains as one does <code>git-add</code>s and <code>git-commit</code>s, but I don't have a clue of what happens to these contents when one does a <code>g...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,166
git
# How do contents of git index evolve during a merge (and what's in the index after a failed merge)? I have a fuzzy idea of what the `git` index contains as one does `git-add`s and `git-commit`s, but I don't have a clue of what happens to these contents when one does a `git-merge`. I'm particularly interested in learn...
For any given path, there are up to four "version numbers" in the index, numbered 0 (zero) through 3. I'll call them "slots" as if they were actually there for every entry, and then easily indexed (this makes them easier to think about), although actually extra versions are introduced dynamically only when needed. Thes...
18292063
What does the prompt "[master +1 ~0 -0 !]>" mean when using Git command line?
8
2013-08-17 18:31:42
<p>After a few Git commands, I find my command line prompt change from</p> <pre><code>[master]&gt; </code></pre> <p>to</p> <pre><code>[master +1 ~0 -0 !]&gt; </code></pre> <p>What does this mean?</p>
4,064
1,849,461
2016-01-07 22:57:42
18,292,603
12
2013-08-17 19:34:47
6,309
2015-01-14 06:31:34
https://stackoverflow.com/q/18292063
https://stackoverflow.com/a/18292603
<p>This represents the number of files:</p> <ul> <li>added (<code>+</code>)</li> <li>modified (<code>~</code>)</li> <li>deleted (<code>-</code>)</li> <li>conflict (<code>!</code>) (from <a href="https://stackoverflow.com/users/2961878/alisa">alisa</a>'s <a href="https://stackoverflow.com/a/27932942/6309">answer</a>)</...
<p>This represents the number of files:</p> <ul> <li>added (<code>+</code>)</li> <li>modified (<code>~</code>)</li> <li>deleted (<code>-</code>)</li> <li>conflict (<code>!</code>) (from <a href="https://stackoverflow.com/users/2961878/alisa">alisa</a>'s <a href="https://stackoverflow.com/a/27932942/6309">answer</a>)</...
119, 456
git, version-control
<h1>What does the prompt "[master +1 ~0 -0 !]>" mean when using Git command line?</h1> <p>After a few Git commands, I find my command line prompt change from</p> <pre><code>[master]&gt; </code></pre> <p>to</p> <pre><code>[master +1 ~0 -0 !]&gt; </code></pre> <p>What does this mean?</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,167
git
# What does the prompt "[master +1 ~0 -0 !]>" mean when using Git command line? After a few Git commands, I find my command line prompt change from ``` [master]> ``` to ``` [master +1 ~0 -0 !]> ``` What does this mean?
This represents the number of files: - added (`+`) - modified (`~`) - deleted (`-`) - conflict (`!`) (from [alisa](https://stackoverflow.com/users/2961878/alisa)'s [answer](https://stackoverflow.com/a/27932942/6309)) You can see a [powershell version of that prompt here](http://markembling.info/2009/09/my-ideal-power...
16895965
Git Merge without removing the other branch to pull the changes
8
2013-06-03 11:46:22
<p>I searched a lot but was not able to find a confident solution(pardon me as I am new to git and maybe I didn't get some term well). So I will state my exact problem here:</p> <ol> <li><p>I have a software (say in branch main) of which I just released v5.0 and then I created a new branch (say 5b) to fix all the issu...
13,269
1,758,058
2013-06-03 11:55:17
16,896,143
12
2013-06-03 11:55:17
1,300,302
2013-06-03 11:55:17
https://stackoverflow.com/q/16895965
https://stackoverflow.com/a/16896143
<p>You have a branch - main</p> <p>You have a branch with bug fixes - 5b</p> <p>Now in order to merge your bug fixes changes to main,</p> <p>pull latest changes from main branch:</p> <pre><code> git checkout main git pull origin main </code></pre> <p>merge the changes in main branch to 5b branch (5b branch is up ...
<p>You have a branch - main</p> <p>You have a branch with bug fixes - 5b</p> <p>Now in order to merge your bug fixes changes to main,</p> <p>pull latest changes from main branch:</p> <pre><code> git checkout main git pull origin main </code></pre> <p>merge the changes in main branch to 5b branch (5b branch is up ...
119, 28897
git, git-merge
<h1>Git Merge without removing the other branch to pull the changes</h1> <p>I searched a lot but was not able to find a confident solution(pardon me as I am new to git and maybe I didn't get some term well). So I will state my exact problem here:</p> <ol> <li><p>I have a software (say in branch main) of which I just r...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,169
git
# Git Merge without removing the other branch to pull the changes I searched a lot but was not able to find a confident solution(pardon me as I am new to git and maybe I didn't get some term well). So I will state my exact problem here: 1. I have a software (say in branch main) of which I just released v5.0 and then ...
You have a branch - main You have a branch with bug fixes - 5b Now in order to merge your bug fixes changes to main, pull latest changes from main branch: ``` git checkout main git pull origin main ``` merge the changes in main branch to 5b branch (5b branch is up to date with main branch): ``` git checkout 5b...
16008260
How to copy TortoiseGit settings from one computer to the other?
8
2013-04-15 05:34:17
<p>I want to move my menu settings of TGit from one PC to other, but cant find them on HDD. Is it in registry somewhere? I'm on Windows 7 if that is important.</p>
2,469
333,296
2022-10-02 20:06:05
16,010,531
12
2013-04-15 08:15:01
6,309
2022-10-02 20:06:05
https://stackoverflow.com/q/16008260
https://stackoverflow.com/a/16010531
<p>The last comment of <a href="https://tortoisegit.org/issue/1013" rel="nofollow noreferrer">TortoiseGit Issue 1013</a> seems to show those entries are in:</p> <pre><code>HKCU/Software/TortoiseGit/ </code></pre> <hr /> <p><a href="https://stackoverflow.com/users/443836/marco-eckstein">Marco Eckstein</a> points out how...
<p>The last comment of <a href="https://tortoisegit.org/issue/1013" rel="nofollow noreferrer">TortoiseGit Issue 1013</a> seems to show those entries are in:</p> <pre><code>HKCU/Software/TortoiseGit/ </code></pre> <hr /> <p><a href="https://stackoverflow.com/users/443836/marco-eckstein">Marco Eckstein</a> points out how...
31409, 41624
tortoisegit, windows-7-x64
<h1>How to copy TortoiseGit settings from one computer to the other?</h1> <p>I want to move my menu settings of TGit from one PC to other, but cant find them on HDD. Is it in registry somewhere? I'm on Windows 7 if that is important.</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,170
git
# How to copy TortoiseGit settings from one computer to the other? I want to move my menu settings of TGit from one PC to other, but cant find them on HDD. Is it in registry somewhere? I'm on Windows 7 if that is important.
The last comment of [TortoiseGit Issue 1013](https://tortoisegit.org/issue/1013) seems to show those entries are in: ``` HKCU/Software/TortoiseGit/ ``` --- [Marco Eckstein](https://stackoverflow.com/users/443836/marco-eckstein) points out however in [his article](http://www.marcoeckstein.com/it/how-to-share-tortoise...
11882121
git branch (no branch)
8
2012-08-09 11:11:12
<p>well, i have just made a huge mistake.</p> <p>I am working on a project, and thought i was working in the master branch.<br> So i added the files i needed, commited them and when i tried to push to origin i got </p> <pre><code>Everything is up to date </code></pre> <p>I used <code>git branch</code> and got</p> <...
4,590
470,772
2012-08-09 13:05:57
11,882,203
12
2012-08-09 11:16:06
421,089
2012-08-09 11:16:06
https://stackoverflow.com/q/11882121
https://stackoverflow.com/a/11882203
<p>You haven't lost the changes if they were committed. You just don't have a named reference to them.</p> <p>Try running <code>git reflog</code> and look for a line near the top that will say something like <code>checkout: moving from &lt;commit-id&gt; to master</code>. You can then use that <code>&lt;commit-id&gt;</...
<p>You haven't lost the changes if they were committed. You just don't have a named reference to them.</p> <p>Try running <code>git reflog</code> and look for a line near the top that will say something like <code>checkout: moving from &lt;commit-id&gt; to master</code>. You can then use that <code>&lt;commit-id&gt;</...
119
git
<h1>git branch (no branch)</h1> <p>well, i have just made a huge mistake.</p> <p>I am working on a project, and thought i was working in the master branch.<br> So i added the files i needed, commited them and when i tried to push to origin i got </p> <pre><code>Everything is up to date </code></pre> <p>I used <code>...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,172
git
# git branch (no branch) well, i have just made a huge mistake. I am working on a project, and thought i was working in the master branch. So i added the files i needed, commited them and when i tried to push to origin i got ``` Everything is up to date ``` I used `git branch` and got ``` * (no branch) * master ...
You haven't lost the changes if they were committed. You just don't have a named reference to them. Try running `git reflog` and look for a line near the top that will say something like `checkout: moving from <commit-id> to master`. You can then use that `<commit-id>` to create a temp branch to inspect your changes a...
11756250
How to clean up unused side-branches in your commit trees?
8
2012-08-01 09:21:06
<p>How would you clean up unused side-branches in your commit trees (not real git branches)?</p> <p>Example (tree, fake-commit-hash, commit message, optional [pointers]):</p> <pre><code>* 0001 last commit [master] [origin/master] [HEAD] | * 0002 old, unused merge |/| * | 0003 some remote commits * | 0004 anothe...
2,815
131,120
2012-08-01 12:24:12
11,759,044
12
2012-08-01 12:18:20
131,120
2012-08-01 12:24:12
https://stackoverflow.com/q/11756250
https://stackoverflow.com/a/11759044
<p><a href="https://stackoverflow.com/users/51019/tarsius">tarsius</a> wrote <a href="https://stackoverflow.com/a/4528593/131120">in an answer to another question</a>:</p> <blockquote> <pre><code>git reflog expire --expire=now --all git gc --prune=now </code></pre> </blockquote> <p>which clears the reflog and then cl...
<p><a href="https://stackoverflow.com/users/51019/tarsius">tarsius</a> wrote <a href="https://stackoverflow.com/a/4528593/131120">in an answer to another question</a>:</p> <blockquote> <pre><code>git reflog expire --expire=now --all git gc --prune=now </code></pre> </blockquote> <p>which clears the reflog and then cl...
119, 29934
git, git-rebase
<h1>How to clean up unused side-branches in your commit trees?</h1> <p>How would you clean up unused side-branches in your commit trees (not real git branches)?</p> <p>Example (tree, fake-commit-hash, commit message, optional [pointers]):</p> <pre><code>* 0001 last commit [master] [origin/master] [HEAD] | * 0002 ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,173
git
# How to clean up unused side-branches in your commit trees? How would you clean up unused side-branches in your commit trees (not real git branches)? Example (tree, fake-commit-hash, commit message, optional [pointers]): ``` * 0001 last commit [master] [origin/master] [HEAD] | * 0002 old, unused merge |/| * | ...
[tarsius](https://stackoverflow.com/users/51019/tarsius) wrote [in an answer to another question](https://stackoverflow.com/a/4528593/131120): > ``` > git reflog expire --expire=now --all > git gc --prune=now > ``` which clears the reflog and then cleans up the repository. Cleaning the reflog at first doesn't always ...
11597682
Generate the working directory files from .git directory
8
2012-07-22 04:04:02
<p>I have the <code>.git</code> directory, but I do not have the actual working directory, just the repo. What command can I use to recreate the working directory? </p>
1,780
null
2012-07-23 09:38:37
11,597,711
12
2012-07-22 04:10:57
136,451
2012-07-22 04:10:57
https://stackoverflow.com/q/11597682
https://stackoverflow.com/a/11597711
<p>Let's say the .git dir is in an otherwise empty directory called "test."</p> <pre><code>git clone test new_test </code></pre> <p>new_test will now contain the .git directory and a working copy. Alternatively, you can also point directly to the .git directory:</p> <pre><code>git clone test/.git new_test </code></...
<p>Let's say the .git dir is in an otherwise empty directory called "test."</p> <pre><code>git clone test new_test </code></pre> <p>new_test will now contain the .git directory and a working copy. Alternatively, you can also point directly to the .git directory:</p> <pre><code>git clone test/.git new_test </code></...
119
git
<h1>Generate the working directory files from .git directory</h1> <p>I have the <code>.git</code> directory, but I do not have the actual working directory, just the repo. What command can I use to recreate the working directory? </p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,174
git
# Generate the working directory files from .git directory I have the `.git` directory, but I do not have the actual working directory, just the repo. What command can I use to recreate the working directory?
Let's say the .git dir is in an otherwise empty directory called "test." ``` git clone test new_test ``` new_test will now contain the .git directory and a working copy. Alternatively, you can also point directly to the .git directory: ``` git clone test/.git new_test ``` with the same result.
9521422
git rebase "--preserve-merges --onto" doesn't preserve merges
8
2012-03-01 17:58:43
<p>Using git v1.7.1 I'm trying to do a rebase with both the <code>--preserve-merges</code> and <code>--onto</code> features at the same time. The end results seems to be without the merge commits, and so appears linear. I'd rather preserve the merge commits, for the same reason that people would often use <code>--prese...
2,759
755,917
2018-01-20 11:37:57
9,527,506
12
2012-03-02 03:17:44
755,917
2012-08-22 11:46:40
https://stackoverflow.com/q/9521422
https://stackoverflow.com/a/9527506
<p>Many thanks to Bombe and an offline friend for pointing out that is does work for some people. With that inspiration, I am now able to answer my own question.</p> <p>Short answer: git versions before 1.7.5.2 will exhibit this bad behavior.</p> <p>Long answer: in git's own source repo, commit <a href="https://githu...
<p>Many thanks to Bombe and an offline friend for pointing out that is does work for some people. With that inspiration, I am now able to answer my own question.</p> <p>Short answer: git versions before 1.7.5.2 will exhibit this bad behavior.</p> <p>Long answer: in git's own source repo, commit <a href="https://githu...
119, 8974
git, rebase
<h1>git rebase "--preserve-merges --onto" doesn't preserve merges</h1> <p>Using git v1.7.1 I'm trying to do a rebase with both the <code>--preserve-merges</code> and <code>--onto</code> features at the same time. The end results seems to be without the merge commits, and so appears linear. I'd rather preserve the merge...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,177
git
# git rebase "--preserve-merges --onto" doesn't preserve merges Using git v1.7.1 I'm trying to do a rebase with both the `--preserve-merges` and `--onto` features at the same time. The end results seems to be without the merge commits, and so appears linear. I'd rather preserve the merge commits, for the same reason t...
Many thanks to Bombe and an offline friend for pointing out that is does work for some people. With that inspiration, I am now able to answer my own question. Short answer: git versions before 1.7.5.2 will exhibit this bad behavior. Long answer: in git's own source repo, commit [c192f9c865dbdae48c0400d717581d34cd315f...
8476922
Git How to: pull diff between branches
8
2011-12-12 15:47:54
<p>I would like to download the files that are the difference between two branches into a local folder. Is it possible with Git?</p> <p>Given the files are only added to the source branch, they are not changed.</p>
9,928
213,736
2011-12-12 16:03:18
8,476,990
12
2011-12-12 15:53:13
125,816
2011-12-12 16:03:07
https://stackoverflow.com/q/8476922
https://stackoverflow.com/a/8476990
<p>You can get all changes between branches with something around these lines:</p> <pre><code>git diff origin/master origin/develop &gt; my_diff.diff </code></pre> <p>If you only add [text] files, then it would be trivial to parse the diff file and break it into individual files. (I'd say, it's a ruby script under 50...
<p>You can get all changes between branches with something around these lines:</p> <pre><code>git diff origin/master origin/develop &gt; my_diff.diff </code></pre> <p>If you only add [text] files, then it would be trivial to parse the diff file and break it into individual files. (I'd say, it's a ruby script under 50...
119, 606, 1879, 4860
branch, diff, git, pull
<h1>Git How to: pull diff between branches</h1> <p>I would like to download the files that are the difference between two branches into a local folder. Is it possible with Git?</p> <p>Given the files are only added to the source branch, they are not changed.</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,178
git
# Git How to: pull diff between branches I would like to download the files that are the difference between two branches into a local folder. Is it possible with Git? Given the files are only added to the source branch, they are not changed.
You can get all changes between branches with something around these lines: ``` git diff origin/master origin/develop > my_diff.diff ``` If you only add [text] files, then it would be trivial to parse the diff file and break it into individual files. (I'd say, it's a ruby script under 50 lines of code)
7656491
Why is git submodule update failing?
8
2011-10-05 03:45:51
<p>I have the following <code>.gitmodules</code> file:</p> <pre><code>[submodule "web/blog"] path = web/blog url = git://amygdala.servebeer.com:lucky_blog.git [submodule "web/old"] path = web/old url = git://amygdala.servebeer.com:old_lucky.git </code></pre> <p>When I clone the repo and run <code>gi...
16,320
10,636
2012-01-07 09:31:01
7,658,327
12
2011-10-05 08:00:08
223,092
2011-10-05 08:29:37
https://stackoverflow.com/q/7656491
https://stackoverflow.com/a/7658327
<p>You have the <a href="http://schacon.github.com/git/git-clone.html#URLS" rel="noreferrer">format of your git URLs</a> slightly wrong - you should separate the host from the path with <code>/</code> rather than <code>:</code>. Try changing the URLs to:</p> <pre><code>git://amygdala.servebeer.com/lucky_blog.git git:...
<p>You have the <a href="http://schacon.github.com/git/git-clone.html#URLS" rel="noreferrer">format of your git URLs</a> slightly wrong - you should separate the host from the path with <code>/</code> rather than <code>:</code>. Try changing the URLs to:</p> <pre><code>git://amygdala.servebeer.com/lucky_blog.git git:...
119, 41612
git, git-submodules
<h1>Why is git submodule update failing?</h1> <p>I have the following <code>.gitmodules</code> file:</p> <pre><code>[submodule "web/blog"] path = web/blog url = git://amygdala.servebeer.com:lucky_blog.git [submodule "web/old"] path = web/old url = git://amygdala.servebeer.com:old_lucky.git </code></p...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,179
git
# Why is git submodule update failing? I have the following `.gitmodules` file: ``` [submodule "web/blog"] path = web/blog url = git://amygdala.servebeer.com:lucky_blog.git [submodule "web/old"] path = web/old url = git://amygdala.servebeer.com:old_lucky.git ``` When I clone the repo and run `git su...
You have the [format of your git URLs](http://schacon.github.com/git/git-clone.html#URLS) slightly wrong - you should separate the host from the path with `/` rather than `:`. Try changing the URLs to: ``` git://amygdala.servebeer.com/lucky_blog.git git://amygdala.servebeer.com/old_lucky.git ``` You will not only nee...
7018049
Using gitk on msysgit
8
2011-08-10 21:26:45
<p>I'm trying to use the gitk on mysysgit. I'm not using Cygwin or MinGW to run mysysgit, just a straight up DOS command prompt on Windows.</p> <p>The gitk file is in the bin/ folder, but it's not an executable, so when I type <code>gitk</code> I get:</p> <blockquote> <p>'gitk' is not recognized as an internal or ...
1,019
378,622
2015-11-14 19:57:32
7,018,206
12
2011-08-10 21:40:56
526,535
2011-08-10 21:40:56
https://stackoverflow.com/q/7018049
https://stackoverflow.com/a/7018206
<p>Use <code>gitk.cmd</code> from the <code>cmd/</code> folder</p>
<p>Use <code>gitk.cmd</code> from the <code>cmd/</code> folder</p>
119, 21628, 30785
git, gitk, msysgit
<h1>Using gitk on msysgit</h1> <p>I'm trying to use the gitk on mysysgit. I'm not using Cygwin or MinGW to run mysysgit, just a straight up DOS command prompt on Windows.</p> <p>The gitk file is in the bin/ folder, but it's not an executable, so when I type <code>gitk</code> I get:</p> <blockquote> <p>'gitk' is no...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,180
git
# Using gitk on msysgit I'm trying to use the gitk on mysysgit. I'm not using Cygwin or MinGW to run mysysgit, just a straight up DOS command prompt on Windows. The gitk file is in the bin/ folder, but it's not an executable, so when I type `gitk` I get: > 'gitk' is not recognized as an internal or external command,...
Use `gitk.cmd` from the `cmd/` folder
4335641
Git: repo for multiple users on a server
8
2010-12-02 13:44:53
<p>I created a Git repo on a server and want it to be used by several people, i.e. users which belong to the same Unix group. It also has a working copy because it may be useful for us to have a common working copy.</p> <p>Thus I set the owning group of that Git repo directory to that Unix group.</p> <p>The problem i...
2,663
133,374
2010-12-02 21:19:51
4,335,649
12
2010-12-02 13:45:35
133,374
2010-12-02 13:45:35
https://stackoverflow.com/q/4335641
https://stackoverflow.com/a/4335649
<p>Ok, figured it out.</p> <p>The first important thing (which I did already) was:</p> <pre><code>git config core.sharedRepository group </code></pre> <p>The second one was this:</p> <pre><code>chmod g+s -R . </code></pre>
<p>Ok, figured it out.</p> <p>The first important thing (which I did already) was:</p> <pre><code>git config core.sharedRepository group </code></pre> <p>The second one was this:</p> <pre><code>chmod g+s -R . </code></pre>
34, 119, 2120, 2504
file-permissions, git, shared, unix
<h1>Git: repo for multiple users on a server</h1> <p>I created a Git repo on a server and want it to be used by several people, i.e. users which belong to the same Unix group. It also has a working copy because it may be useful for us to have a common working copy.</p> <p>Thus I set the owning group of that Git repo d...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,182
git
# Git: repo for multiple users on a server I created a Git repo on a server and want it to be used by several people, i.e. users which belong to the same Unix group. It also has a working copy because it may be useful for us to have a common working copy. Thus I set the owning group of that Git repo directory to that...
Ok, figured it out. The first important thing (which I did already) was: ``` git config core.sharedRepository group ``` The second one was this: ``` chmod g+s -R . ```
3823731
git workflow for keeping custom-modified open source software up to date?
8
2010-09-29 16:30:18
<p>Our University provides web hosting to campus departments on servers we manage. Installing open-source third-party programs requires modifying file permissions and code in the program before it will run. (We're using suEXEC, if you're familiar.)</p> <p>We currently offer WordPress via an installer script. The user ...
2,905
438,911
2010-09-30 05:33:43
3,823,851
12
2010-09-29 16:42:51
54,249
2010-09-30 05:33:43
https://stackoverflow.com/q/3823731
https://stackoverflow.com/a/3823851
<p>I would suggest keeping your changes in a branch, and rebasing that branch against the latest from WordPress whenever you update. In a rough timeline...</p> <pre><code> +-- WordPress 1.0 v [master] --*--* \ [custom] *--*--* &lt;- your customizations </code></pre>...
<p>I would suggest keeping your changes in a branch, and rebasing that branch against the latest from WordPress whenever you update. In a rough timeline...</p> <pre><code> +-- WordPress 1.0 v [master] --*--* \ [custom] *--*--* &lt;- your customizations </code></pre>...
119, 758, 1835, 53847
branching-and-merging, git, open-source, workflow
<h1>git workflow for keeping custom-modified open source software up to date?</h1> <p>Our University provides web hosting to campus departments on servers we manage. Installing open-source third-party programs requires modifying file permissions and code in the program before it will run. (We're using suEXEC, if you're...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,183
git
# git workflow for keeping custom-modified open source software up to date? Our University provides web hosting to campus departments on servers we manage. Installing open-source third-party programs requires modifying file permissions and code in the program before it will run. (We're using suEXEC, if you're familiar...
I would suggest keeping your changes in a branch, and rebasing that branch against the latest from WordPress whenever you update. In a rough timeline... ``` +-- WordPress 1.0 v [master] --*--* \ [custom] *--*--* <- your customizations ``` When you want to update W...
2303979
Git setup remote tracking branch
8
2010-02-20 22:19:23
<p>I want to track a remote master branch from a new remote repository. Both do already exist. </p> <p>How do I go about this in git? I can't seem to get it right. I tried:</p> <pre><code>git remote add otherRepo git://... git branch -t myTrack otherRepo/master </code></pre> <p>However, I get the following error: </...
6,750
125,407
2010-02-21 01:21:48
2,304,375
12
2010-02-21 00:56:59
193,688
2010-02-21 01:21:48
https://stackoverflow.com/q/2303979
https://stackoverflow.com/a/2304375
<p>As covered in the comments: <code>git remote add otherRepo …</code> only configures the remote, it does not fetch anything from it. You will need to run <code>git fetch otherRepo</code> to fetch the branches of the remote repository before you can create local branches based on them.</p> <hr> <p>(responding to fur...
<p>As covered in the comments: <code>git remote add otherRepo …</code> only configures the remote, it does not fetch anything from it. You will need to run <code>git fetch otherRepo</code> to fetch the branches of the remote repository before you can create local branches based on them.</p> <hr> <p>(responding to fur...
119
git
<h1>Git setup remote tracking branch</h1> <p>I want to track a remote master branch from a new remote repository. Both do already exist. </p> <p>How do I go about this in git? I can't seem to get it right. I tried:</p> <pre><code>git remote add otherRepo git://... git branch -t myTrack otherRepo/master </code></pre> ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,184
git
# Git setup remote tracking branch I want to track a remote master branch from a new remote repository. Both do already exist. How do I go about this in git? I can't seem to get it right. I tried: ``` git remote add otherRepo git://... git branch -t myTrack otherRepo/master ``` However, I get the following error: ...
As covered in the comments: `git remote add otherRepo …` only configures the remote, it does not fetch anything from it. You will need to run `git fetch otherRepo` to fetch the branches of the remote repository before you can create local branches based on them. --- (responding to further comment by OP) If you only ...
1498675
Better way to use git add?
8
2009-09-30 15:00:53
<p>As a git noob trying it out on a Rails project, I am wondering if it is bad practice to do <code>git add .</code> (add current directory) before every commit. The intro tutorials I have seen show adding the current directory initially, then using <code>git add new_file</code> to add files after that. If I'm adding...
10,321
102,961
2013-11-15 22:39:18
1,498,713
12
2009-09-30 15:05:02
17,042
2009-09-30 15:05:02
https://stackoverflow.com/q/1498675
https://stackoverflow.com/a/1498713
<p><code>git add .</code> will add everything that's in the heirarchy, including new files. If you want to track all files that are in the directory, this is fine.</p> <p>Another (perhaps more common) usage is to do <code>git commit -a</code>, which adds only the files that changed since the last commit before commit...
<p><code>git add .</code> will add everything that's in the heirarchy, including new files. If you want to track all files that are in the directory, this is fine.</p> <p>Another (perhaps more common) usage is to do <code>git commit -a</code>, which adds only the files that changed since the last commit before commit...
119
git
<h1>Better way to use git add?</h1> <p>As a git noob trying it out on a Rails project, I am wondering if it is bad practice to do <code>git add .</code> (add current directory) before every commit. The intro tutorials I have seen show adding the current directory initially, then using <code>git add new_file</code> to ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,185
git
# Better way to use git add? As a git noob trying it out on a Rails project, I am wondering if it is bad practice to do `git add .` (add current directory) before every commit. The intro tutorials I have seen show adding the current directory initially, then using `git add new_file` to add files after that. If I'm add...
`git add .` will add everything that's in the heirarchy, including new files. If you want to track all files that are in the directory, this is fine. Another (perhaps more common) usage is to do `git commit -a`, which adds only the files that changed since the last commit before committing, and doesn't include any new...
1356112
How to merge head commits from another branch?
8
2009-08-31 06:42:09
<p>Usually I work on the master branch, and I make some commits, and push it.</p> <p>Then I also need to push these commits to other branch.</p> <p>So usually, I will do:</p> <pre><code>$ git checkout another-branch $ git cherry-pick commit1 $ git cherry-pick commit2 ... $ git cherry-pick commitn $ git push </code><...
18,774
75,501
2012-10-09 21:48:37
1,358,351
12
2009-08-31 17:01:55
119,963
2009-08-31 17:01:55
https://stackoverflow.com/q/1356112
https://stackoverflow.com/a/1358351
<p>It sounds like you might want to make those commits on a branch other than master, and then merge that branch to both master and your second branch:</p> <pre><code>git checkout working-branch &lt;do some work&gt; git commit git checkout master git merge working-branch git checkout second-branch git merge working-br...
<p>It sounds like you might want to make those commits on a branch other than master, and then merge that branch to both master and your second branch:</p> <pre><code>git checkout working-branch &lt;do some work&gt; git commit git checkout master git merge working-branch git checkout second-branch git merge working-br...
119
git
<h1>How to merge head commits from another branch?</h1> <p>Usually I work on the master branch, and I make some commits, and push it.</p> <p>Then I also need to push these commits to other branch.</p> <p>So usually, I will do:</p> <pre><code>$ git checkout another-branch $ git cherry-pick commit1 $ git cherry-pick c...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,186
git
# How to merge head commits from another branch? Usually I work on the master branch, and I make some commits, and push it. Then I also need to push these commits to other branch. So usually, I will do: ``` $ git checkout another-branch $ git cherry-pick commit1 $ git cherry-pick commit2 ... $ git cherry-pick commi...
It sounds like you might want to make those commits on a branch other than master, and then merge that branch to both master and your second branch: ``` git checkout working-branch <do some work> git commit git checkout master git merge working-branch git checkout second-branch git merge working-branch ``` This is mu...
69892747
Why does a deleted remote branch in git still show up when you do a 'git branch -a?
7
2021-11-09 04:11:08
<p>I'm trying to delete a branch on git both locally and remotely. And I think I've been successful. Thing is it still shows up remotely when I do a 'git branch -a'</p> <p>I did this to delete it locally:</p> <pre><code>git branch -d branchToDelete </code></pre> <p>and this to delete it remotely:</p> <pre><code>git p...
5,897
13,894,850
2021-11-09 07:12:16
69,894,119
12
2021-11-09 07:12:16
16,406
2021-11-09 07:12:16
https://stackoverflow.com/q/69892747
https://stackoverflow.com/a/69894119
<p>You need to do a <code>git fetch -p</code> to prune (remove) local tracking branches of remote branches that have been deleted.</p>
<p>You need to do a <code>git fetch -p</code> to prune (remove) local tracking branches of remote branches that have been deleted.</p>
119
git
<h1>Why does a deleted remote branch in git still show up when you do a 'git branch -a?</h1> <p>I'm trying to delete a branch on git both locally and remotely. And I think I've been successful. Thing is it still shows up remotely when I do a 'git branch -a'</p> <p>I did this to delete it locally:</p> <pre><code>git b...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,190
git
# Why does a deleted remote branch in git still show up when you do a 'git branch -a? I'm trying to delete a branch on git both locally and remotely. And I think I've been successful. Thing is it still shows up remotely when I do a 'git branch -a' I did this to delete it locally: ``` git branch -d branchToDelete ```...
You need to do a `git fetch -p` to prune (remove) local tracking branches of remote branches that have been deleted.
68665189
GITLens switch to commit made my newer commits disappear
7
2021-08-05 10:49:33
<p>very scary situation right now: I have used the <code>GitLens</code> extension of <code>VSCode</code> to jump back to an older commit. I wanted to <code>checkout</code> the commit, located it in the <code>COMMITS</code> sidebar, right clicked and selected <code>Switch to Commit...</code>. I did expect to checkout to...
3,933
10,270,245
2021-08-06 12:37:01
68,666,522
12
2021-08-05 12:22:58
1,256,452
2021-08-06 12:37:01
https://stackoverflow.com/q/68665189
https://stackoverflow.com/a/68666522
<p>This <em>is</em> scary, to those new to Git. But don't worry: all the commits are still there.</p> <p>Various GUIs, including Visual Studio, block access to Git (which could be good or bad, depending on your point of view) so that you can't see what's really going on, and I don't <em>use</em> these GUIs, because th...
<p>This <em>is</em> scary, to those new to Git. But don't worry: all the commits are still there.</p> <p>Various GUIs, including Visual Studio, block access to Git (which could be good or bad, depending on your point of view) so that you can't see what's really going on, and I don't <em>use</em> these GUIs, because th...
119, 111608, 146697
git, gitlens, visual-studio-code
<h1>GITLens switch to commit made my newer commits disappear</h1> <p>very scary situation right now: I have used the <code>GitLens</code> extension of <code>VSCode</code> to jump back to an older commit. I wanted to <code>checkout</code> the commit, located it in the <code>COMMITS</code> sidebar, right clicked and sele...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,191
git
# GITLens switch to commit made my newer commits disappear very scary situation right now: I have used the `GitLens` extension of `VSCode` to jump back to an older commit. I wanted to `checkout` the commit, located it in the `COMMITS` sidebar, right clicked and selected `Switch to Commit...`. I did expect to checkout ...
This *is* scary, to those new to Git. But don't worry: all the commits are still there. Various GUIs, including Visual Studio, block access to Git (which could be good or bad, depending on your point of view) so that you can't see what's really going on, and I don't *use* these GUIs, because they keep you from seeing ...
60768371
Running Jest in --watch mode in a Docker container in a subdirectory of git root
7
2020-03-20 04:01:27
<p>I have built a web project with the following file structure:</p> <pre><code>-root_folder/ -docker-compose.yml -.git/ -backend/ -.dockerignore -docker/ -dev.dockerfile -frontend/ -.dockerignore -docker/ -dev.dockerfile </code></pre> <p>I run the frontend app (Angular) in a Docke...
3,719
11,579,246
2020-03-21 21:27:54
60,792,672
12
2020-03-21 20:02:22
11,579,246
2020-03-21 21:27:54
https://stackoverflow.com/q/60768371
https://stackoverflow.com/a/60792672
<p>I was able to get this working exactly as I wanted. The problem is that in order for Jest to run in watch mode, it does so by looking at the changed files according to Git. I was able to get this functionality working by setting up the directory structure on the container similar to my host system with:</p> <pre><c...
<p>I was able to get this working exactly as I wanted. The problem is that in order for Jest to run in watch mode, it does so by looking at the changed files according to Git. I was able to get this functionality working by setting up the directory structure on the container similar to my host system with:</p> <pre><c...
119, 46426, 90304, 105124
docker, git, jestjs, node.js
<h1>Running Jest in --watch mode in a Docker container in a subdirectory of git root</h1> <p>I have built a web project with the following file structure:</p> <pre><code>-root_folder/ -docker-compose.yml -.git/ -backend/ -.dockerignore -docker/ -dev.dockerfile -frontend/ -.dockerignore -d...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,196
git
# Running Jest in --watch mode in a Docker container in a subdirectory of git root I have built a web project with the following file structure: ``` -root_folder/ -docker-compose.yml -.git/ -backend/ -.dockerignore -docker/ -dev.dockerfile -frontend/ -.dockerignore -docker/ -dev.do...
I was able to get this working exactly as I wanted. The problem is that in order for Jest to run in watch mode, it does so by looking at the changed files according to Git. I was able to get this functionality working by setting up the directory structure on the container similar to my host system with: ``` -app/ -....
60700767
warning: Not setting branch master as its own upstream
7
2020-03-16 05:31:24
<p>I am trying to set git branch upstream but getting below warning.</p> <h3>Command</h3> <pre><code>git checkout master git branch --set-upstream-to master </code></pre> <blockquote> <p>warning: Not setting branch master as its own upstream.</p> </blockquote> <p>How can I solve it?</p> <p>Does that mean it already bei...
12,213
1,084,174
2020-03-16 05:34:56
60,700,795
12
2020-03-16 05:34:56
6,309
2020-03-16 05:34:56
https://stackoverflow.com/q/60700767
https://stackoverflow.com/a/60700795
<p>That should be:</p> <pre><code> git branch --set-upstream-to origin/master </code></pre> <p>But if <code>origin/master</code> is there, the <a href="https://git-scm.com/docs/git-checkout#_description" rel="noreferrer">checkout</a> should have tracked it already.</p> <blockquote> <p>If <code>&lt;branch&gt;</code...
<p>That should be:</p> <pre><code> git branch --set-upstream-to origin/master </code></pre> <p>But if <code>origin/master</code> is there, the <a href="https://git-scm.com/docs/git-checkout#_description" rel="noreferrer">checkout</a> should have tracked it already.</p> <blockquote> <p>If <code>&lt;branch&gt;</code...
119, 456, 1879
branch, git, version-control
<h1>warning: Not setting branch master as its own upstream</h1> <p>I am trying to set git branch upstream but getting below warning.</p> <h3>Command</h3> <pre><code>git checkout master git branch --set-upstream-to master </code></pre> <blockquote> <p>warning: Not setting branch master as its own upstream.</p> </blockqu...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,197
git
# warning: Not setting branch master as its own upstream I am trying to set git branch upstream but getting below warning. ### Command ``` git checkout master git branch --set-upstream-to master ``` > warning: Not setting branch master as its own upstream. How can I solve it? Does that mean it already being traci...
That should be: ``` git branch --set-upstream-to origin/master ``` But if `origin/master` is there, the [checkout](https://git-scm.com/docs/git-checkout#_description) should have tracked it already. > If `<branch>` is not found but there does exist a tracking branch in exactly one remote (call it `<remote>`) with a...
57817642
What's the purpose of dimmed-zebra?
7
2019-09-06 07:35:08
<p><code>git diff</code> has this feature <code>--color-moved=dimmed-zebra</code> which sounds really nifty but I just don't get it. If found <code>zebra</code> to be very useful since it shows moved blocks. But <code>dimmed_zebra</code> seems completely arbitrary to me. Why are &quot;the bordering lines of two adjacen...
1,103
2,019,549
2019-09-06 23:21:35
57,829,126
12
2019-09-06 22:22:10
8,705,432
2019-09-06 22:22:10
https://stackoverflow.com/q/57817642
https://stackoverflow.com/a/57829126
<p>The <code>dimmed-zebra</code> mode is useful when the patch consists mostly of moved or copied code with a few lines changed in the middle of the copied code. Take, for example, <a href="https://github.com/git/git/commit/7f005b0f483a507d3c7b353f4753ac3fece88bc0" rel="noreferrer">a particular commit from Git</a> (th...
<p>The <code>dimmed-zebra</code> mode is useful when the patch consists mostly of moved or copied code with a few lines changed in the middle of the copied code. Take, for example, <a href="https://github.com/git/git/commit/7f005b0f483a507d3c7b353f4753ac3fece88bc0" rel="noreferrer">a particular commit from Git</a> (th...
119
git
<h1>What's the purpose of dimmed-zebra?</h1> <p><code>git diff</code> has this feature <code>--color-moved=dimmed-zebra</code> which sounds really nifty but I just don't get it. If found <code>zebra</code> to be very useful since it shows moved blocks. But <code>dimmed_zebra</code> seems completely arbitrary to me. Why...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,198
git
# What's the purpose of dimmed-zebra? `git diff` has this feature `--color-moved=dimmed-zebra` which sounds really nifty but I just don't get it. If found `zebra` to be very useful since it shows moved blocks. But `dimmed_zebra` seems completely arbitrary to me. Why are "the bordering lines of two adjacent blocks...co...
The `dimmed-zebra` mode is useful when the patch consists mostly of moved or copied code with a few lines changed in the middle of the copied code. Take, for example, [a particular commit from Git](https://github.com/git/git/commit/7f005b0f483a507d3c7b353f4753ac3fece88bc0) (this link won't show the mode, however). The...
51071891
Auto increment version number in a Python webserver, with git
7
2018-06-27 21:47:40
<p>I have a Python webserver (using Bottle or Flask or any other) that I develop locally:</p> <pre><code>BUILDVERSION = "0.0.128" @route('/') def homepage(): ... # using a template, and the homepage shows the BUILDVERSION in the footer # so that I always know which live version is running ... run(ho...
6,214
1,422,096
2018-06-28 16:37:56
51,076,605
12
2018-06-28 07:03:13
1,422,096
2018-06-28 07:08:41
https://stackoverflow.com/q/51071891
https://stackoverflow.com/a/51076605
<p>As mentioned in <a href="https://stackoverflow.com/questions/17101473/change-version-file-automatically-on-commit-with-git">Change version file automatically on commit with git</a>, git <a href="http://git-scm.com/book/en/Customizing-Git-Git-Hooks" rel="noreferrer">hooks</a> and more specifically a <code>pre-commit...
<p>As mentioned in <a href="https://stackoverflow.com/questions/17101473/change-version-file-automatically-on-commit-with-git">Change version file automatically on commit with git</a>, git <a href="http://git-scm.com/book/en/Customizing-Git-Git-Hooks" rel="noreferrer">hooks</a> and more specifically a <code>pre-commit...
16, 119, 53850
git, git-commit, python
<h1>Auto increment version number in a Python webserver, with git</h1> <p>I have a Python webserver (using Bottle or Flask or any other) that I develop locally:</p> <pre><code>BUILDVERSION = "0.0.128" @route('/') def homepage(): ... # using a template, and the homepage shows the BUILDVERSION in the footer ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,201
git
# Auto increment version number in a Python webserver, with git I have a Python webserver (using Bottle or Flask or any other) that I develop locally: ``` BUILDVERSION = "0.0.128" @route('/') def homepage(): ... # using a template, and the homepage shows the BUILDVERSION in the footer # so that I alw...
As mentioned in [Change version file automatically on commit with git](https://stackoverflow.com/questions/17101473/change-version-file-automatically-on-commit-with-git), git [hooks](http://git-scm.com/book/en/Customizing-Git-Git-Hooks) and more specifically a `pre-commit` hook can be used to do that. In the specific ...
49560696
Mercurial merge strategy vs Git merge strategy
7
2018-03-29 16:13:17
<p>I've used git for years, and recently switched to mercurial for a project. I've learned how to use Mercurial quite well via the command line over the past 6 months. </p> <p>This could be my imagination, but it seems to me that mercurial is much worse at merging, and results in way more conflicted files. I'll merge ...
2,021
1,993,937
2018-03-29 16:38:52
49,561,046
12
2018-03-29 16:33:17
1,256,452
2018-03-29 16:38:52
https://stackoverflow.com/q/49560696
https://stackoverflow.com/a/49561046
<blockquote> <p>1) Mercurial cannot merge or has issues merging with multiple parents. I'm not sure how someone ends up in this situation, but maybe it is common?</p> <p>Is this true? Would this cause merge conflicts more often in every-day development?</p> </blockquote> <p>No, it's not true—at least as claimed...
<blockquote> <p>1) Mercurial cannot merge or has issues merging with multiple parents. I'm not sure how someone ends up in this situation, but maybe it is common?</p> <p>Is this true? Would this cause merge conflicts more often in every-day development?</p> </blockquote> <p>No, it's not true—at least as claimed...
119, 717, 802
git, mercurial, merge
<h1>Mercurial merge strategy vs Git merge strategy</h1> <p>I've used git for years, and recently switched to mercurial for a project. I've learned how to use Mercurial quite well via the command line over the past 6 months. </p> <p>This could be my imagination, but it seems to me that mercurial is much worse at mergin...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,202
git
# Mercurial merge strategy vs Git merge strategy I've used git for years, and recently switched to mercurial for a project. I've learned how to use Mercurial quite well via the command line over the past 6 months. This could be my imagination, but it seems to me that mercurial is much worse at merging, and results in...
> 1) Mercurial cannot merge or has issues merging with multiple parents. I'm not sure how someone ends up in this situation, but maybe it is common? > > Is this true? Would this cause merge conflicts more often in every-day development? No, it's not true—at least as claimed, which seems to be a bit meaningless. The u...
48157605
Using gcloud's credential helper to access Google Source Repositories prevents osxkeychain from working
7
2018-01-08 20:29:11
<p>In the <a href="https://cloud.google.com/source-repositories/docs/adding-repositories-as-remotes" rel="noreferrer">Google Source Repositories docs</a>, it asks you to use <code>git config credential.helper gcloud.sh</code> to allow Git to authenticate</p> <p>Recently, that's prevented me from using osxkeychain auth...
9,277
3,064,736
2018-02-16 22:53:10
48,835,676
12
2018-02-16 22:21:37
5,212,907
2018-02-16 22:53:10
https://stackoverflow.com/q/48157605
https://stackoverflow.com/a/48835676
<p>The problem here is that the instructions overwrite a possible existing credential helper. To restrict the credential helper to only apply to Google Source Repositories run: </p> <pre><code>git config credential.'https://source.developers.google.com'.helper gcloud.sh </code></pre> <p>or change in your .git/config<...
<p>The problem here is that the instructions overwrite a possible existing credential helper. To restrict the credential helper to only apply to Google Source Repositories run: </p> <pre><code>git config credential.'https://source.developers.google.com'.helper gcloud.sh </code></pre> <p>or change in your .git/config<...
119, 102131, 113755
gcloud, git, google-cloud-source-repos
<h1>Using gcloud's credential helper to access Google Source Repositories prevents osxkeychain from working</h1> <p>In the <a href="https://cloud.google.com/source-repositories/docs/adding-repositories-as-remotes" rel="noreferrer">Google Source Repositories docs</a>, it asks you to use <code>git config credential.helpe...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,203
git
# Using gcloud's credential helper to access Google Source Repositories prevents osxkeychain from working In the [Google Source Repositories docs](https://cloud.google.com/source-repositories/docs/adding-repositories-as-remotes), it asks you to use `git config credential.helper gcloud.sh` to allow Git to authenticate ...
The problem here is that the instructions overwrite a possible existing credential helper. To restrict the credential helper to only apply to Google Source Repositories run: ``` git config credential.'https://source.developers.google.com'.helper gcloud.sh ``` or change in your .git/config ``` [credential] he...
45426704
How to make 'git pull' take a message?
7
2017-07-31 23:21:11
<p>Well, here we go again with more Git goodness. It has found other ways to make simple tasks difficult to impossible...</p> <pre><code>git pull -X theirs https://github.com/weidai11/cryptopp.git master From https://github.com/weidai11/cryptopp * branch master -&gt; FETCH_HEAD Auto-merging GNUmakefile...
10,874
608,639
2023-04-04 07:32:00
45,426,758
12
2017-07-31 23:28:46
571,030
2017-07-31 23:28:46
https://stackoverflow.com/q/45426704
https://stackoverflow.com/a/45426758
<p>You can't provide your own message, but the <code>--no-edit</code> option passed to <code>git pull</code> will auto-generate merge messages.</p> <p><code>git pull --no-edit</code></p>
<p>You can't provide your own message, but the <code>--no-edit</code> option passed to <code>git pull</code> will auto-generate merge messages.</p> <p><code>git pull --no-edit</code></p>
119, 28896
git, git-pull
<h1>How to make 'git pull' take a message?</h1> <p>Well, here we go again with more Git goodness. It has found other ways to make simple tasks difficult to impossible...</p> <pre><code>git pull -X theirs https://github.com/weidai11/cryptopp.git master From https://github.com/weidai11/cryptopp * branch mast...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,204
git
# How to make 'git pull' take a message? Well, here we go again with more Git goodness. It has found other ways to make simple tasks difficult to impossible... ``` git pull -X theirs https://github.com/weidai11/cryptopp.git master From https://github.com/weidai11/cryptopp * branch master -> FETCH_HEAD...
You can't provide your own message, but the `--no-edit` option passed to `git pull` will auto-generate merge messages. `git pull --no-edit`
42008055
How can you determine the location of the git-core folder dynamically?
7
2017-02-02 17:00:29
<p>A quick google says that the folder should be located at <code>/usr/share/git-core</code> but I think this differs depending on the way it was installed since mine is located at <code>/usr/local/share/git-core</code> and my colleague's is somewhere else. </p> <p>Is there a command or variable available to output th...
3,479
582,791
2017-02-03 14:51:16
42,008,526
12
2017-02-02 17:23:39
19,750
2017-02-03 14:51:16
https://stackoverflow.com/q/42008055
https://stackoverflow.com/a/42008526
<pre><code>$ git --exec-path /usr/lib/git-core </code></pre> <p>Overridable via an argument to that flag or with GIT_EXEC_PATH environment variable.</p> <p>If you have multiple copies of git, then try <code>~/homebrew/bin/git</code> or <code>/usr/bin/git</code> or whatever the path to Xcode's copy is.</p> <p>The ful...
<pre><code>$ git --exec-path /usr/lib/git-core </code></pre> <p>Overridable via an argument to that flag or with GIT_EXEC_PATH environment variable.</p> <p>If you have multiple copies of git, then try <code>~/homebrew/bin/git</code> or <code>/usr/bin/git</code> or whatever the path to Xcode's copy is.</p> <p>The ful...
119
git
<h1>How can you determine the location of the git-core folder dynamically?</h1> <p>A quick google says that the folder should be located at <code>/usr/share/git-core</code> but I think this differs depending on the way it was installed since mine is located at <code>/usr/local/share/git-core</code> and my colleague's i...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,207
git
# How can you determine the location of the git-core folder dynamically? A quick google says that the folder should be located at `/usr/share/git-core` but I think this differs depending on the way it was installed since mine is located at `/usr/local/share/git-core` and my colleague's is somewhere else. Is there a c...
``` $ git --exec-path /usr/lib/git-core ``` Overridable via an argument to that flag or with GIT_EXEC_PATH environment variable. If you have multiple copies of git, then try `~/homebrew/bin/git` or `/usr/bin/git` or whatever the path to Xcode's copy is. The full story of how git finds subcommands is actually straigh...
40624067
History/blame git submodule
7
2016-11-16 04:24:09
<p>I have a project <code>A</code> that uses project <code>B</code> as a git submodule:</p> <pre><code>A └── B </code></pre> <p>I want to find which commit in <code>A</code> updated the current ref for <code>B</code>. The <code>A/.gitmodules</code> file only contains the remote, not the ref. And running this does not...
5,200
320,036
2016-11-16 04:24:09
40,624,068
12
2016-11-16 04:24:09
320,036
2016-11-16 04:24:09
https://stackoverflow.com/q/40624067
https://stackoverflow.com/a/40624068
<p>You can see the history using <code>git log</code>:</p> <pre><code>git log -- B </code></pre> <blockquote> <pre><code>commit 469e844f71d60f862e14e64302dbc849cbc7ba51 </code></pre> </blockquote> <p>Or to see a summary of all the changed commits:</p> <pre><code>git log --patch-with-stat -- B | grep commit </code><...
<p>You can see the history using <code>git log</code>:</p> <pre><code>git log -- B </code></pre> <blockquote> <pre><code>commit 469e844f71d60f862e14e64302dbc849cbc7ba51 </code></pre> </blockquote> <p>Or to see a summary of all the changed commits:</p> <pre><code>git log --patch-with-stat -- B | grep commit </code><...
119
git
<h1>History/blame git submodule</h1> <p>I have a project <code>A</code> that uses project <code>B</code> as a git submodule:</p> <pre><code>A └── B </code></pre> <p>I want to find which commit in <code>A</code> updated the current ref for <code>B</code>. The <code>A/.gitmodules</code> file only contains the remote, n...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,208
git
# History/blame git submodule I have a project `A` that uses project `B` as a git submodule: ``` A └── B ``` I want to find which commit in `A` updated the current ref for `B`. The `A/.gitmodules` file only contains the remote, not the ref. And running this does not work: ``` git blame -- B ``` > ``` > fatal: no s...
You can see the history using `git log`: ``` git log -- B ``` > ``` > commit 469e844f71d60f862e14e64302dbc849cbc7ba51 > ``` Or to see a summary of all the changed commits: ``` git log --patch-with-stat -- B | grep commit ``` > ``` > commit 469e844f71d60f862e14e64302dbc849cbc7ba51 > -Subproject commit a677c5ccb0107...
38556622
Create a git versioned project with cookiecutter
7
2016-07-24 20:47:30
<p>I have a nested git repository structure, as below:</p> <pre><code>outer_repository/ |-- outer_dummy_file |-- .git `-- inner_repository |-- .git `-- inner_dummy_file </code></pre> <p>Is it possible to make <code>inner_repository/.git</code> versioned with the outer repository?</p> <p><strong><em>Motivati...
3,451
1,214,214
2016-07-24 23:23:53
38,557,845
12
2016-07-24 23:23:53
1,214,214
2016-07-24 23:23:53
https://stackoverflow.com/q/38556622
https://stackoverflow.com/a/38557845
<p>It is possible to achieve this without the need to do the git acrobatics. Cookiecutter provides an option to run <a href="http://cookiecutter.readthedocs.io/en/latest/advanced/hooks.html" rel="noreferrer">post generation hooks</a>. This allows creation of the git repository to happen on project creation.</p> <p>I'v...
<p>It is possible to achieve this without the need to do the git acrobatics. Cookiecutter provides an option to run <a href="http://cookiecutter.readthedocs.io/en/latest/advanced/hooks.html" rel="noreferrer">post generation hooks</a>. This allows creation of the git repository to happen on project creation.</p> <p>I'v...
119, 113036
cookiecutter, git
<h1>Create a git versioned project with cookiecutter</h1> <p>I have a nested git repository structure, as below:</p> <pre><code>outer_repository/ |-- outer_dummy_file |-- .git `-- inner_repository |-- .git `-- inner_dummy_file </code></pre> <p>Is it possible to make <code>inner_repository/.git</code> version...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,210
git
# Create a git versioned project with cookiecutter I have a nested git repository structure, as below: ``` outer_repository/ |-- outer_dummy_file |-- .git `-- inner_repository |-- .git `-- inner_dummy_file ``` Is it possible to make `inner_repository/.git` versioned with the outer repository? ***Motivation...
It is possible to achieve this without the need to do the git acrobatics. Cookiecutter provides an option to run [post generation hooks](http://cookiecutter.readthedocs.io/en/latest/advanced/hooks.html). This allows creation of the git repository to happen on project creation. I've added the following in my cookiecutt...
37036214
Pass parameters to git pre-push hook
7
2016-05-04 19:17:26
<p>I've create a git pre-push hook that builds my .NET solution and runs the unit tests. So executing a <code>git push</code> command now fires off the build/tests prior to pushing code to origin.</p> <p>That all works just fine. However, there are cases when I'd like to bypass this hook. Maybe I know a test is failin...
3,934
506,236
2016-05-04 19:48:11
37,036,687
12
2016-05-04 19:45:27
6,309
2016-05-04 19:48:11
https://stackoverflow.com/q/37036214
https://stackoverflow.com/a/37036687
<p>You should skip it with:</p> <pre><code>git push --no-verify </code></pre> <p>From <a href="https://git-scm.com/docs/git-push" rel="noreferrer"><code>git push</code> man page</a></p> <blockquote> <p>With <code>--no-verify</code>, the hook is bypassed completely.</p> </blockquote> <hr> <p>However, this bypass ...
<p>You should skip it with:</p> <pre><code>git push --no-verify </code></pre> <p>From <a href="https://git-scm.com/docs/git-push" rel="noreferrer"><code>git push</code> man page</a></p> <blockquote> <p>With <code>--no-verify</code>, the hook is bypassed completely.</p> </blockquote> <hr> <p>However, this bypass ...
119, 43087
git, githooks
<h1>Pass parameters to git pre-push hook</h1> <p>I've create a git pre-push hook that builds my .NET solution and runs the unit tests. So executing a <code>git push</code> command now fires off the build/tests prior to pushing code to origin.</p> <p>That all works just fine. However, there are cases when I'd like to b...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,212
git
# Pass parameters to git pre-push hook I've create a git pre-push hook that builds my .NET solution and runs the unit tests. So executing a `git push` command now fires off the build/tests prior to pushing code to origin. That all works just fine. However, there are cases when I'd like to bypass this hook. Maybe I kn...
You should skip it with: ``` git push --no-verify ``` From [`git push` man page](https://git-scm.com/docs/git-push) > With `--no-verify`, the hook is bypassed completely. --- However, this bypass not just the tests but the all hook: build too. You could keep the hook, but add an environment variable that the hook...
34020746
npm WARN package.json Stock@0.0.1 No repository field
7
2015-12-01 12:43:26
<p>I have a project in a personal private git, I downloaded in another computer and when trying to download the packages in <code>packages.json</code> i got this error message:</p> <pre><code>pablo@debian:~/Documents/clients/stock$ npm install npm WARN package.json Stock@0.0.1 No repository field. npm WARN package.jso...
34,239
760,180
2018-09-23 19:10:22
34,020,813
12
2015-12-01 12:46:47
3,408
2017-06-15 10:41:29
https://stackoverflow.com/q/34020746
https://stackoverflow.com/a/34020813
<p>These warnings are just warnings, and don't indicate anything reason that the dependencies would not have downloaded.</p> <p>The package.json file shown is working perfectly for me. To debug your issue, try removing the node_modules folder and running <code>npm install</code> again. Note that if the packages are al...
<p>These warnings are just warnings, and don't indicate anything reason that the dependencies would not have downloaded.</p> <p>The package.json file shown is working perfectly for me. To debug your issue, try removing the node_modules folder and running <code>npm install</code> again. Note that if the packages are al...
119, 46426, 61387
git, node.js, npm
<h1>npm WARN package.json Stock@0.0.1 No repository field</h1> <p>I have a project in a personal private git, I downloaded in another computer and when trying to download the packages in <code>packages.json</code> i got this error message:</p> <pre><code>pablo@debian:~/Documents/clients/stock$ npm install npm WARN pac...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,215
git
# npm WARN package.json Stock@0.0.1 No repository field I have a project in a personal private git, I downloaded in another computer and when trying to download the packages in `packages.json` i got this error message: ``` pablo@debian:~/Documents/clients/stock$ npm install npm WARN package.json Stock@0.0.1 No reposi...
These warnings are just warnings, and don't indicate anything reason that the dependencies would not have downloaded. The package.json file shown is working perfectly for me. To debug your issue, try removing the node_modules folder and running `npm install` again. Note that if the packages are already in the node_mod...
29558484
Git https:// repository not found though it exists
7
2015-04-10 09:56:32
<p>I have a private repo on github. It's location was changed.</p> <p>I tried changing the remote but I wasn't able to push anymore.</p> <pre><code>ls-remote https://github.com/xxxxx/xxxxx.git </code></pre> <p>gave me this</p> <p>remote: Repository not found.<br> fatal: repository '<a href="https://github.com/xxxxx...
13,598
1,783,346
2016-10-26 23:22:06
29,558,952
12
2015-04-10 10:20:06
438,742
2015-04-10 10:20:06
https://stackoverflow.com/q/29558484
https://stackoverflow.com/a/29558952
<p>I think that as it is a private repo, it appears as non-existent for anonymous access. If you use https url, it sends anonymous request, while ssh url uses your ssh credentials and private key to establish connection.</p> <p>Not sure how to make it work properly with github, but try specifying a username in the url...
<p>I think that as it is a private repo, it appears as non-existent for anonymous access. If you use https url, it sends anonymous request, while ssh url uses your ssh credentials and private key to establish connection.</p> <p>Not sure how to make it work properly with github, but try specifying a username in the url...
119, 7330, 101772
git, ls-remote, repository
<h1>Git https:// repository not found though it exists</h1> <p>I have a private repo on github. It's location was changed.</p> <p>I tried changing the remote but I wasn't able to push anymore.</p> <pre><code>ls-remote https://github.com/xxxxx/xxxxx.git </code></pre> <p>gave me this</p> <p>remote: Repository not fou...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,217
git
# Git https:// repository not found though it exists I have a private repo on github. It's location was changed. I tried changing the remote but I wasn't able to push anymore. ``` ls-remote https://github.com/xxxxx/xxxxx.git ``` gave me this remote: Repository not found. fatal: repository '<https://github.com/xx...
I think that as it is a private repo, it appears as non-existent for anonymous access. If you use https url, it sends anonymous request, while ssh url uses your ssh credentials and private key to establish connection. Not sure how to make it work properly with github, but try specifying a username in the url such as `...
27081228
Auto resolve conflicts in smartgit while rebasing
7
2014-11-22 18:58:27
<p>There is this nice feature in smartgit that sets the conflicted file as the rebase target, which is by invoking the command '<strong>Set to rebase target ("theirs")</strong>' on the file.</p> <p>However, I want this to be done <strong>automatically</strong> on every conflicted file during rebasing. There are just s...
8,425
1,248,073
2014-11-22 19:07:37
27,081,329
12
2014-11-22 19:07:37
296,452
2014-11-22 19:07:37
https://stackoverflow.com/q/27081228
https://stackoverflow.com/a/27081329
<p>If smartgit is as smart as git then just go a head with</p> <pre><code>git rebase -s recursive -X theirs </code></pre>
<p>If smartgit is as smart as git then just go a head with</p> <pre><code>git rebase -s recursive -X theirs </code></pre>
119, 3146, 8974, 65939
conflict, git, rebase, smartgit
<h1>Auto resolve conflicts in smartgit while rebasing</h1> <p>There is this nice feature in smartgit that sets the conflicted file as the rebase target, which is by invoking the command '<strong>Set to rebase target ("theirs")</strong>' on the file.</p> <p>However, I want this to be done <strong>automatically</strong>...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,219
git
# Auto resolve conflicts in smartgit while rebasing There is this nice feature in smartgit that sets the conflicted file as the rebase target, which is by invoking the command '**Set to rebase target ("theirs")**' on the file. However, I want this to be done **automatically** on every conflicted file during rebasing....
If smartgit is as smart as git then just go a head with ``` git rebase -s recursive -X theirs ```
26683902
GIT - how to look at older commits without losing changes?
7
2014-10-31 21:49:31
<p>I'm working on a project (master) that has around 100 commits, no branches etc.</p> <p>I want to see how the project looked like at commit 1, and then at 10, 20, 30.</p> <p>How can I look at the early commits without losing any data? </p> <p>I want to return to where I am now after I see it from previous commits....
14,311
683,068
2014-11-01 11:30:16
26,683,953
12
2014-10-31 21:53:31
631,619
2014-11-01 11:30:16
https://stackoverflow.com/q/26683902
https://stackoverflow.com/a/26683953
<p>For just looking (to 'see' as you ask) do </p> <pre><code>git checkout [the name of the sha] </code></pre> <p>You get the sha from doing</p> <pre><code>git log </code></pre> <p>Here you see me checking out the initial commit of a repository with hundreds of commits:</p> <pre><code>$ git checkout 772df05 # Enou...
<p>For just looking (to 'see' as you ask) do </p> <pre><code>git checkout [the name of the sha] </code></pre> <p>You get the sha from doing</p> <pre><code>git log </code></pre> <p>Here you see me checking out the initial commit of a repository with hundreds of commits:</p> <pre><code>$ git checkout 772df05 # Enou...
119, 12309
git, revert
<h1>GIT - how to look at older commits without losing changes?</h1> <p>I'm working on a project (master) that has around 100 commits, no branches etc.</p> <p>I want to see how the project looked like at commit 1, and then at 10, 20, 30.</p> <p>How can I look at the early commits without losing any data? </p> <p>I wa...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,220
git
# GIT - how to look at older commits without losing changes? I'm working on a project (master) that has around 100 commits, no branches etc. I want to see how the project looked like at commit 1, and then at 10, 20, 30. How can I look at the early commits without losing any data? I want to return to where I am now ...
For just looking (to 'see' as you ask) do ``` git checkout [the name of the sha] ``` You get the sha from doing ``` git log ``` Here you see me checking out the initial commit of a repository with hundreds of commits: ``` $ git checkout 772df05 # Enough of the sha to be unique, often 6-8 chrs. Note: checking out ...
22629396
Can't get Git to correctly handle CRLF problems with Eclipse launch configs (XML files)
7
2014-03-25 08:49:24
<p>We have a mixed team with some people using Windows and others using Linux. We have configured the IDE (Eclipse) to use LF as line ending for source files which works well.</p> <p>But we also share launch configs. These are XML files and Eclipse ignores the project settings for them. Instead, it always uses the pla...
3,398
34,088
2014-04-09 18:18:47
22,967,041
12
2014-04-09 15:20:52
649,852
2014-04-09 18:18:47
https://stackoverflow.com/q/22629396
https://stackoverflow.com/a/22967041
<p>The root cause of your problem is Eclipse. Eclipse uses the <a href="http://eclipse.org/jgit/">JGit</a> Java library to interface with Git repositories. Unfortunately, there is an open bug (<a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=342372">#342372</a>) to add <code>.gitattributes</code> file support to...
<p>The root cause of your problem is Eclipse. Eclipse uses the <a href="http://eclipse.org/jgit/">JGit</a> Java library to interface with Git repositories. Unfortunately, there is an open bug (<a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=342372">#342372</a>) to add <code>.gitattributes</code> file support to...
119, 8329
git, line-endings
<h1>Can't get Git to correctly handle CRLF problems with Eclipse launch configs (XML files)</h1> <p>We have a mixed team with some people using Windows and others using Linux. We have configured the IDE (Eclipse) to use LF as line ending for source files which works well.</p> <p>But we also share launch configs. These...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,222
git
# Can't get Git to correctly handle CRLF problems with Eclipse launch configs (XML files) We have a mixed team with some people using Windows and others using Linux. We have configured the IDE (Eclipse) to use LF as line ending for source files which works well. But we also share launch configs. These are XML files a...
The root cause of your problem is Eclipse. Eclipse uses the [JGit](http://eclipse.org/jgit/) Java library to interface with Git repositories. Unfortunately, there is an open bug ([#342372](https://bugs.eclipse.org/bugs/show_bug.cgi?id=342372)) to add `.gitattributes` file support to the JGit library. So, though your `....
21443740
Neat way to find the number of significant digits in a BigDecimal?
7
2014-01-29 22:09:43
<p>I do not want to limit the number of significant digits in a BigDecimal. I only want to find the number of significant digits that number has.</p> <p>Is there a way to do this without converting the number to string and count the number characters?</p>
7,223
1,031,797
2018-11-23 08:22:43
21,443,880
12
2014-01-29 22:19:41
22,656
2014-01-29 23:12:08
https://stackoverflow.com/q/21443740
https://stackoverflow.com/a/21443880
<p>I believe you want a combination of <a href="http://docs.oracle.com/javase/7/docs/api/java/math/BigDecimal.html#stripTrailingZeros%28%29" rel="noreferrer"><code>stripTrailingZeros</code></a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/math/BigDecimal.html#precision%28%29" rel="noreferrer"><code>precision...
<p>I believe you want a combination of <a href="http://docs.oracle.com/javase/7/docs/api/java/math/BigDecimal.html#stripTrailingZeros%28%29" rel="noreferrer"><code>stripTrailingZeros</code></a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/math/BigDecimal.html#precision%28%29" rel="noreferrer"><code>precision...
17, 12414, 15516
bigdecimal, java, significant-digits
<h1>Neat way to find the number of significant digits in a BigDecimal?</h1> <p>I do not want to limit the number of significant digits in a BigDecimal. I only want to find the number of significant digits that number has.</p> <p>Is there a way to do this without converting the number to string and count the number cha...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,223
git
# Neat way to find the number of significant digits in a BigDecimal? I do not want to limit the number of significant digits in a BigDecimal. I only want to find the number of significant digits that number has. Is there a way to do this without converting the number to string and count the number characters?
I believe you want a combination of [`stripTrailingZeros`](http://docs.oracle.com/javase/7/docs/api/java/math/BigDecimal.html#stripTrailingZeros%28%29), [`precision`](http://docs.oracle.com/javase/7/docs/api/java/math/BigDecimal.html#precision%28%29) and [`scale`](http://docs.oracle.com/javase/7/docs/api/java/math/BigD...
18470613
Git SSH public key denied
7
2013-08-27 16:11:10
<p>I'm using Bitbucket, and I've setup SSH on Git <a href="https://confluence.atlassian.com/pages/viewpage.action?pageId=270827678" rel="nofollow noreferrer">as instructed for Linux in Atlassian's documentation</a> (Ubuntu 13.04)</p> <p>When I try to clone any project from my Bitbucket account though, I get a public ke...
11,409
621,494
2023-11-20 17:34:27
18,470,910
12
2013-08-27 16:27:29
1,870,481
2013-08-27 16:33:59
https://stackoverflow.com/q/18470613
https://stackoverflow.com/a/18470910
<p>Use <code>ssh-add $keyfile</code> to add your private key to the agent.</p> <p>Then use <code>ssh-add -L</code> to display the public key for that key. - Verify it matches the one added to your bitbucket account.</p> <p>Now trying to ssh to bitbucket should result login via key, i.e. <em>no</em> password is needed...
<p>Use <code>ssh-add $keyfile</code> to add your private key to the agent.</p> <p>Then use <code>ssh-add -L</code> to display the public key for that key. - Verify it matches the one added to your bitbucket account.</p> <p>Now trying to ssh to bitbucket should result login via key, i.e. <em>no</em> password is needed...
119, 386, 8337
bitbucket, git, ssh
<h1>Git SSH public key denied</h1> <p>I'm using Bitbucket, and I've setup SSH on Git <a href="https://confluence.atlassian.com/pages/viewpage.action?pageId=270827678" rel="nofollow noreferrer">as instructed for Linux in Atlassian's documentation</a> (Ubuntu 13.04)</p> <p>When I try to clone any project from my Bitbucke...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,224
git
# Git SSH public key denied I'm using Bitbucket, and I've setup SSH on Git [as instructed for Linux in Atlassian's documentation](https://confluence.atlassian.com/pages/viewpage.action?pageId=270827678) (Ubuntu 13.04) When I try to clone any project from my Bitbucket account though, I get a public key denied error. ...
Use `ssh-add $keyfile` to add your private key to the agent. Then use `ssh-add -L` to display the public key for that key. - Verify it matches the one added to your bitbucket account. Now trying to ssh to bitbucket should result login via key, i.e. *no* password is needed. Also `git clone` over ssh should work now. ...
17110935
Git rewind master branch to specific commit in master's history
7
2013-06-14 14:34:15
<p>I have the following recent history in my git repo.</p> <pre><code>* 7661a06 (HEAD, origin/devConsolidate, devConsolidate) Fix seg fault; OCBA intermediary compares by value() now also | * 0bbe038 (origin/master, master) Flawed work no seedShift |/ * 62fe9db Turn on OCBA_DEBUG; nan/inf values in OCBA prior to cra...
7,268
1,325,279
2013-06-14 15:53:32
17,112,544
12
2013-06-14 15:53:32
1,253,222
2013-06-14 15:53:32
https://stackoverflow.com/q/17110935
https://stackoverflow.com/a/17112544
<p>Since you have already pushed <code>master</code> to <code>origin</code> (<code>origin/master</code> is at <code>0bbe038</code>), this will cause problems for anyone who has already fetched or pulled from <code>origin</code> since your push. So, you may need to communicate and coordinate with others what is going on...
<p>Since you have already pushed <code>master</code> to <code>origin</code> (<code>origin/master</code> is at <code>0bbe038</code>), this will cause problems for anyone who has already fetched or pulled from <code>origin</code> since your push. So, you may need to communicate and coordinate with others what is going on...
119
git
<h1>Git rewind master branch to specific commit in master's history</h1> <p>I have the following recent history in my git repo.</p> <pre><code>* 7661a06 (HEAD, origin/devConsolidate, devConsolidate) Fix seg fault; OCBA intermediary compares by value() now also | * 0bbe038 (origin/master, master) Flawed work no seedShi...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,225
git
# Git rewind master branch to specific commit in master's history I have the following recent history in my git repo. ``` * 7661a06 (HEAD, origin/devConsolidate, devConsolidate) Fix seg fault; OCBA intermediary compares by value() now also | * 0bbe038 (origin/master, master) Flawed work no seedShift |/ * 62fe9db Tu...
Since you have already pushed `master` to `origin` (`origin/master` is at `0bbe038`), this will cause problems for anyone who has already fetched or pulled from `origin` since your push. So, you may need to communicate and coordinate with others what is going on so they can adjust as necessary. With that in mind, thou...
16990390
Git branches on a solo project
7
2013-06-07 18:10:27
<p>Is there any reason to create branches for features in a solo git repo? When I merge them back into master, they fast-forward and there is no real evidence that I even branched in the first place. Should I even bother?</p>
938
1,585,006
2013-06-07 18:14:37
16,990,414
12
2013-06-07 18:12:21
28,804
2013-06-07 18:12:21
https://stackoverflow.com/q/16990390
https://stackoverflow.com/a/16990414
<p>Branches can be really useful, even on a solo project. They allow you to develop new features in isolation (if need be) while easily allowing you to throw out work, and/or keep it separated from mainline development (so you can start new features from a clean, stable portion of your codebase).</p> <p>(You can also ...
<p>Branches can be really useful, even on a solo project. They allow you to develop new features in isolation (if need be) while easily allowing you to throw out work, and/or keep it separated from mainline development (so you can start new features from a clean, stable portion of your codebase).</p> <p>(You can also ...
119
git
<h1>Git branches on a solo project</h1> <p>Is there any reason to create branches for features in a solo git repo? When I merge them back into master, they fast-forward and there is no real evidence that I even branched in the first place. Should I even bother?</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,226
git
# Git branches on a solo project Is there any reason to create branches for features in a solo git repo? When I merge them back into master, they fast-forward and there is no real evidence that I even branched in the first place. Should I even bother?
Branches can be really useful, even on a solo project. They allow you to develop new features in isolation (if need be) while easily allowing you to throw out work, and/or keep it separated from mainline development (so you can start new features from a clean, stable portion of your codebase). (You can also prevent fa...
14704261
Revising git repo history to become linear
7
2013-02-05 09:38:45
<p>We need to generate a TFS repository from a Git source code base, we would like to preserve the original commit history, so I tried to use Tf-Git "git tf checkin --deep" command that is supposed to create a TFS changeset for each Git commit.</p> <p>Unfortunately this step fails because a lot of commits in the Git r...
5,076
223,675
2013-02-05 10:18:40
14,704,434
12
2013-02-05 09:47:41
572,644
2013-02-05 10:18:40
https://stackoverflow.com/q/14704261
https://stackoverflow.com/a/14704434
<p>A rebase should actually solve this for you.</p> <pre><code>git rebase -i &lt;hash of commit before first branch has been created&gt; </code></pre> <p>In the window that pops up when you execute that command, don't change anything. Simply save and close.</p> <p>An illustration:</p> <pre><code>A &lt;- B &lt;- E &...
<p>A rebase should actually solve this for you.</p> <pre><code>git rebase -i &lt;hash of commit before first branch has been created&gt; </code></pre> <p>In the window that pops up when you execute that command, don't change anything. Simply save and close.</p> <p>An illustration:</p> <pre><code>A &lt;- B &lt;- E &...
119, 733, 83188
git, git-tf, tfs
<h1>Revising git repo history to become linear</h1> <p>We need to generate a TFS repository from a Git source code base, we would like to preserve the original commit history, so I tried to use Tf-Git "git tf checkin --deep" command that is supposed to create a TFS changeset for each Git commit.</p> <p>Unfortunately t...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,227
git
# Revising git repo history to become linear We need to generate a TFS repository from a Git source code base, we would like to preserve the original commit history, so I tried to use Tf-Git "git tf checkin --deep" command that is supposed to create a TFS changeset for each Git commit. Unfortunately this step fails b...
A rebase should actually solve this for you. ``` git rebase -i <hash of commit before first branch has been created> ``` In the window that pops up when you execute that command, don't change anything. Simply save and close. An illustration: ``` A <- B <- E <-----F <- G master ^ ^ \ ...
12075809
Git submodules workflow issues
7
2012-08-22 14:50:30
<p>We are having a lot of problems recently with our Git repositories. We are users of git submodules for a total of 4 shared repositories between our applications.</p> <p>For example, repository 'website' has a total of 3 submodules.</p> <pre><code>[submodule "vendor/api"] path = vendor/api url = git@your.co...
2,075
1,021,924
2012-08-22 15:54:49
12,076,734
12
2012-08-22 15:41:24
877,115
2012-08-22 15:54:49
https://stackoverflow.com/q/12075809
https://stackoverflow.com/a/12076734
<p>Take a look at the <a href="http://git-scm.com/book/en/Git-Tools-Submodules" rel="nofollow noreferrer">git-scm documention</a> and pass it around to your team. The phenomenon you're seeing is exactly described in the <a href="http://git-scm.com/book/en/Git-Tools-Submodules#Cloning-a-Project-with-Submodules" rel="nof...
<p>Take a look at the <a href="http://git-scm.com/book/en/Git-Tools-Submodules" rel="nofollow noreferrer">git-scm documention</a> and pass it around to your team. The phenomenon you're seeing is exactly described in the <a href="http://git-scm.com/book/en/Git-Tools-Submodules#Cloning-a-Project-with-Submodules" rel="nof...
119, 41612
git, git-submodules
<h1>Git submodules workflow issues</h1> <p>We are having a lot of problems recently with our Git repositories. We are users of git submodules for a total of 4 shared repositories between our applications.</p> <p>For example, repository 'website' has a total of 3 submodules.</p> <pre><code>[submodule "vendor/api"] ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,229
git
# Git submodules workflow issues We are having a lot of problems recently with our Git repositories. We are users of git submodules for a total of 4 shared repositories between our applications. For example, repository 'website' has a total of 3 submodules. ``` [submodule "vendor/api"] path = vendor/api url ...
Take a look at the [git-scm documention](http://git-scm.com/book/en/Git-Tools-Submodules) and pass it around to your team. The phenomenon you're seeing is exactly described in the ["Cloning a Project with Submodules"](http://git-scm.com/book/en/Git-Tools-Submodules#Cloning-a-Project-with-Submodules) section. First, th...
11141142
Creating central repository in Git from existing local repository (in Windows)
7
2012-06-21 15:08:01
<p>I've looked around StackOverflow and other places (including Git documentation) and just cannot get this to work. Here's what i've done:</p> <p>To setup central repository (on //SomeUNC);</p> <pre><code>git init --bare Central.git </code></pre> <p>This creates a //SomeUNC/Central.git folder.</p> <p>Now, in loca...
3,655
342,360
2012-06-21 15:24:02
11,141,457
12
2012-06-21 15:24:02
265,575
2012-06-21 15:24:02
https://stackoverflow.com/q/11141142
https://stackoverflow.com/a/11141457
<p>It sounds like your paths aren't valid. Delete the bare repository and try this from your local repository working folder:</p> <pre><code>git init --bare //UNC/Path/to/Central.git git remote add Central //UNC/Path/to/Central.git git push --all Central </code></pre>
<p>It sounds like your paths aren't valid. Delete the bare repository and try this from your local repository working folder:</p> <pre><code>git init --bare //UNC/Path/to/Central.git git remote add Central //UNC/Path/to/Central.git git push --all Central </code></pre>
119, 7330
git, repository
<h1>Creating central repository in Git from existing local repository (in Windows)</h1> <p>I've looked around StackOverflow and other places (including Git documentation) and just cannot get this to work. Here's what i've done:</p> <p>To setup central repository (on //SomeUNC);</p> <pre><code>git init --bare Central...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,230
git
# Creating central repository in Git from existing local repository (in Windows) I've looked around StackOverflow and other places (including Git documentation) and just cannot get this to work. Here's what i've done: To setup central repository (on //SomeUNC); ``` git init --bare Central.git ``` This creates a //S...
It sounds like your paths aren't valid. Delete the bare repository and try this from your local repository working folder: ``` git init --bare //UNC/Path/to/Central.git git remote add Central //UNC/Path/to/Central.git git push --all Central ```
10220140
git rm -r --cached not removing submodule folder and contents
7
2012-04-19 00:45:19
<p>Solution: remove <code>--cached</code> from <code>git rm -r --cached submodule/name</code>. <a href="https://github.com/byrongibson/scripts/blob/master/git-rm-submodule.sh" rel="nofollow noreferrer">Scripted</a> for reference.</p> <hr> <p>I'm trying to remove a git submodule based on <a href="https://stackoverfl...
17,745
284,981
2013-04-23 06:09:29
10,467,622
12
2012-05-06 02:25:36
1,084,945
2012-05-06 02:25:36
https://stackoverflow.com/q/10220140
https://stackoverflow.com/a/10467622
<p>What you're seeing is correct; <code>git rm --cached -r</code> does <em>not</em>, in fact, remove the files from the <code>working tree</code>, only from the <code>index</code>. If you want <code>git</code> to remove the files from both the <code>index</code> <em>and</em> the <code>working tree</code>, you shouldn't...
<p>What you're seeing is correct; <code>git rm --cached -r</code> does <em>not</em>, in fact, remove the files from the <code>working tree</code>, only from the <code>index</code>. If you want <code>git</code> to remove the files from both the <code>index</code> <em>and</em> the <code>working tree</code>, you shouldn't...
119, 41612
git, git-submodules
<h1>git rm -r --cached not removing submodule folder and contents</h1> <p>Solution: remove <code>--cached</code> from <code>git rm -r --cached submodule/name</code>. <a href="https://github.com/byrongibson/scripts/blob/master/git-rm-submodule.sh" rel="nofollow noreferrer">Scripted</a> for reference.</p> <hr> <p>I'm...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,231
git
# git rm -r --cached not removing submodule folder and contents Solution: remove `--cached` from `git rm -r --cached submodule/name`. [Scripted](https://github.com/byrongibson/scripts/blob/master/git-rm-submodule.sh) for reference. --- I'm trying to remove a git submodule based on [this SO answer](https://stackoverf...
What you're seeing is correct; `git rm --cached -r` does *not*, in fact, remove the files from the `working tree`, only from the `index`. If you want `git` to remove the files from both the `index` *and* the `working tree`, you shouldn't use `--cached`. See the [`git-rm` man page](http://linux.die.net/man/1/git-rm) for...
9826592
Git merge single file without rebasing
7
2012-03-22 16:34:06
<p>I have three branches (let's call them master, testing, and feature). All three are shared, so I cannot rebase any of them without causing problems for others. Currently, all three branches have diverged (none is a fast-forward), so eventually some merging will need to done, since rebasing is not an option.</p> <p>...
4,545
391,126
2012-03-22 17:15:30
9,827,094
12
2012-03-22 17:09:22
1,180,471
2012-03-22 17:15:30
https://stackoverflow.com/q/9826592
https://stackoverflow.com/a/9827094
<p>You can just do a</p> <p><code>git checkout branch_name &lt;path(s)&gt;</code></p> <p>This can load a specific file but you can also use wildcards and directories</p> <p>Note that:</p> <ul> <li>Paths are relative</li> <li>The path makes that git does not switch branches, so you can just commit after gettihg the ...
<p>You can just do a</p> <p><code>git checkout branch_name &lt;path(s)&gt;</code></p> <p>This can load a specific file but you can also use wildcards and directories</p> <p>Note that:</p> <ul> <li>Paths are relative</li> <li>The path makes that git does not switch branches, so you can just commit after gettihg the ...
119, 717, 28897, 29934
git, git-merge, git-rebase, merge
<h1>Git merge single file without rebasing</h1> <p>I have three branches (let's call them master, testing, and feature). All three are shared, so I cannot rebase any of them without causing problems for others. Currently, all three branches have diverged (none is a fast-forward), so eventually some merging will need to...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,232
git
# Git merge single file without rebasing I have three branches (let's call them master, testing, and feature). All three are shared, so I cannot rebase any of them without causing problems for others. Currently, all three branches have diverged (none is a fast-forward), so eventually some merging will need to done, si...
You can just do a `git checkout branch_name <path(s)>` This can load a specific file but you can also use wildcards and directories Note that: - Paths are relative - The path makes that git does not switch branches, so you can just commit after gettihg the file
9004575
How to get the git SHA1 value in the Implementation-Version field in the manifest for a Maven project?
7
2012-01-25 14:45:19
<p>We use git and maven and logback.</p> <p>This mean that the stack traces in the log show the Implementation-Version of the jar containing each line in the stack trace (see <a href="http://logback.qos.ch/reasonsToSwitch.html#packagingData" rel="nofollow">http://logback.qos.ch/reasonsToSwitch.html#packagingData</a> f...
3,916
53,897
2013-05-14 06:28:37
9,008,332
12
2012-01-25 18:42:57
611,182
2012-01-25 19:22:55
https://stackoverflow.com/q/9004575
https://stackoverflow.com/a/9008332
<p>Check that the <code>&lt;Implementation-Version&gt;</code> is inside a <code>&lt;manifestEntries&gt;</code> element, and not a <code>&lt;manifest&gt;</code> element.</p> <p>Example:</p> <pre><code> &lt;build&gt; &lt;plugins&gt; &lt;plugin&gt; &lt;groupId&gt;com.github.koraktor&lt;/groupId&gt; ...
<p>Check that the <code>&lt;Implementation-Version&gt;</code> is inside a <code>&lt;manifestEntries&gt;</code> element, and not a <code>&lt;manifest&gt;</code> element.</p> <p>Example:</p> <pre><code> &lt;build&gt; &lt;plugins&gt; &lt;plugin&gt; &lt;groupId&gt;com.github.koraktor&lt;/groupId&gt; ...
17, 119, 11075, 41127, 86882
git, java, logback, mavanagaiata, maven
<h1>How to get the git SHA1 value in the Implementation-Version field in the manifest for a Maven project?</h1> <p>We use git and maven and logback.</p> <p>This mean that the stack traces in the log show the Implementation-Version of the jar containing each line in the stack trace (see <a href="http://logback.qos.ch/r...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,233
git
# How to get the git SHA1 value in the Implementation-Version field in the manifest for a Maven project? We use git and maven and logback. This mean that the stack traces in the log show the Implementation-Version of the jar containing each line in the stack trace (see <http://logback.qos.ch/reasonsToSwitch.html#pack...
Check that the `<Implementation-Version>` is inside a `<manifestEntries>` element, and not a `<manifest>` element. Example: ``` <build> <plugins> <plugin> <groupId>com.github.koraktor</groupId> <artifactId>mavanagaiata</artifactId> <version>0.3.1</version> <executions> ...
7461945
Git: How to see old version of a file (before it was added to the staging area/index)?
7
2011-09-18 14:03:17
<p>Suppose I changed my file <code>foo.txt</code> and run <code>git add foo.txt</code>. Now <code>foo.txt</code> appears in the list of the "changes to be committed". </p> <p>Now I would like to see my <code>foo.txt</code> <em>before</em> these changes. How can I do it with <code>git</code>? </p>
211
650,444
2011-09-18 15:08:14
7,461,964
12
2011-09-18 14:05:41
223,092
2011-09-18 15:08:14
https://stackoverflow.com/q/7461945
https://stackoverflow.com/a/7461964
<p>You can do the following:</p> <pre><code>git show HEAD:foo.txt </code></pre> <p>In general, this syntax is very useful for seeing a file from a particular commit without touching your working tree. For example, if you want to see what <code>README.txt</code> was like in the grand-parent of commit <code>f414f31</c...
<p>You can do the following:</p> <pre><code>git show HEAD:foo.txt </code></pre> <p>In general, this syntax is very useful for seeing a file from a particular commit without touching your working tree. For example, if you want to see what <code>README.txt</code> was like in the grand-parent of commit <code>f414f31</c...
119
git
<h1>Git: How to see old version of a file (before it was added to the staging area/index)?</h1> <p>Suppose I changed my file <code>foo.txt</code> and run <code>git add foo.txt</code>. Now <code>foo.txt</code> appears in the list of the "changes to be committed". </p> <p>Now I would like to see my <code>foo.txt</code> ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,234
git
# Git: How to see old version of a file (before it was added to the staging area/index)? Suppose I changed my file `foo.txt` and run `git add foo.txt`. Now `foo.txt` appears in the list of the "changes to be committed". Now I would like to see my `foo.txt` *before* these changes. How can I do it with `git`?
You can do the following: ``` git show HEAD:foo.txt ``` In general, this syntax is very useful for seeing a file from a particular commit without touching your working tree. For example, if you want to see what `README.txt` was like in the grand-parent of commit `f414f31` you can do: ``` git show f414f31^^:README.tx...
6601592
Counting digits using while loop
7
2011-07-06 19:04:56
<p>I was recently making a program which needed to check the number of digits in a number inputted by the user. As a result I made the following code:</p> <pre><code>int x; cout &lt;&lt; "Enter a number: "; cin &gt;&gt; x; x /= 10; while(x &gt; 0) { count++; x = x/10; } </code></pre> <p>From what I can tell (...
27,570
784,079
2013-10-09 14:01:59
6,601,633
12
2011-07-06 19:08:41
13,422
2011-07-06 19:26:50
https://stackoverflow.com/q/6601592
https://stackoverflow.com/a/6601633
<p>In your particular example you could read the number as a string and count the number of characters.</p> <p>But for the general case, you can do it your way or you can use a base-10 logarithm.</p> <p>Here is the logarithm example:</p> <pre><code>#include &lt;iostream&gt; #include &lt;cmath&gt; using namespace st...
<p>In your particular example you could read the number as a string and count the number of characters.</p> <p>But for the general case, you can do it your way or you can use a base-10 logarithm.</p> <p>Here is the logarithm example:</p> <pre><code>#include &lt;iostream&gt; #include &lt;cmath&gt; using namespace st...
10, 9548, 9914, 17310
c++, counting, digits, while-loop
<h1>Counting digits using while loop</h1> <p>I was recently making a program which needed to check the number of digits in a number inputted by the user. As a result I made the following code:</p> <pre><code>int x; cout &lt;&lt; "Enter a number: "; cin &gt;&gt; x; x /= 10; while(x &gt; 0) { count++; x = x/10; ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,235
git
# Counting digits using while loop I was recently making a program which needed to check the number of digits in a number inputted by the user. As a result I made the following code: ``` int x; cout << "Enter a number: "; cin >> x; x /= 10; while(x > 0) { count++; x = x/10; } ``` From what I can tell (even w...
In your particular example you could read the number as a string and count the number of characters. But for the general case, you can do it your way or you can use a base-10 logarithm. Here is the logarithm example: ``` #include <iostream> #include <cmath> using namespace std; int main() { double n; cout ...
110313
How to make sure my git repo code is safe?
7
2008-09-21 05:25:29
<p>If our organisation were to switch from a central-server VCS like subversion to a distributed VCS like git, how do I make sure that all my code is safe from hardware failure?</p> <p>With a central-server VCS I just need to backup the repository every day. If we were using a DVCS then there'd be loads of code branch...
2,792
6,408
2009-03-30 15:35:06
110,619
12
2008-09-21 09:21:16
19,563
2008-09-21 09:21:16
https://stackoverflow.com/q/110313
https://stackoverflow.com/a/110619
<p>I think that you will find that in practice developers will prefer to use a central repository than pushing and pulling between each other's local repositories. Once you've cloned a central repository, while working on any tracking branches, fetching and pushing are trivial commands. Adding half a dozen remotes to a...
<p>I think that you will find that in practice developers will prefer to use a central repository than pushing and pulling between each other's local repositories. Once you've cloned a central repository, while working on any tracking branches, fetching and pushing are trivial commands. Adding half a dozen remotes to a...
119, 493, 3346
backup, dvcs, git
<h1>How to make sure my git repo code is safe?</h1> <p>If our organisation were to switch from a central-server VCS like subversion to a distributed VCS like git, how do I make sure that all my code is safe from hardware failure?</p> <p>With a central-server VCS I just need to backup the repository every day. If we we...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,237
git
# How to make sure my git repo code is safe? If our organisation were to switch from a central-server VCS like subversion to a distributed VCS like git, how do I make sure that all my code is safe from hardware failure? With a central-server VCS I just need to backup the repository every day. If we were using a DVCS ...
I think that you will find that in practice developers will prefer to use a central repository than pushing and pulling between each other's local repositories. Once you've cloned a central repository, while working on any tracking branches, fetching and pushing are trivial commands. Adding half a dozen remotes to all ...
68978977
Using git rebase interactive to orchestrate series of git cherry-pick?
6
2021-08-30 04:35:13
<p>git cherry-pick allows simple merges to be cherry-picked simply by indicating which of the merge parents should be used as the baseline. For example:</p> <pre><code>git cherry-pick -m 1 1234abcdef </code></pre> <p>I have a bunch of commits that I want to cherry pick, a few of which may be merges, and others will no...
6,331
1,123,685
2021-08-30 19:38:05
68,982,217
12
2021-08-30 10:01:07
1,256,452
2021-08-30 10:10:39
https://stackoverflow.com/q/68978977
https://stackoverflow.com/a/68982217
<p><a href="https://stackoverflow.com/questions/68978977/specify-merge-parent-for-rebase-pick#comment121910218_68978977">mnestorov's comment</a> about using <code>--rebase-merges</code> is relevant here; consider it for the actual problem you're trying to solve (which you haven't really described: I'll note below where...
<p><a href="https://stackoverflow.com/questions/68978977/specify-merge-parent-for-rebase-pick#comment121910218_68978977">mnestorov's comment</a> about using <code>--rebase-merges</code> is relevant here; consider it for the actual problem you're trying to solve (which you haven't really described: I'll note below where...
119, 29934, 78810
git, git-cherry-pick, git-rebase
<h1>Using git rebase interactive to orchestrate series of git cherry-pick?</h1> <p>git cherry-pick allows simple merges to be cherry-picked simply by indicating which of the merge parents should be used as the baseline. For example:</p> <pre><code>git cherry-pick -m 1 1234abcdef </code></pre> <p>I have a bunch of comm...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,242
git
# Using git rebase interactive to orchestrate series of git cherry-pick? git cherry-pick allows simple merges to be cherry-picked simply by indicating which of the merge parents should be used as the baseline. For example: ``` git cherry-pick -m 1 1234abcdef ``` I have a bunch of commits that I want to cherry pick, ...
[mnestorov's comment](https://stackoverflow.com/questions/68978977/specify-merge-parent-for-rebase-pick#comment121910218_68978977) about using `--rebase-merges` is relevant here; consider it for the actual problem you're trying to solve (which you haven't really described: I'll note below where things seem to have gone...
63974493
Why would 'git submodule update' skip a submodule?
6
2020-09-20 00:23:21
<p>I have a git repo with a single submodule <code>sub/x</code>. (This submodule does not contain any submodules of its own.)</p> <p>In the superproject's repo, the output of <code>git status</code> shows the following (unstaged) modification</p> <pre><code>modified: sub/x (new commits) </code></pre> <p>If I now run...
10,253
559,827
2025-12-11 15:31:34
63,974,886
12
2020-09-20 01:55:49
1,256,452
2020-09-20 12:36:50
https://stackoverflow.com/q/63974493
https://stackoverflow.com/a/63974886
<p>(Note: I've only checked a very recent Git version, and the submodule code has been undergoing changes, so this might not be the only case. But it is the only place that message can occur in the latest Git.)</p> <p><strong>Edit 2:</strong> it seems that the case below applies when the superproject's <code>.git/conf...
<p>(Note: I've only checked a very recent Git version, and the submodule code has been undergoing changes, so this might not be the only case. But it is the only place that message can occur in the latest Git.)</p> <p><strong>Edit 2:</strong> it seems that the case below applies when the superproject's <code>.git/conf...
119, 41612
git, git-submodules
<h1>Why would 'git submodule update' skip a submodule?</h1> <p>I have a git repo with a single submodule <code>sub/x</code>. (This submodule does not contain any submodules of its own.)</p> <p>In the superproject's repo, the output of <code>git status</code> shows the following (unstaged) modification</p> <pre><code>m...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,244
git
# Why would 'git submodule update' skip a submodule? I have a git repo with a single submodule `sub/x`. (This submodule does not contain any submodules of its own.) In the superproject's repo, the output of `git status` shows the following (unstaged) modification ``` modified: sub/x (new commits) ``` If I now run...
(Note: I've only checked a very recent Git version, and the submodule code has been undergoing changes, so this might not be the only case. But it is the only place that message can occur in the latest Git.) **Edit 2:** it seems that the case below applies when the superproject's `.git/config` has an explicit `update ...
59887847
Programmatically set git credential cache through command line
6
2020-01-23 22:16:25
<p>I'm using the command <code>git config credential.helper 'cache'</code> so I don't have to input my username and password repeatedly. However, this requires that I set the credentials one time. Is there a way that I can initialize the cache, pipe in the value from an environment variable that will be available at ru...
2,899
4,234,853
2021-04-24 07:45:25
59,890,061
12
2020-01-24 03:32:27
8,705,432
2021-04-24 07:45:25
https://stackoverflow.com/q/59887847
https://stackoverflow.com/a/59890061
<p>It is possible to prime the cache by using <code>git credential approve</code>, as described in the <a href="https://git-scm.com/docs/git-credential" rel="noreferrer"><code>git-credential(1)</code> manual page</a>, but there's an easier way to do what you want.</p> <p>The credential helper that you use can be an arb...
<p>It is possible to prime the cache by using <code>git credential approve</code>, as described in the <a href="https://git-scm.com/docs/git-credential" rel="noreferrer"><code>git-credential(1)</code> manual page</a>, but there's an easier way to do what you want.</p> <p>The credential helper that you use can be an arb...
119
git
<h1>Programmatically set git credential cache through command line</h1> <p>I'm using the command <code>git config credential.helper 'cache'</code> so I don't have to input my username and password repeatedly. However, this requires that I set the credentials one time. Is there a way that I can initialize the cache, pip...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,245
git
# Programmatically set git credential cache through command line I'm using the command `git config credential.helper 'cache'` so I don't have to input my username and password repeatedly. However, this requires that I set the credentials one time. Is there a way that I can initialize the cache, pipe in the value from ...
It is possible to prime the cache by using `git credential approve`, as described in the [`git-credential(1)` manual page](https://git-scm.com/docs/git-credential), but there's an easier way to do what you want. The credential helper that you use can be an arbitrary shell script, which can produce the standard format ...
54352602
Find out staged files in git `pre-commit` hook when using `git commit -a`
6
2019-01-24 17:47:08
<p>I'm using a <code>git</code> <code>pre-commit</code> hook to automatically format all of my staged files. I'm determining the staged files via <code>git diff --name-only --cached</code> and then call a script on those files. This all works well in the standard use case, however it doesn't work when I commit via</p> ...
7,931
635,523
2019-01-24 18:43:02
54,353,354
12
2019-01-24 18:37:28
1,256,452
2019-01-24 18:43:02
https://stackoverflow.com/q/54352602
https://stackoverflow.com/a/54353354
<blockquote> <p>because the files are not yet staged</p> </blockquote> <p>This actually isn't quite true. But it's not quite false either.</p> <p>Here is a (silly, meant for illustration only) pre-commit hook to demonstrate the problem:</p> <pre><code>$ cat .git/hooks/pre-commit #! /bin/sh echo \$GIT_INDEX_FILE =...
<blockquote> <p>because the files are not yet staged</p> </blockquote> <p>This actually isn't quite true. But it's not quite false either.</p> <p>Here is a (silly, meant for illustration only) pre-commit hook to demonstrate the problem:</p> <pre><code>$ cat .git/hooks/pre-commit #! /bin/sh echo \$GIT_INDEX_FILE =...
119, 25281, 43087, 53850
git, git-commit, githooks, pre-commit-hook
<h1>Find out staged files in git `pre-commit` hook when using `git commit -a`</h1> <p>I'm using a <code>git</code> <code>pre-commit</code> hook to automatically format all of my staged files. I'm determining the staged files via <code>git diff --name-only --cached</code> and then call a script on those files. This all ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,248
git
# Find out staged files in git `pre-commit` hook when using `git commit -a` I'm using a `git` `pre-commit` hook to automatically format all of my staged files. I'm determining the staged files via `git diff --name-only --cached` and then call a script on those files. This all works well in the standard use case, howev...
> because the files are not yet staged This actually isn't quite true. But it's not quite false either. Here is a (silly, meant for illustration only) pre-commit hook to demonstrate the problem: ``` $ cat .git/hooks/pre-commit #! /bin/sh echo \$GIT_INDEX_FILE = $GIT_INDEX_FILE git diff-index --cached --name-only HEA...
52569244
Connecting my domain name on digital ocean droplet
6
2018-09-29 14:19:43
<p>I created a small hello world node app, then i hosted the app on digital ocean droplet, after that i can access my application on <a href="http://my_public_ip:3000" rel="noreferrer">http://my_public_ip:3000</a></p> <p>Felt happy 😍</p> <p>Then i bought a domain name called <em>helloworld.tk</em> free domain from f...
14,685
7,862,193
2019-10-31 06:54:03
52,645,745
12
2018-10-04 11:37:51
9,756,653
2018-10-04 11:37:51
https://stackoverflow.com/q/52569244
https://stackoverflow.com/a/52645745
<p>First, remove the forwarding and you need to change the nameservers of the domain in your domain DNS management if your domain is somewhere other than DigitalOcean</p> <p>Add below nameservers:</p> <pre><code>ns1.digitalocean.com ns2.digitalocean.com ns3.digitalocean.com </code></pre> <p>Now check if they are pro...
<p>First, remove the forwarding and you need to change the nameservers of the domain in your domain DNS management if your domain is somewhere other than DigitalOcean</p> <p>Add below nameservers:</p> <pre><code>ns1.digitalocean.com ns2.digitalocean.com ns3.digitalocean.com </code></pre> <p>Now check if they are pro...
3761, 6605, 17426, 46426, 97102
digital-ocean, nameservers, nginx, node.js, reverse-proxy
<h1>Connecting my domain name on digital ocean droplet</h1> <p>I created a small hello world node app, then i hosted the app on digital ocean droplet, after that i can access my application on <a href="http://my_public_ip:3000" rel="noreferrer">http://my_public_ip:3000</a></p> <p>Felt happy 😍</p> <p>Then i bought a ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,250
git
# Connecting my domain name on digital ocean droplet I created a small hello world node app, then i hosted the app on digital ocean droplet, after that i can access my application on <http://my_public_ip:3000> Felt happy 😍 Then i bought a domain name called *helloworld.tk* free domain from freenom.com After that i ...
First, remove the forwarding and you need to change the nameservers of the domain in your domain DNS management if your domain is somewhere other than DigitalOcean Add below nameservers: ``` ns1.digitalocean.com ns2.digitalocean.com ns3.digitalocean.com ``` Now check if they are propagating by using whatsmydns.net (...
51946332
git command to check if a repository has any uncommitted changes
6
2018-08-21 10:09:02
<p>I need to know if there is a git command using which I can check if there are any uncommitted changes present in a branch for a given repository</p>
8,364
3,978,980
2023-07-11 03:56:13
51,946,856
12
2018-08-21 10:40:12
5,883,177
2018-08-21 10:40:12
https://stackoverflow.com/q/51946332
https://stackoverflow.com/a/51946856
<p>If you are only interested in files which are part of the index, the following command shows concise info</p> <pre><code>git status -suno </code></pre>
<p>If you are only interested in files which are part of the index, the following command shows concise info</p> <pre><code>git status -suno </code></pre>
119, 1879
branch, git
<h1>git command to check if a repository has any uncommitted changes</h1> <p>I need to know if there is a git command using which I can check if there are any uncommitted changes present in a branch for a given repository</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,252
git
# git command to check if a repository has any uncommitted changes I need to know if there is a git command using which I can check if there are any uncommitted changes present in a branch for a given repository
If you are only interested in files which are part of the index, the following command shows concise info ``` git status -suno ```
51713049
git: retroactively mark a deleted and new file as moved instead
6
2018-08-06 17:44:50
<p>I've got a few files that I moved from a root folder into a <code>lib/</code> folder. I've also made some significant changes to those files as well.</p> <p>The git history shows the old file as deleted and the new one as added. But even though there are a lot of differences in the files, I still want them to be ...
7,695
702,948
2018-08-06 17:54:52
51,713,177
12
2018-08-06 17:54:52
14,660
2018-08-06 17:54:52
https://stackoverflow.com/q/51713049
https://stackoverflow.com/a/51713177
<p>Git does not track copies and renames. Instead, it looks at the file contents and decides whether it's a rename or a copy.</p> <p>This has advantages and disadvantages, but acknowledges that people working with version control often won't do basic shell commands, like mv or rm or cp, through the version control sys...
<p>Git does not track copies and renames. Instead, it looks at the file contents and decides whether it's a rename or a copy.</p> <p>This has advantages and disadvantages, but acknowledges that people working with version control often won't do basic shell commands, like mv or rm or cp, through the version control sys...
119
git
<h1>git: retroactively mark a deleted and new file as moved instead</h1> <p>I've got a few files that I moved from a root folder into a <code>lib/</code> folder. I've also made some significant changes to those files as well.</p> <p>The git history shows the old file as deleted and the new one as added. But even tho...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,253
git
# git: retroactively mark a deleted and new file as moved instead I've got a few files that I moved from a root folder into a `lib/` folder. I've also made some significant changes to those files as well. The git history shows the old file as deleted and the new one as added. But even though there are a lot of differ...
Git does not track copies and renames. Instead, it looks at the file contents and decides whether it's a rename or a copy. This has advantages and disadvantages, but acknowledges that people working with version control often won't do basic shell commands, like mv or rm or cp, through the version control system. It's ...
50989610
Why does Git’s single-key setting not work?
6
2018-06-22 13:56:47
<p>I’m using Git 2.7.4. I have the following snippet in my <code>~/.config/git/config</code> file:</p> <pre><code>[interactive] singleKey = true </code></pre> <p>However, when I run <code>git add -p</code> I still have to press enter after having made a choice for a hunk. What could be the cause for this?</p>
317
7,129,045
2018-06-22 14:06:16
50,989,760
12
2018-06-22 14:06:16
2,018,369
2018-06-22 14:06:16
https://stackoverflow.com/q/50989610
https://stackoverflow.com/a/50989760
<p>According to <code>git-config</code> <a href="https://git-scm.com/docs/git-config#git-config-interactivesingleKey" rel="noreferrer">documentation</a> <code>interactive.singleKey</code> option requires the Perl module <code>Term::ReadKey</code> installed to work properly. Please check if this module is installed on y...
<p>According to <code>git-config</code> <a href="https://git-scm.com/docs/git-config#git-config-interactivesingleKey" rel="noreferrer">documentation</a> <code>interactive.singleKey</code> option requires the Perl module <code>Term::ReadKey</code> installed to work properly. Please check if this module is installed on y...
119
git
<h1>Why does Git’s single-key setting not work?</h1> <p>I’m using Git 2.7.4. I have the following snippet in my <code>~/.config/git/config</code> file:</p> <pre><code>[interactive] singleKey = true </code></pre> <p>However, when I run <code>git add -p</code> I still have to press enter after having made a choice ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,254
git
# Why does Git’s single-key setting not work? I’m using Git 2.7.4. I have the following snippet in my `~/.config/git/config` file: ``` [interactive] singleKey = true ``` However, when I run `git add -p` I still have to press enter after having made a choice for a hunk. What could be the cause for this?
According to `git-config` [documentation](https://git-scm.com/docs/git-config#git-config-interactivesingleKey) `interactive.singleKey` option requires the Perl module `Term::ReadKey` installed to work properly. Please check if this module is installed on your system and if not, install it using apropriate command. E.g....
49849423
Programmatically fixup last commit into previous
6
2018-04-16 03:56:37
<p>Every time I want to fixup my latest commit into the second latest commit, I do this</p> <pre><code>git rebase HEAD~2 -i &lt;replace pick with fixup on line 2&gt; </code></pre> <p>Is there a way to do this in an automated script, without human interference?</p> <p>I tried this and it doesn't work:</p> <pre><code...
2,425
5,958,455
2025-03-26 21:12:25
49,850,239
12
2018-04-16 05:39:02
6,330,106
2018-04-16 08:34:41
https://stackoverflow.com/q/49849423
https://stackoverflow.com/a/49850239
<pre><code>git reset HEAD~1 --soft git commit --amend --no-edit </code></pre> <p>or</p> <pre><code>git reset HEAD~2 --soft git commit -C ORIG_HEAD^ --reset-author </code></pre> <p>or</p> <pre><code>head=`git log -1 --pretty=%H HEAD~1` git reset HEAD~2 --hard git merge --squash ORIG_HEAD git commit -C $head --reset...
<pre><code>git reset HEAD~1 --soft git commit --amend --no-edit </code></pre> <p>or</p> <pre><code>git reset HEAD~2 --soft git commit -C ORIG_HEAD^ --reset-author </code></pre> <p>or</p> <pre><code>head=`git log -1 --pretty=%H HEAD~1` git reset HEAD~2 --hard git merge --squash ORIG_HEAD git commit -C $head --reset...
119, 8974, 34019
fixup, git, rebase
<h1>Programmatically fixup last commit into previous</h1> <p>Every time I want to fixup my latest commit into the second latest commit, I do this</p> <pre><code>git rebase HEAD~2 -i &lt;replace pick with fixup on line 2&gt; </code></pre> <p>Is there a way to do this in an automated script, without human interference?...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,255
git
# Programmatically fixup last commit into previous Every time I want to fixup my latest commit into the second latest commit, I do this ``` git rebase HEAD~2 -i <replace pick with fixup on line 2> ``` Is there a way to do this in an automated script, without human interference? I tried this and it doesn't work: ``...
``` git reset HEAD~1 --soft git commit --amend --no-edit ``` or ``` git reset HEAD~2 --soft git commit -C ORIG_HEAD^ --reset-author ``` or ``` head=`git log -1 --pretty=%H HEAD~1` git reset HEAD~2 --hard git merge --squash ORIG_HEAD git commit -C $head --reset-author ``` or ``` head=`git log -1 --pretty=%h HEAD~1...
49346260
Copy files without .gitignore?
6
2018-03-18 09:18:28
<p>I had a few Javascript projects and I need to copy or move to another machine. And I would like to ignore files which are already in <code>.gitignore</code>. Now, when I copy the folder I got git ignored folders and files. But, I want to ignore those when I copy (<kbd>Command</kbd> + <kbd>C</kbd>). How can I configu...
3,042
3,736,230
2018-03-19 10:23:45
49,346,308
12
2018-03-18 09:23:11
2,422,776
2018-03-18 09:23:11
https://stackoverflow.com/q/49346260
https://stackoverflow.com/a/49346308
<p>You can use git clone:</p> <pre><code>$ git clone machine1:/path/to/project machine2:/target/path </code></pre>
<p>You can use git clone:</p> <pre><code>$ git clone machine1:/path/to/project machine2:/target/path </code></pre>
119, 369, 25056
git, gitignore, macos
<h1>Copy files without .gitignore?</h1> <p>I had a few Javascript projects and I need to copy or move to another machine. And I would like to ignore files which are already in <code>.gitignore</code>. Now, when I copy the folder I got git ignored folders and files. But, I want to ignore those when I copy (<kbd>Command<...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,256
git
# Copy files without .gitignore? I had a few Javascript projects and I need to copy or move to another machine. And I would like to ignore files which are already in `.gitignore`. Now, when I copy the folder I got git ignored folders and files. But, I want to ignore those when I copy (`Command` + `C`). How can I confi...
You can use git clone: ``` $ git clone machine1:/path/to/project machine2:/target/path ```
48814114
Git history for branch after merge
6
2018-02-15 18:35:30
<p>I am a bit confused on how git stores history after merging.</p> <p>I have merged branch <code>A</code> to branch <code>B</code> successfully. Now, when I go to a file, in branch <code>B</code>, that was part of the merge I see all the history for that file for branch <code>A</code> but I don't see any history for ...
8,984
9,328,545
2020-09-21 23:16:23
48,819,299
12
2018-02-16 02:31:19
1,256,452
2020-09-21 23:16:23
https://stackoverflow.com/q/48814114
https://stackoverflow.com/a/48819299
<h3>TL;DR</h3> <p>The history isn't <em>gone</em>, Git just isn't <em>showing</em> it.</p> <p>In Git, the history <em>is</em> the set of commits. There is no file history!</p> <p>When you run a command like <code>git log dir/sub/file.ext</code>, or for that matter, <code>git log dir/sub</code> or <code>git log .</code...
<h3>TL;DR</h3> <p>The history isn't <em>gone</em>, Git just isn't <em>showing</em> it.</p> <p>In Git, the history <em>is</em> the set of commits. There is no file history!</p> <p>When you run a command like <code>git log dir/sub/file.ext</code>, or for that matter, <code>git log dir/sub</code> or <code>git log .</code...
119, 456
git, version-control
<h1>Git history for branch after merge</h1> <p>I am a bit confused on how git stores history after merging.</p> <p>I have merged branch <code>A</code> to branch <code>B</code> successfully. Now, when I go to a file, in branch <code>B</code>, that was part of the merge I see all the history for that file for branch <co...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,257
git
# Git history for branch after merge I am a bit confused on how git stores history after merging. I have merged branch `A` to branch `B` successfully. Now, when I go to a file, in branch `B`, that was part of the merge I see all the history for that file for branch `A` but I don't see any history for branch `B`. Wher...
### TL;DR The history isn't *gone*, Git just isn't *showing* it. In Git, the history *is* the set of commits. There is no file history! When you run a command like `git log dir/sub/file.ext`, or for that matter, `git log dir/sub` or `git log .` while in `dir/sub`, Git will *synthesize* a (temporary) file history, by...
48267025
How to sync local history after massive git history rewrite?
6
2018-01-15 16:28:31
<p>The question may seem odd, but I have issues syncing git history after rewriting over 100 commits. </p> <p>On the machine I did rewrite from, a simple <code>git fetch</code> synced it all. </p> <p>On another mac machine, <code>git sync</code> did not help, but after a random deleting of local <code>.git/</code> lo...
8,416
437,039
2018-01-15 18:27:08
48,268,766
12
2018-01-15 18:27:08
1,256,452
2018-01-15 18:27:08
https://stackoverflow.com/q/48267025
https://stackoverflow.com/a/48268766
<p>The key (or keys) to understanding the issues here is (are) that, in Git:</p> <ul> <li>Commits <em>are</em> the history.</li> <li>The "true name" of any commit is its hash ID.</li> <li>No commit can <em>ever</em> be changed.</li> <li>Each commit remembers its previous (immediate ancestor, aka <em>parent</em>) commi...
<p>The key (or keys) to understanding the issues here is (are) that, in Git:</p> <ul> <li>Commits <em>are</em> the history.</li> <li>The "true name" of any commit is its hash ID.</li> <li>No commit can <em>ever</em> be changed.</li> <li>Each commit remembers its previous (immediate ancestor, aka <em>parent</em>) commi...
119, 91259
git, git-rewrite-history
<h1>How to sync local history after massive git history rewrite?</h1> <p>The question may seem odd, but I have issues syncing git history after rewriting over 100 commits. </p> <p>On the machine I did rewrite from, a simple <code>git fetch</code> synced it all. </p> <p>On another mac machine, <code>git sync</code> di...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,258
git
# How to sync local history after massive git history rewrite? The question may seem odd, but I have issues syncing git history after rewriting over 100 commits. On the machine I did rewrite from, a simple `git fetch` synced it all. On another mac machine, `git sync` did not help, but after a random deleting of loca...
The key (or keys) to understanding the issues here is (are) that, in Git: - Commits *are* the history. - The "true name" of any commit is its hash ID. - No commit can *ever* be changed. - Each commit remembers its previous (immediate ancestor, aka *parent*) commit(s) by hash ID. - Names, including branch and tag names...
48204077
How to deal with xxx~HEAD after git merge?
6
2018-01-11 09:51:52
<p><strong>In my branchA:</strong></p> <p>I copy a file from <code>folder04/config.xml</code> to <code>folder05/config.xml</code>, then <code>git add</code> and <code>commit</code>.</p> <p><strong>In my branchB (B is branch out from A):</strong></p> <p>I already have one file named <code>folder05/config.xml</code>.<...
4,598
5,081,990
2018-01-11 13:29:49
48,208,268
12
2018-01-11 13:29:49
729,881
2018-01-11 13:29:49
https://stackoverflow.com/q/48204077
https://stackoverflow.com/a/48208268
<blockquote> <p>It generates a file named config.xml~HEAD, what does it means?</p> </blockquote> <p>This file was generated automatically by <code>git</code> because you had a filename collision conflict - you had two items that were unrelated in the two branches trying to occupy the name <code>config.xml</code>.</p...
<blockquote> <p>It generates a file named config.xml~HEAD, what does it means?</p> </blockquote> <p>This file was generated automatically by <code>git</code> because you had a filename collision conflict - you had two items that were unrelated in the two branches trying to occupy the name <code>config.xml</code>.</p...
119, 28897, 106113
git, git-merge, git-merge-conflict
<h1>How to deal with xxx~HEAD after git merge?</h1> <p><strong>In my branchA:</strong></p> <p>I copy a file from <code>folder04/config.xml</code> to <code>folder05/config.xml</code>, then <code>git add</code> and <code>commit</code>.</p> <p><strong>In my branchB (B is branch out from A):</strong></p> <p>I already ha...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,259
git
# How to deal with xxx~HEAD after git merge? **In my branchA:** I copy a file from `folder04/config.xml` to `folder05/config.xml`, then `git add` and `commit`. **In my branchB (B is branch out from A):** I already have one file named `folder05/config.xml`. **Now I merge `branchA` into `branchB`, it appears a weird...
> It generates a file named config.xml~HEAD, what does it means? This file was generated automatically by `git` because you had a filename collision conflict - you had two items that were unrelated in the two branches trying to occupy the name `config.xml`. This could be caused by a variety of situations: **Most lik...
45219849
Jenkinsfile not found
6
2017-07-20 16:01:14
<p>I'm just starting out with Jenkins, and can't seem to get it to work. I created a text file called 'Jenkinsfile' in the root directory of my repository, but when I try to buil I'm getting the error "‘Jenkinsfile’ not found Does not meet criteria". This is the full Jenkins output:</p> <pre><code>Started by user Josh...
15,867
3,769,033
2020-05-31 20:43:34
45,220,660
12
2017-07-20 16:43:35
439,790
2017-07-20 16:43:35
https://stackoverflow.com/q/45219849
https://stackoverflow.com/a/45220660
<p>The '.txt' extension may be the issue: Jenkins is looking for 'Jenkinsfile' without extension. <code>git mv Jenkinsfile.txt Jenkinsfile &amp;&amp; git commit</code> will rename the file. </p>
<p>The '.txt' extension may be the issue: Jenkins is looking for 'Jenkinsfile' without extension. <code>git mv Jenkinsfile.txt Jenkinsfile &amp;&amp; git commit</code> will rename the file. </p>
119, 64999
git, jenkins
<h1>Jenkinsfile not found</h1> <p>I'm just starting out with Jenkins, and can't seem to get it to work. I created a text file called 'Jenkinsfile' in the root directory of my repository, but when I try to buil I'm getting the error "‘Jenkinsfile’ not found Does not meet criteria". This is the full Jenkins output:</p> ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,262
git
# Jenkinsfile not found I'm just starting out with Jenkins, and can't seem to get it to work. I created a text file called 'Jenkinsfile' in the root directory of my repository, but when I try to buil I'm getting the error "‘Jenkinsfile’ not found Does not meet criteria". This is the full Jenkins output: ``` Started b...
The '.txt' extension may be the issue: Jenkins is looking for 'Jenkinsfile' without extension. `git mv Jenkinsfile.txt Jenkinsfile && git commit` will rename the file.
43274311
Uncommit all commits in current branch but leave all changes at the current state
6
2017-04-07 09:16:52
<p>I have a branch <code>A</code> in my repo with 10 commits. What I want is to find a way to delete all commits but leave all changes in the current branch (so the state of the code would be the same but all commits in <code>A</code> would be gone). The purpose is that I now can go over all the changes and cerry pick ...
5,957
3,139,545
2017-04-07 10:42:33
43,275,340
12
2017-04-07 10:05:43
20,713
2017-04-07 10:05:43
https://stackoverflow.com/q/43274311
https://stackoverflow.com/a/43275340
<p><code>git reset master</code> will change <code>HEAD</code> and the index to be the same state as <code>master</code>, but leave the working tree untouched (e.g. the current state).</p>
<p><code>git reset master</code> will change <code>HEAD</code> and the index to be the same state as <code>master</code>, but leave the working tree untouched (e.g. the current state).</p>
119
git
<h1>Uncommit all commits in current branch but leave all changes at the current state</h1> <p>I have a branch <code>A</code> in my repo with 10 commits. What I want is to find a way to delete all commits but leave all changes in the current branch (so the state of the code would be the same but all commits in <code>A</...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,263
git
# Uncommit all commits in current branch but leave all changes at the current state I have a branch `A` in my repo with 10 commits. What I want is to find a way to delete all commits but leave all changes in the current branch (so the state of the code would be the same but all commits in `A` would be gone). The purpo...
`git reset master` will change `HEAD` and the index to be the same state as `master`, but leave the working tree untouched (e.g. the current state).
43121292
How to install third party libraries in Drupal 8 with Composer that are not on packagist?
6
2017-03-30 14:50:30
<p>What is the best way to install a third party library in Drupal 8 that is not on packagist?</p> <p>For example I have the <a href="https://www.drupal.org/project/color_field" rel="noreferrer">Color Field module</a>, which can use the <a href="https://github.com/recurser/jquery-simple-color" rel="noreferrer">jQuery ...
4,803
4,950,011
2021-03-19 05:40:29
43,128,869
12
2017-03-30 21:41:00
3,597,438
2017-03-30 21:41:00
https://stackoverflow.com/q/43121292
https://stackoverflow.com/a/43128869
<p>You was on the right track, in your composer.json you can make your own "packages" for example:</p> <pre><code>"repositories": [ { "type": "package", "package": { "name": "jquery/simplecolor", "version": "1.2.1", "dist": { "url": "https://github.com/recurser/jquery-simple-color/a...
<p>You was on the right track, in your composer.json you can make your own "packages" for example:</p> <pre><code>"repositories": [ { "type": "package", "package": { "name": "jquery/simplecolor", "version": "1.2.1", "dist": { "url": "https://github.com/recurser/jquery-simple-color/a...
119, 3262, 70964, 78546
composer-php, drupal, drupal-8, git
<h1>How to install third party libraries in Drupal 8 with Composer that are not on packagist?</h1> <p>What is the best way to install a third party library in Drupal 8 that is not on packagist?</p> <p>For example I have the <a href="https://www.drupal.org/project/color_field" rel="noreferrer">Color Field module</a>, w...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,264
git
# How to install third party libraries in Drupal 8 with Composer that are not on packagist? What is the best way to install a third party library in Drupal 8 that is not on packagist? For example I have the [Color Field module](https://www.drupal.org/project/color_field), which can use the [jQuery Simple Color Picker...
You was on the right track, in your composer.json you can make your own "packages" for example: ``` "repositories": [ { "type": "package", "package": { "name": "jquery/simplecolor", "version": "1.2.1", "dist": { "url": "https://github.com/recurser/jquery-simple-color/archive/v1.2.1....
42537716
How to get the user.email config using gitpython ?
6
2017-03-01 17:01:45
<p>I have a repo initialized as </p> <pre><code>r = git.Repo.init(dirPath) </code></pre> <p>How can I get the user.email field for the git config for that repo using gitpython? </p>
6,484
5,771,861
2019-03-08 17:56:50
42,613,047
12
2017-03-05 19:39:19
5,771,861
2019-03-08 17:56:50
https://stackoverflow.com/q/42537716
https://stackoverflow.com/a/42613047
<p>After looking into the <a href="https://github.com/gitpython-developers/GitPython/blob/7a6ca8c40433400f6bb3ece2ed30808316de5be3/git/config.py#L510" rel="noreferrer">source</a> of gitpython this is one way I managed to do it. </p> <pre><code>r = git.Repo.init(dirPath) reader = r.config_reader() field = reader.get_v...
<p>After looking into the <a href="https://github.com/gitpython-developers/GitPython/blob/7a6ca8c40433400f6bb3ece2ed30808316de5be3/git/config.py#L510" rel="noreferrer">source</a> of gitpython this is one way I managed to do it. </p> <pre><code>r = git.Repo.init(dirPath) reader = r.config_reader() field = reader.get_v...
61013
gitpython
<h1>How to get the user.email config using gitpython ?</h1> <p>I have a repo initialized as </p> <pre><code>r = git.Repo.init(dirPath) </code></pre> <p>How can I get the user.email field for the git config for that repo using gitpython? </p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,265
git
# How to get the user.email config using gitpython ? I have a repo initialized as ``` r = git.Repo.init(dirPath) ``` How can I get the user.email field for the git config for that repo using gitpython?
After looking into the [source](https://github.com/gitpython-developers/GitPython/blob/7a6ca8c40433400f6bb3ece2ed30808316de5be3/git/config.py#L510) of gitpython this is one way I managed to do it. ``` r = git.Repo.init(dirPath) reader = r.config_reader() field = reader.get_value("user","email") ```
37510591
Cannot add "dist" folder to github repo
6
2016-05-29 13:40:51
<p>When I create folder named <code>dist</code> and add anything to it github fails to see new additions.</p> <p><code>git add .</code> reports that all is up do date.</p> <p>any reason for that?</p>
6,988
1,680,932
2016-05-29 14:05:03
37,510,658
12
2016-05-29 13:46:55
35,060
2016-05-29 13:46:55
https://stackoverflow.com/q/37510591
https://stackoverflow.com/a/37510658
<p>Most probably you have a<code>dist</code> entry in your project's <code>.gitignore</code> file.</p>
<p>Most probably you have a<code>dist</code> entry in your project's <code>.gitignore</code> file.</p>
119, 14215
addition, git
<h1>Cannot add "dist" folder to github repo</h1> <p>When I create folder named <code>dist</code> and add anything to it github fails to see new additions.</p> <p><code>git add .</code> reports that all is up do date.</p> <p>any reason for that?</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,267
git
# Cannot add "dist" folder to github repo When I create folder named `dist` and add anything to it github fails to see new additions. `git add .` reports that all is up do date. any reason for that?
Most probably you have a`dist` entry in your project's `.gitignore` file.
34906342
Can't find my commit after doing a git pull
6
2016-01-20 17:14:53
<p>I have a local branch that I was working on last week. I knew I was going to be away for it for a while, so I committed my changes, but did not push them. Today I went back to work on it, and when I checked it out, it told me I was 40 commits behind origin, and I should do a <code>git pull</code>.</p> <p>So I did. ...
4,562
341,611
2016-01-20 17:39:25
34,906,850
12
2016-01-20 17:39:25
3,607,039
2016-01-20 17:39:25
https://stackoverflow.com/q/34906342
https://stackoverflow.com/a/34906850
<p>Some time ago you made a commit, and then your HEAD pointer was referencing the commit you are currently looking for. You can use <code>git reflog</code> to see a history of the commits that have been referenced by HEAD.</p> <p>This history will show you all the commits referenced by HEAD, and the reason why HEAD m...
<p>Some time ago you made a commit, and then your HEAD pointer was referencing the commit you are currently looking for. You can use <code>git reflog</code> to see a history of the commits that have been referenced by HEAD.</p> <p>This history will show you all the commits referenced by HEAD, and the reason why HEAD m...
119, 456
git, version-control
<h1>Can't find my commit after doing a git pull</h1> <p>I have a local branch that I was working on last week. I knew I was going to be away for it for a while, so I committed my changes, but did not push them. Today I went back to work on it, and when I checked it out, it told me I was 40 commits behind origin, and I ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,268
git
# Can't find my commit after doing a git pull I have a local branch that I was working on last week. I knew I was going to be away for it for a while, so I committed my changes, but did not push them. Today I went back to work on it, and when I checked it out, it told me I was 40 commits behind origin, and I should do...
Some time ago you made a commit, and then your HEAD pointer was referencing the commit you are currently looking for. You can use `git reflog` to see a history of the commits that have been referenced by HEAD. This history will show you all the commits referenced by HEAD, and the reason why HEAD moved to that commit. ...
32426984
Rebase against the main branch
6
2015-09-06 18:40:55
<p>There are two branches. The main branch and branch with one feature. But the feature branch is in conflict with the main. People told me, that I should rebase the feature branch against the main.</p> <p>Does it mean <code>git rebase origin/main</code> (and I am on the feature branch) or <code>git rebase feature_bra...
18,884
3,599,497
2015-09-06 19:14:25
32,426,998
12
2015-09-06 18:42:11
6,309
2015-09-06 19:14:25
https://stackoverflow.com/q/32426984
https://stackoverflow.com/a/32426998
<p>That would mean:</p> <pre><code>git fetch git checkout feature git rebase origin/main </code></pre> <p>You replay locally <code>feature</code> branch on top of the updated <code>origin/main</code>.<br> That gives you a chance to resolve any conflict locally, and <em>then</em> push the feature branch (a <code>git p...
<p>That would mean:</p> <pre><code>git fetch git checkout feature git rebase origin/main </code></pre> <p>You replay locally <code>feature</code> branch on top of the updated <code>origin/main</code>.<br> That gives you a chance to resolve any conflict locally, and <em>then</em> push the feature branch (a <code>git p...
119
git
<h1>Rebase against the main branch</h1> <p>There are two branches. The main branch and branch with one feature. But the feature branch is in conflict with the main. People told me, that I should rebase the feature branch against the main.</p> <p>Does it mean <code>git rebase origin/main</code> (and I am on the feature...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,270
git
# Rebase against the main branch There are two branches. The main branch and branch with one feature. But the feature branch is in conflict with the main. People told me, that I should rebase the feature branch against the main. Does it mean `git rebase origin/main` (and I am on the feature branch) or `git rebase fea...
That would mean: ``` git fetch git checkout feature git rebase origin/main ``` You replay locally `feature` branch on top of the updated `origin/main`. That gives you a chance to resolve any conflict locally, and *then* push the feature branch (a `git push --force` since its history has changed): make sure you are ...
31775995
Recovering codebase from bare Git repository
6
2015-08-02 19:56:30
<p>I have my codebase in a Git repo on my laptop and I set up a bare Git repo on an external hard drive for my backup. I successfully pushed my first commit, but noticed my backup repo on my external hard drive does not show the files.</p> <p>If my laptop crashes, how would I restore my full codebase? Was setting up as...
2,507
1,869,253
2023-09-17 09:06:41
31,776,054
12
2015-08-02 20:02:09
2,234,742
2015-08-02 20:02:09
https://stackoverflow.com/q/31775995
https://stackoverflow.com/a/31776054
<p>Change into a new directory and run</p> <pre><code>git clone /bare/repo/dir.git </code></pre> <p>substituting the path for the real path of your bare repo. This will clone and check out the latest revision of your repository.</p>
<p>Change into a new directory and run</p> <pre><code>git clone /bare/repo/dir.git </code></pre> <p>substituting the path for the real path of your bare repo. This will clone and check out the latest revision of your repository.</p>
119
git
<h1>Recovering codebase from bare Git repository</h1> <p>I have my codebase in a Git repo on my laptop and I set up a bare Git repo on an external hard drive for my backup. I successfully pushed my first commit, but noticed my backup repo on my external hard drive does not show the files.</p> <p>If my laptop crashes, h...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,271
git
# Recovering codebase from bare Git repository I have my codebase in a Git repo on my laptop and I set up a bare Git repo on an external hard drive for my backup. I successfully pushed my first commit, but noticed my backup repo on my external hard drive does not show the files. If my laptop crashes, how would I rest...
Change into a new directory and run ``` git clone /bare/repo/dir.git ``` substituting the path for the real path of your bare repo. This will clone and check out the latest revision of your repository.
29395570
Git Merge - Binary File Conflict Resolution
6
2015-04-01 16:03:23
<p>How do I resolve a binary file conflict resolution during a merge operation in git? Here's what I've done so far:</p> <pre><code>git checkout master git fetch origin git merge working_branch ... [Conflicts] ... git status ... Unmerged paths: both modified: Path/file.dll ... </code></pre> <p>I ...
10,801
214,296
2015-04-01 20:04:56
29,399,779
12
2015-04-01 20:04:56
214,296
2015-04-01 20:04:56
https://stackoverflow.com/q/29395570
https://stackoverflow.com/a/29399779
<p>Figured it out earlier today:</p> <pre><code>git checkout --theirs Path/file.dll git add Path/file.dll git commit -m "Resolved merge conflict by checking out file from working_branch and adding it to the master" </code></pre>
<p>Figured it out earlier today:</p> <pre><code>git checkout --theirs Path/file.dll git add Path/file.dll git commit -m "Resolved merge conflict by checking out file from working_branch and adding it to the master" </code></pre>
119, 5004, 28897, 62599, 106113
binaryfiles, git, git-merge, git-merge-conflict, merge-conflict-resolution
<h1>Git Merge - Binary File Conflict Resolution</h1> <p>How do I resolve a binary file conflict resolution during a merge operation in git? Here's what I've done so far:</p> <pre><code>git checkout master git fetch origin git merge working_branch ... [Conflicts] ... git status ... Unmerged paths: both modif...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,273
git
# Git Merge - Binary File Conflict Resolution How do I resolve a binary file conflict resolution during a merge operation in git? Here's what I've done so far: ``` git checkout master git fetch origin git merge working_branch ... [Conflicts] ... git status ... Unmerged paths: both modified: Path/file.dll ...
Figured it out earlier today: ``` git checkout --theirs Path/file.dll git add Path/file.dll git commit -m "Resolved merge conflict by checking out file from working_branch and adding it to the master" ```
27238258
Git show whole file changes
6
2014-12-01 22:08:29
<p>Is there a way to get the <code>git show</code> command to show the whole contents of a file when viewing a commit? For example: if it currently show something like</p> <pre><code>foo.cpp +++ int main() { +++ std::cout &lt;&lt; "HELLO" &lt;&lt; std::endl; +++ } </code></pre> <p>I would want the output to say:<...
4,261
3,204,951
2018-07-13 08:36:04
27,238,419
12
2014-12-01 22:19:24
281,108
2014-12-01 22:19:24
https://stackoverflow.com/q/27238258
https://stackoverflow.com/a/27238419
<p>This is kind of a hack, but <code>git show</code> (like <code>git diff</code>) has the <code>-U</code> option that lets you specify how many lines of context to show. If you use a number that's bigger than the region between the difference and the start or end of the file, then it'll show the whole file. So if you u...
<p>This is kind of a hack, but <code>git show</code> (like <code>git diff</code>) has the <code>-U</code> option that lets you specify how many lines of context to show. If you use a number that's bigger than the region between the difference and the start or end of the file, then it'll show the whole file. So if you u...
119, 606, 9033, 74295
diff, git, git-diff, git-show
<h1>Git show whole file changes</h1> <p>Is there a way to get the <code>git show</code> command to show the whole contents of a file when viewing a commit? For example: if it currently show something like</p> <pre><code>foo.cpp +++ int main() { +++ std::cout &lt;&lt; "HELLO" &lt;&lt; std::endl; +++ } </code></pre>...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,275
git
# Git show whole file changes Is there a way to get the `git show` command to show the whole contents of a file when viewing a commit? For example: if it currently show something like ``` foo.cpp +++ int main() { +++ std::cout << "HELLO" << std::endl; +++ } ``` I would want the output to say: ``` foo.cpp #incl...
This is kind of a hack, but `git show` (like `git diff`) has the `-U` option that lets you specify how many lines of context to show. If you use a number that's bigger than the region between the difference and the start or end of the file, then it'll show the whole file. So if you use a really big number, it'll work t...
26724818
for loop over all git branches with certain name
6
2014-11-03 22:57:25
<p>I have the following git branches</p> <pre><code>foo bar foobar feature/foo feature/bar feature/buzz </code></pre> <p>How would you do a for loop over all branches that start with the word 'feature/' ? </p> <p>When I try the following, it strangely prints out more than just the git branches. </p> <pre><code>for ...
3,582
1,626,687
2014-11-03 23:33:14
26,725,225
12
2014-11-03 23:33:14
4,021,077
2014-11-03 23:33:14
https://stackoverflow.com/q/26724818
https://stackoverflow.com/a/26725225
<p>"We actively discourage against use of any Porcelain command, including git branch, in scripts" - from the <a href="http://git-blame.blogspot.com/2013/06/checking-current-branch-programatically.html" rel="noreferrer">Git Maintainer's Blog</a></p> <p>You want to use something like </p> <p><code>git for-each-ref --f...
<p>"We actively discourage against use of any Porcelain command, including git branch, in scripts" - from the <a href="http://git-blame.blogspot.com/2013/06/checking-current-branch-programatically.html" rel="noreferrer">Git Maintainer's Blog</a></p> <p>You want to use something like </p> <p><code>git for-each-ref --f...
119
git
<h1>for loop over all git branches with certain name</h1> <p>I have the following git branches</p> <pre><code>foo bar foobar feature/foo feature/bar feature/buzz </code></pre> <p>How would you do a for loop over all branches that start with the word 'feature/' ? </p> <p>When I try the following, it strangely prints ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,276
git
# for loop over all git branches with certain name I have the following git branches ``` foo bar foobar feature/foo feature/bar feature/buzz ``` How would you do a for loop over all branches that start with the word 'feature/' ? When I try the following, it strangely prints out more than just the git branches. ```...
"We actively discourage against use of any Porcelain command, including git branch, in scripts" - from the [Git Maintainer's Blog](http://git-blame.blogspot.com/2013/06/checking-current-branch-programatically.html) You want to use something like `git for-each-ref --format='%(refname:short)' refs/heads/feature/` whic...
22946275
What's the point of git fetch?
6
2014-04-08 19:18:44
<p>I don't understand the advantage. I've seen it argued in places such as <a href="http://borgstrom.ca/2011/01/05/git-fetch-dont-pull.html" rel="noreferrer">this article</a> that fetching instead of pulling gives you the opportunity to inspect the changes before you merge them into your local branch.</p> <p>But, in t...
1,793
1,029,146
2014-04-08 19:34:14
22,946,333
12
2014-04-08 19:21:36
1,656,568
2014-04-08 19:34:14
https://stackoverflow.com/q/22946275
https://stackoverflow.com/a/22946333
<p>You're missing that <code>git fetch</code> is used to <strong>update your local copy of the remote branch</strong>.</p> <p>So the command you mentioned would do a <code>diff</code> between the <strong>local</strong> branch <code>master</code> and the <strong>local copy</strong> of <code>origin/master</code>, not th...
<p>You're missing that <code>git fetch</code> is used to <strong>update your local copy of the remote branch</strong>.</p> <p>So the command you mentioned would do a <code>diff</code> between the <strong>local</strong> branch <code>master</code> and the <strong>local copy</strong> of <code>origin/master</code>, not th...
119
git
<h1>What's the point of git fetch?</h1> <p>I don't understand the advantage. I've seen it argued in places such as <a href="http://borgstrom.ca/2011/01/05/git-fetch-dont-pull.html" rel="noreferrer">this article</a> that fetching instead of pulling gives you the opportunity to inspect the changes before you merge them i...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,279
git
# What's the point of git fetch? I don't understand the advantage. I've seen it argued in places such as [this article](http://borgstrom.ca/2011/01/05/git-fetch-dont-pull.html) that fetching instead of pulling gives you the opportunity to inspect the changes before you merge them into your local branch. But, in that ...
You're missing that `git fetch` is used to **update your local copy of the remote branch**. So the command you mentioned would do a `diff` between the **local** branch `master` and the **local copy** of `origin/master`, not the *actual* state of the `master` branch on origin. `fetch` will connect to the remote server ...
21359777
git fetch fails due to pack-object failure
6
2014-01-26 04:39:46
<p>When I add our remote repository as upstream and try to fetch it , it fails as below :</p> <pre><code> $ git fetch upstream remote: Counting objects: 11901, done. remote: aborting due to possible repository corruption on the remote side. error: pack-objects died of signal 9 error: git upload-pack...
8,603
895,429
2014-12-10 10:19:14
21,362,327
12
2014-01-26 10:33:29
1,256,452
2014-01-26 10:33:29
https://stackoverflow.com/q/21359777
https://stackoverflow.com/a/21362327
<p>To expand a bit on <a href="https://stackoverflow.com/a/21361370/1256452">VonC's answer</a>...</p> <p>First, it may help to note that <code>signal 9</code> refers to <code>SIGKILL</code> and tends to occur because the remote in question is a Linux host and the process is being destroyed by the Linux <a href="http:/...
<p>To expand a bit on <a href="https://stackoverflow.com/a/21361370/1256452">VonC's answer</a>...</p> <p>First, it may help to note that <code>signal 9</code> refers to <code>SIGKILL</code> and tends to occur because the remote in question is a Linux host and the process is being destroyed by the Linux <a href="http:/...
119, 33720, 34099
git, git-clone, git-fetch
<h1>git fetch fails due to pack-object failure</h1> <p>When I add our remote repository as upstream and try to fetch it , it fails as below :</p> <pre><code> $ git fetch upstream remote: Counting objects: 11901, done. remote: aborting due to possible repository corruption on the remote side. error: pack...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,280
git
# git fetch fails due to pack-object failure When I add our remote repository as upstream and try to fetch it , it fails as below : ``` $ git fetch upstream remote: Counting objects: 11901, done. remote: aborting due to possible repository corruption on the remote side. error: pack-objects died of sig...
To expand a bit on [VonC's answer](https://stackoverflow.com/a/21361370/1256452)... First, it may help to note that `signal 9` refers to `SIGKILL` and tends to occur because the remote in question is a Linux host and the process is being destroyed by the Linux ["OOM killer"](http://www.oracle.com/technetwork/articles/...
16565540
How can I see what files Git is going to push to the server in Xcode?
6
2013-05-15 12:53:38
<p>I have Git setup on an Xcode project and I make many small local commits before I push them to the server. However, I am not able to tell easily what all of the file changes are if I would do a git push. I know that you can look in the organizer and see all of your individual commits, but I can't seem to find an agg...
14,455
1,199,792
2016-08-01 00:44:39
16,578,120
12
2013-05-16 02:35:50
2,340,264
2013-05-17 04:52:04
https://stackoverflow.com/q/16565540
https://stackoverflow.com/a/16578120
<p><strong>Command Line</strong></p> <pre><code>git diff --name-only origin/master </code></pre> <p>Will list the files that you have changed but not pushed.</p> <pre><code>git diff origin/master directory_foo/file_bar.m </code></pre> <p>Will list the line by line diff of all the un-pushed changes to directory_foo/...
<p><strong>Command Line</strong></p> <pre><code>git diff --name-only origin/master </code></pre> <p>Will list the files that you have changed but not pushed.</p> <pre><code>git diff origin/master directory_foo/file_bar.m </code></pre> <p>Will list the line by line diff of all the un-pushed changes to directory_foo/...
119, 908
git, xcode
<h1>How can I see what files Git is going to push to the server in Xcode?</h1> <p>I have Git setup on an Xcode project and I make many small local commits before I push them to the server. However, I am not able to tell easily what all of the file changes are if I would do a git push. I know that you can look in the or...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,283
git
# How can I see what files Git is going to push to the server in Xcode? I have Git setup on an Xcode project and I make many small local commits before I push them to the server. However, I am not able to tell easily what all of the file changes are if I would do a git push. I know that you can look in the organizer a...
**Command Line** ``` git diff --name-only origin/master ``` Will list the files that you have changed but not pushed. ``` git diff origin/master directory_foo/file_bar.m ``` Will list the line by line diff of all the un-pushed changes to directory_foo/file_bar.m. **GUI Tool** If your looking for GUI Tools for a G...
16476476
Git diff doesn't work after git stash pop
6
2013-05-10 06:32:43
<p>After <code>git stash pop</code>, there were some conflicts, things like:</p> <pre><code>&lt;&lt;&lt;&lt;&lt;&lt;&lt; Updated upstream int foo = 5; ======= int foo = 6; &gt;&gt;&gt;&gt;&gt;&gt;&gt; Stashed changes </code></pre> <p>I resolved them in the code, but now I can't preview my changes before committing th...
1,731
492,336
2017-01-01 11:17:22
16,478,151
12
2013-05-10 08:36:11
1,671,066
2017-01-01 11:17:22
https://stackoverflow.com/q/16476476
https://stackoverflow.com/a/16478151
<p>Your <code>pop</code> resulted in a merge conflict. In order to resolve it, you need to edit the file (which you already did) and then call <code>git add mainwindow.cpp</code> to tell git, that you have resolved the conflict.</p> <p>If you want to preview your changes, you can do so with <code>git diff --cached</co...
<p>Your <code>pop</code> resulted in a merge conflict. In order to resolve it, you need to edit the file (which you already did) and then call <code>git add mainwindow.cpp</code> to tell git, that you have resolved the conflict.</p> <p>If you want to preview your changes, you can do so with <code>git diff --cached</co...
119, 13091, 26924
git, git-stash, qt-creator
<h1>Git diff doesn't work after git stash pop</h1> <p>After <code>git stash pop</code>, there were some conflicts, things like:</p> <pre><code>&lt;&lt;&lt;&lt;&lt;&lt;&lt; Updated upstream int foo = 5; ======= int foo = 6; &gt;&gt;&gt;&gt;&gt;&gt;&gt; Stashed changes </code></pre> <p>I resolved them in the code, but ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,284
git
# Git diff doesn't work after git stash pop After `git stash pop`, there were some conflicts, things like: ``` <<<<<<< Updated upstream int foo = 5; ======= int foo = 6; >>>>>>> Stashed changes ``` I resolved them in the code, but now I can't preview my changes before committing them. All I get is this, and I know t...
Your `pop` resulted in a merge conflict. In order to resolve it, you need to edit the file (which you already did) and then call `git add mainwindow.cpp` to tell git, that you have resolved the conflict. If you want to preview your changes, you can do so with `git diff --cached`. This is because `git add` already adde...
15440291
Is there a way to make git flow show the commands it is executing behind the scenes?
6
2013-03-15 19:06:25
<p>Is there any way to make git-flow tell me ahead of time the exact git commands it will execute when I do a flow command; or tell me as it is dong it?</p> <p>All i can see the output and a summary?</p>
3,660
1,036,530
2015-09-09 04:54:27
15,452,202
12
2013-03-16 17:14:07
649,852
2013-03-16 17:14:07
https://stackoverflow.com/q/15440291
https://stackoverflow.com/a/15452202
<p>You can use Git's <code>GIT_TRACE</code> <a href="http://git-scm.com/docs/git#_environment_variables">environment variable</a> to get a detailed trace of commands executed. For example:</p> <pre><code>GIT_TRACE=true git flow feature start bar </code></pre> <p>... displays ...</p> <pre><code>trace: exec: 'git-flo...
<p>You can use Git's <code>GIT_TRACE</code> <a href="http://git-scm.com/docs/git#_environment_variables">environment variable</a> to get a detailed trace of commands executed. For example:</p> <pre><code>GIT_TRACE=true git flow feature start bar </code></pre> <p>... displays ...</p> <pre><code>trace: exec: 'git-flo...
119, 64339
git, git-flow
<h1>Is there a way to make git flow show the commands it is executing behind the scenes?</h1> <p>Is there any way to make git-flow tell me ahead of time the exact git commands it will execute when I do a flow command; or tell me as it is dong it?</p> <p>All i can see the output and a summary?</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,286
git
# Is there a way to make git flow show the commands it is executing behind the scenes? Is there any way to make git-flow tell me ahead of time the exact git commands it will execute when I do a flow command; or tell me as it is dong it? All i can see the output and a summary?
You can use Git's `GIT_TRACE` [environment variable](http://git-scm.com/docs/git#_environment_variables) to get a detailed trace of commands executed. For example: ``` GIT_TRACE=true git flow feature start bar ``` ... displays ... ``` trace: exec: 'git-flow' 'feature' 'start' 'bar' trace: run_command: 'git-flow' 'fe...
14370929
How do I keep two git repositories in sync?
6
2013-01-17 01:41:34
<p>Here is the scenario. I have two machines, "desktop" and "laptop".</p> <p>On desktop I do:</p> <pre><code>mkdir git_test cd git_test git init dd if=/dev/urandom of=test.img bs=1k count=1000 git add test.img git commit -m "Added first image" </code></pre> <p>Then on laptop I do:</p> <pre><code>git clone [USER]@de...
10,886
1,064,810
2013-11-12 06:52:14
14,371,044
12
2013-01-17 01:55:42
1,038,369
2013-01-17 02:46:14
https://stackoverflow.com/q/14370929
https://stackoverflow.com/a/14371044
<p>One way of doing this is to pull, not push. After you've set up your two machines, on the first machine:</p> <pre><code>git remote add origin [USER]@laptop:/home/[USER]/git_test git pull # Complains about untracked branch while adding the branch you want to track git branch --set-upstream master origin/master git p...
<p>One way of doing this is to pull, not push. After you've set up your two machines, on the first machine:</p> <pre><code>git remote add origin [USER]@laptop:/home/[USER]/git_test git pull # Complains about untracked branch while adding the branch you want to track git branch --set-upstream master origin/master git p...
119
git
<h1>How do I keep two git repositories in sync?</h1> <p>Here is the scenario. I have two machines, "desktop" and "laptop".</p> <p>On desktop I do:</p> <pre><code>mkdir git_test cd git_test git init dd if=/dev/urandom of=test.img bs=1k count=1000 git add test.img git commit -m "Added first image" </code></pre> <p>The...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,287
git
# How do I keep two git repositories in sync? Here is the scenario. I have two machines, "desktop" and "laptop". On desktop I do: ``` mkdir git_test cd git_test git init dd if=/dev/urandom of=test.img bs=1k count=1000 git add test.img git commit -m "Added first image" ``` Then on laptop I do: ``` git clone [USER]@...
One way of doing this is to pull, not push. After you've set up your two machines, on the first machine: ``` git remote add origin [USER]@laptop:/home/[USER]/git_test git pull # Complains about untracked branch while adding the branch you want to track git branch --set-upstream master origin/master git pull ``` Now y...
14053304
How git deals with folder names with spaces
6
2012-12-27 10:40:02
<p>I have a folder by the name <code>31 Files of - oop</code>. When I try running this command:</p> <blockquote> <p>git rm -rf 31 Files of - oop</p> </blockquote> <p>I get this fatal error :</p> <blockquote> <p>fatal: pathspec '31' did not match any files</p> </blockquote> <p>How do I need to prepare the folder...
10,446
492,293
2019-07-06 04:19:42
14,053,481
12
2012-12-27 10:52:44
2,840,147
2012-12-27 10:52:44
https://stackoverflow.com/q/14053304
https://stackoverflow.com/a/14053481
<p>Try in this way : </p> <p><code>git rm -rf "31 Files of - oop"</code> Where 31 Files of - oop is your file name.</p>
<p>Try in this way : </p> <p><code>git rm -rf "31 Files of - oop"</code> Where 31 Files of - oop is your file name.</p>
119
git
<h1>How git deals with folder names with spaces</h1> <p>I have a folder by the name <code>31 Files of - oop</code>. When I try running this command:</p> <blockquote> <p>git rm -rf 31 Files of - oop</p> </blockquote> <p>I get this fatal error :</p> <blockquote> <p>fatal: pathspec '31' did not match any files</p> ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,288
git
# How git deals with folder names with spaces I have a folder by the name `31 Files of - oop`. When I try running this command: > git rm -rf 31 Files of - oop I get this fatal error : > fatal: pathspec '31' did not match any files How do I need to prepare the folder names with spaces for use in git?.
Try in this way : `git rm -rf "31 Files of - oop"` Where 31 Files of - oop is your file name.
13611668
Degrees Minutes Seconds (DMS) RegEx
6
2012-11-28 18:09:48
<p>I have a regular expression that I want to match a latitude/longitude pair in a variety of fashions, e.g.</p> <pre><code>123 34 42 -123* 34' 42" 123* 34' 42" +123* 34' 42" 45* 12' 22"N 45 12' 22"S 90:00:00.0N </code></pre> <p>I want to be able to match these in a pair such that</p> <p><code>90:00:00.0N 180:00:00....
10,628
null
2012-11-29 01:59:19
13,616,000
12
2012-11-28 23:03:45
1,032,796
2012-11-29 01:59:19
https://stackoverflow.com/q/13611668
https://stackoverflow.com/a/13616000
<p>Well, for one thing, you're filling your character sets with a bunch of unnecessary pipe characters - alternation is implied in a <code>[]</code> pair. Additional cleanup: <code>+</code> doesn't need to be escaped in a character class. Your regular expression seems to be addressing a bigger problem statement than ...
<p>Well, for one thing, you're filling your character sets with a bunch of unnecessary pipe characters - alternation is implied in a <code>[]</code> pair. Additional cleanup: <code>+</code> doesn't need to be escaped in a character class. Your regular expression seems to be addressing a bigger problem statement than ...
17, 18, 20301
java, latitude-longitude, regex
<h1>Degrees Minutes Seconds (DMS) RegEx</h1> <p>I have a regular expression that I want to match a latitude/longitude pair in a variety of fashions, e.g.</p> <pre><code>123 34 42 -123* 34' 42" 123* 34' 42" +123* 34' 42" 45* 12' 22"N 45 12' 22"S 90:00:00.0N </code></pre> <p>I want to be able to match these in a pair s...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,289
git
# Degrees Minutes Seconds (DMS) RegEx I have a regular expression that I want to match a latitude/longitude pair in a variety of fashions, e.g. ``` 123 34 42 -123* 34' 42" 123* 34' 42" +123* 34' 42" 45* 12' 22"N 45 12' 22"S 90:00:00.0N ``` I want to be able to match these in a pair such that `90:00:00.0N 180:00:00....
Well, for one thing, you're filling your character sets with a bunch of unnecessary pipe characters - alternation is implied in a `[]` pair. Additional cleanup: `+` doesn't need to be escaped in a character class. Your regular expression seems to be addressing a bigger problem statement than you gave us - you make no m...
10436489
Find last commit in Git repo that contains a certain string pattern
6
2012-05-03 17:32:33
<p>I want to go back in time to the last commit which contained code such as, "ThisClass(object):". That code was subsequently removed from the project in a later commit.</p> <p>I thought about using git bisect + grep/awk-ing. I've also heard that git grep may allow you to do this sort of thing, though I can't figur...
1,034
558,699
2012-05-03 17:45:09
10,436,670
12
2012-05-03 17:45:09
1,198,509
2012-05-03 17:45:09
https://stackoverflow.com/q/10436489
https://stackoverflow.com/a/10436670
<p>Use the -S (search) argument to <code>git log</code>:</p> <pre><code>git log -S 'ThisClass(object):' </code></pre>
<p>Use the -S (search) argument to <code>git log</code>:</p> <pre><code>git log -S 'ThisClass(object):' </code></pre>
119, 990, 1271
awk, git, grep
<h1>Find last commit in Git repo that contains a certain string pattern</h1> <p>I want to go back in time to the last commit which contained code such as, "ThisClass(object):". That code was subsequently removed from the project in a later commit.</p> <p>I thought about using git bisect + grep/awk-ing. I've also hea...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,290
git
# Find last commit in Git repo that contains a certain string pattern I want to go back in time to the last commit which contained code such as, "ThisClass(object):". That code was subsequently removed from the project in a later commit. I thought about using git bisect + grep/awk-ing. I've also heard that git grep m...
Use the -S (search) argument to `git log`: ``` git log -S 'ThisClass(object):' ```
9745064
Using `git --git-dir /path/to/git pull /path/to/other/bare-git master` doesn't automatically update the working tree. Why not?
6
2012-03-16 22:02:34
<p>I found a peculiar behavior with git, and I can reproduce it every time on my machine.</p> <p>If I have two local repositories, one bare inside the folder <code>express.git</code>, and the other non-bare with a working tree inside the folder express, both in the same parent folder, I can do the command <code>git pu...
7,807
454,780
2012-03-17 00:00:40
9,746,005
12
2012-03-17 00:00:40
582
2012-03-17 00:00:40
https://stackoverflow.com/q/9745064
https://stackoverflow.com/a/9746005
<p>If you run <code>git --git-dir=some/dir/.git pull</code>, by default <code>git</code> will assume the current directory is the work tree. Not the parent of <code>some/dir/.git</code>, but your current <code>pwd</code>. This means that running that command will try to update the current directory as if it's the work ...
<p>If you run <code>git --git-dir=some/dir/.git pull</code>, by default <code>git</code> will assume the current directory is the work tree. Not the parent of <code>some/dir/.git</code>, but your current <code>pwd</code>. This means that running that command will try to update the current directory as if it's the work ...
119
git
<h1>Using `git --git-dir /path/to/git pull /path/to/other/bare-git master` doesn't automatically update the working tree. Why not?</h1> <p>I found a peculiar behavior with git, and I can reproduce it every time on my machine.</p> <p>If I have two local repositories, one bare inside the folder <code>express.git</code>,...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,291
git
# Using `git --git-dir /path/to/git pull /path/to/other/bare-git master` doesn't automatically update the working tree. Why not? I found a peculiar behavior with git, and I can reproduce it every time on my machine. If I have two local repositories, one bare inside the folder `express.git`, and the other non-bare wit...
If you run `git --git-dir=some/dir/.git pull`, by default `git` will assume the current directory is the work tree. Not the parent of `some/dir/.git`, but your current `pwd`. This means that running that command will try to update the current directory as if it's the work tree and will end up writing files into your `p...
8056271
Rails 3.1 Deleted folder can I recover with git?
6
2011-11-08 19:52:06
<p>OK. I was deleting precompiled assets in my public/assets folder. I accidentally deleted an entire folder I had in there as well. I checked out a repository and started webrick and the files seem to be loading, although when I look in the directory they aren't there? how do i restore/move those files back into t...
6,251
963,080
2011-11-08 21:13:52
8,056,386
12
2011-11-08 20:02:09
335,974
2011-11-08 21:13:52
https://stackoverflow.com/q/8056271
https://stackoverflow.com/a/8056386
<p>If you haven't commited the deletion. Check the changes that are pending with <code>git status</code> and use <code>git checkout</code> to restore a file to its last commited state ( HEAD ):</p> <p><code>git checkout -- file_path</code></p> <p>Git works on files not on directories.</p>
<p>If you haven't commited the deletion. Check the changes that are pending with <code>git status</code> and use <code>git checkout</code> to restore a file to its last commited state ( HEAD ):</p> <p><code>git checkout -- file_path</code></p> <p>Git works on files not on directories.</p>
119, 68616
git, ruby-on-rails-3.1
<h1>Rails 3.1 Deleted folder can I recover with git?</h1> <p>OK. I was deleting precompiled assets in my public/assets folder. I accidentally deleted an entire folder I had in there as well. I checked out a repository and started webrick and the files seem to be loading, although when I look in the directory they ar...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,292
git
# Rails 3.1 Deleted folder can I recover with git? OK. I was deleting precompiled assets in my public/assets folder. I accidentally deleted an entire folder I had in there as well. I checked out a repository and started webrick and the files seem to be loading, although when I look in the directory they aren't there? ...
If you haven't commited the deletion. Check the changes that are pending with `git status` and use `git checkout` to restore a file to its last commited state ( HEAD ): `git checkout -- file_path` Git works on files not on directories.
2556003
Can Git push / pull over the internet to distributed repos?
6
2010-03-31 19:48:14
<p>I understand that Git can be used without a central repository. However, I am starting a project with several other people, and we are geographically distributed. I.e. We will never be on the same LAN to synch repos.</p> <p>So my question: Is it possible to push / pull changes from each others repos over the intern...
2,316
269,512
2014-10-03 16:16:57
2,556,078
12
2010-03-31 20:01:39
189,179
2014-10-03 16:16:57
https://stackoverflow.com/q/2556003
https://stackoverflow.com/a/2556078
<p>If you have SSH access to each others' machines (which may be a little easier to set up on some networks than git:// protocol access) then it's as easy as:</p> <pre><code>git pull ssh://username@host:/path/to/repository/.git </code></pre> <p>If direct access by any protocol isn't possible (e.g. if you're behind a ...
<p>If you have SSH access to each others' machines (which may be a little easier to set up on some networks than git:// protocol access) then it's as easy as:</p> <pre><code>git pull ssh://username@host:/path/to/repository/.git </code></pre> <p>If direct access by any protocol isn't possible (e.g. if you're behind a ...
119
git
<h1>Can Git push / pull over the internet to distributed repos?</h1> <p>I understand that Git can be used without a central repository. However, I am starting a project with several other people, and we are geographically distributed. I.e. We will never be on the same LAN to synch repos.</p> <p>So my question: Is it p...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,293
git
# Can Git push / pull over the internet to distributed repos? I understand that Git can be used without a central repository. However, I am starting a project with several other people, and we are geographically distributed. I.e. We will never be on the same LAN to synch repos. So my question: Is it possible to push ...
If you have SSH access to each others' machines (which may be a little easier to set up on some networks than git:// protocol access) then it's as easy as: ``` git pull ssh://username@host:/path/to/repository/.git ``` If direct access by any protocol isn't possible (e.g. if you're behind a router with NAT) then you c...
2519031
Git: HEAD has disappeared, want to merge it into master
6
2010-03-25 20:15:20
<p><a href="http://siteroller.net/archive/images/Forums/headless%20GIT.png" rel="noreferrer">reflog vs GITK http://siteroller.net/archive/images/Forums/headless%20GIT.png</a></p> <p>The top image is the output of: git reflog.<br> The bottom is what GITK in GIT GUI (msysgit) shows me when I look at all branch history.<...
8,996
87,520
2010-03-25 22:01:52
2,519,055
12
2010-03-25 20:20:21
6,309
2010-03-25 20:35:57
https://stackoverflow.com/q/2519031
https://stackoverflow.com/a/2519055
<blockquote> <p>why to update these commits into whatever branch they are in?</p> </blockquote> <p>That's just it: you are not on any branch but currently working on a <strong><a href="https://stackoverflow.com/questions/999907/git-push-says-everything-up-to-date-even-though-i-have-local-changes/1000009#1000009">det...
<blockquote> <p>why to update these commits into whatever branch they are in?</p> </blockquote> <p>That's just it: you are not on any branch but currently working on a <strong><a href="https://stackoverflow.com/questions/999907/git-push-says-everything-up-to-date-even-though-i-have-local-changes/1000009#1000009">det...
119
git
<h1>Git: HEAD has disappeared, want to merge it into master</h1> <p><a href="http://siteroller.net/archive/images/Forums/headless%20GIT.png" rel="noreferrer">reflog vs GITK http://siteroller.net/archive/images/Forums/headless%20GIT.png</a></p> <p>The top image is the output of: git reflog.<br> The bottom is what GITK ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,294
git
# Git: HEAD has disappeared, want to merge it into master [reflog vs GITK http://siteroller.net/archive/images/Forums/headless%20GIT.png](http://siteroller.net/archive/images/Forums/headless%20GIT.png) The top image is the output of: git reflog. The bottom is what GITK in GIT GUI (msysgit) shows me when I look at a...
> why to update these commits into whatever branch they are in? That's just it: you are not on any branch but currently working on a **[detached head](https://stackoverflow.com/questions/999907/git-push-says-everything-up-to-date-even-though-i-have-local-changes/1000009#1000009)**: > starting from version 1.5.0, the ...
1101934
Why does git keep deleting my folder?
6
2009-07-09 05:14:55
<p>I have a folder in my repository called 'activity'. It keeps getting strangely deleted from the repository, and isn't seen as an untracked file.</p> <p>In github, it is rendered as a folder with a green arrow, and the text '→ f32111b' next to it. This has happened several times now, and only with this one folder. <...
3,533
9,106
2009-07-09 08:53:53
1,102,645
12
2009-07-09 08:53:53
2,988
2009-07-09 08:53:53
https://stackoverflow.com/q/1101934
https://stackoverflow.com/a/1102645
<p>That's not a directory, that's a submodule. Or at least GitHub seems to think so.</p> <p>What does your <code>.gitmodules</code> file look like? Did you maybe forget to run <code>git submodule init</code> and <code>git submodule update</code>?</p> <p>Submodules can be a little bit tricky, especially when you conve...
<p>That's not a directory, that's a submodule. Or at least GitHub seems to think so.</p> <p>What does your <code>.gitmodules</code> file look like? Did you maybe forget to run <code>git submodule init</code> and <code>git submodule update</code>?</p> <p>Submodules can be a little bit tricky, especially when you conve...
119
git
<h1>Why does git keep deleting my folder?</h1> <p>I have a folder in my repository called 'activity'. It keeps getting strangely deleted from the repository, and isn't seen as an untracked file.</p> <p>In github, it is rendered as a folder with a green arrow, and the text '→ f32111b' next to it. This has happened seve...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,295
git
# Why does git keep deleting my folder? I have a folder in my repository called 'activity'. It keeps getting strangely deleted from the repository, and isn't seen as an untracked file. In github, it is rendered as a folder with a green arrow, and the text '→ f32111b' next to it. This has happened several times now, a...
That's not a directory, that's a submodule. Or at least GitHub seems to think so. What does your `.gitmodules` file look like? Did you maybe forget to run `git submodule init` and `git submodule update`? Submodules can be a little bit tricky, especially when you convert from a directory to a submodule or back.
471896
When using git, how do you push the exact working directory to a remote?
6
2009-01-23 04:37:38
<p>I have a a remote git repo and a local clone. Let's say I lose my local .git directory and subsequently add and remove some files to the local working directory.</p> <p>At some point, I want to re-init the local repo, connect it to the remote, and ultimately push my local working dir to the remote exactly as it is ...
5,694
32,866
2009-01-23 19:04:06
474,067
12
2009-01-23 19:04:06
19,563
2009-01-23 19:04:06
https://stackoverflow.com/q/471896
https://stackoverflow.com/a/474067
<p>Something like this (assuming you are starting from the lost .git moment)?</p> <pre><code># Make the current directory a git repository. # This puts you on a master branch with no commits. git init # Add a reference to the remote repository. git remote add origin urlurlurl # Fetch the remote refs. git fetch # Wi...
<p>Something like this (assuming you are starting from the lost .git moment)?</p> <pre><code># Make the current directory a git repository. # This puts you on a master branch with no commits. git init # Add a reference to the remote repository. git remote add origin urlurlurl # Fetch the remote refs. git fetch # Wi...
119
git
<h1>When using git, how do you push the exact working directory to a remote?</h1> <p>I have a a remote git repo and a local clone. Let's say I lose my local .git directory and subsequently add and remove some files to the local working directory.</p> <p>At some point, I want to re-init the local repo, connect it to th...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,296
git
# When using git, how do you push the exact working directory to a remote? I have a a remote git repo and a local clone. Let's say I lose my local .git directory and subsequently add and remove some files to the local working directory. At some point, I want to re-init the local repo, connect it to the remote, and ul...
Something like this (assuming you are starting from the lost .git moment)? ``` # Make the current directory a git repository. # This puts you on a master branch with no commits. git init # Add a reference to the remote repository. git remote add origin urlurlurl # Fetch the remote refs. git fetch # Without touching...
17712468
What is the difference between 'git remote update', 'git fetch' and 'git pull'?
137
2013-07-18 00:16:33
<p>I'm starting to play with Git now and I'm a little bit confused. For me, looks like there are a lot of options to do the same thing. My question for now is what is the difference between the commands below:</p> <ul> <li>git remote update</li> <li>git fetch</li> <li>git pull</li> </ul> <p>Also which one is more app...
116,039
2,593,507
2024-09-08 12:05:18
78,908,960
11
2024-08-24 12:21:10
5,853,964
2024-08-24 14:59:44
https://stackoverflow.com/q/17712468
https://stackoverflow.com/a/78908960
<ul> <li><p><code>git fetch</code> and <code>git remote update</code> seem to be largely synonymous nowadays. Both are used to update remote tracking branches to a current snapshot of their counterpart on the remote.</p> <p>Without any remote or &quot;remote group&quot; specified (and without config caveats), <code>git...
<ul> <li><p><code>git fetch</code> and <code>git remote update</code> seem to be largely synonymous nowadays. Both are used to update remote tracking branches to a current snapshot of their counterpart on the remote.</p> <p>Without any remote or &quot;remote group&quot; specified (and without config caveats), <code>git...
119
git
<h1>What is the difference between 'git remote update', 'git fetch' and 'git pull'?</h1> <p>I'm starting to play with Git now and I'm a little bit confused. For me, looks like there are a lot of options to do the same thing. My question for now is what is the difference between the commands below:</p> <ul> <li>git rem...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,297
git
# What is the difference between 'git remote update', 'git fetch' and 'git pull'? I'm starting to play with Git now and I'm a little bit confused. For me, looks like there are a lot of options to do the same thing. My question for now is what is the difference between the commands below: - git remote update - git fet...
- `git fetch` and `git remote update` seem to be largely synonymous nowadays. Both are used to update remote tracking branches to a current snapshot of their counterpart on the remote. Without any remote or "remote group" specified (and without config caveats), `git remote update` defaults to behavior identical to `...
15006554
git: merge branch and use meaningful merge commit message?
63
2013-02-21 15:52:32
<p>After I merge a feature branch back to main branch I usually need to do a merge commit by default. But I'd like to use the original commit messages from my feature branch in this commit instead of "merge branch XXX". </p> <p>How should I do that?</p>
97,416
987,846
2026-01-15 11:47:56
15,030,847
11
2013-02-22 18:31:14
987,846
2026-01-15 09:36:58
https://stackoverflow.com/q/15006554
https://stackoverflow.com/a/15030847
<p>I found that after doing the merge commit I can add an amendment commit with <code>git ci --amend</code> to change the commit message, which does exactly what I asked for.</p> <p>I'll accept my own answer as the correct answer.</p> <p><a href="https://stackoverflow.com/a/15006856">Simon Boudrias</a> and <a href="htt...
<p>I found that after doing the merge commit I can add an amendment commit with <code>git ci --amend</code> to change the commit message, which does exactly what I asked for.</p> <p>I'll accept my own answer as the correct answer.</p> <p><a href="https://stackoverflow.com/a/15006856">Simon Boudrias</a> and <a href="htt...
119, 456, 53847
branching-and-merging, git, version-control
<h1>git: merge branch and use meaningful merge commit message?</h1> <p>After I merge a feature branch back to main branch I usually need to do a merge commit by default. But I'd like to use the original commit messages from my feature branch in this commit instead of "merge branch XXX". </p> <p>How should I do that?</...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,299
git
# git: merge branch and use meaningful merge commit message? After I merge a feature branch back to main branch I usually need to do a merge commit by default. But I'd like to use the original commit messages from my feature branch in this commit instead of "merge branch XXX". How should I do that?
I found that after doing the merge commit I can add an amendment commit with `git ci --amend` to change the commit message, which does exactly what I asked for. I'll accept my own answer as the correct answer. [Simon Boudrias](https://stackoverflow.com/a/15006856) and [ranendra](https://stackoverflow.com/a/15006886) ...
5363857
Delete all files and history from remote Git repo without deleting repo itself
60
2011-03-19 18:09:47
<p>I would appreciate it if someone could tell me how I could delete every single file/folder on my git repository without actually deleting the repository itself. I want to delete all history associated with those files as well.</p>
71,741
556,479
2021-09-10 14:30:42
5,363,971
11
2011-03-19 18:27:59
58,991
2011-03-19 18:27:59
https://stackoverflow.com/q/5363857
https://stackoverflow.com/a/5363971
<p>You can delete a branch from a repository remote like this</p> <pre><code>git push origin :branchname </code></pre> <p>if you've got any tags you can delete them like this:</p> <pre><code>git push origin :refs/tags/tagname </code></pre> <p>This is assuming you have a remote set up to github called origin</p> <p...
<p>You can delete a branch from a repository remote like this</p> <pre><code>git push origin :branchname </code></pre> <p>if you've got any tags you can delete them like this:</p> <pre><code>git push origin :refs/tags/tagname </code></pre> <p>This is assuming you have a remote set up to github called origin</p> <p...
119
git
<h1>Delete all files and history from remote Git repo without deleting repo itself</h1> <p>I would appreciate it if someone could tell me how I could delete every single file/folder on my git repository without actually deleting the repository itself. I want to delete all history associated with those files as well.</p...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,300
git
# Delete all files and history from remote Git repo without deleting repo itself I would appreciate it if someone could tell me how I could delete every single file/folder on my git repository without actually deleting the repository itself. I want to delete all history associated with those files as well.
You can delete a branch from a repository remote like this ``` git push origin :branchname ``` if you've got any tags you can delete them like this: ``` git push origin :refs/tags/tagname ``` This is assuming you have a remote set up to github called origin This will leave the local tags / branches on your compute...
33315856
Setting Visual Studio Code as my Mac's default editor (including editing Git commits)
56
2015-10-24 07:56:08
<p>I am trying to configure my Mac Book Pro (OSX El Capitan 10.11.1) to use Visual Studio Code as its default editor. I have created a <code>~/.bash_profile</code> file with the following two lines</p> <pre class="lang-bash prettyprint-override"><code>vscode () { VSCODE_CWD="$PWD" open -n -b "com.microsoft.VSCode" --a...
80,380
575,530
2023-11-10 21:10:25
35,782,566
11
2016-03-03 20:38:52
1,147,577
2016-03-03 20:38:52
https://stackoverflow.com/q/33315856
https://stackoverflow.com/a/35782566
<p>It's working with the latest version 0.10.9 of VS Code</p> <pre><code>[core] editor = '/Applications/Visual Studio Code.app/Contents/MacOS/Electron' -w </code></pre> <p>Test it with: git config --global --edit. remember to refresh the terminal after you have changed the config file.</p>
<p>It's working with the latest version 0.10.9 of VS Code</p> <pre><code>[core] editor = '/Applications/Visual Studio Code.app/Contents/MacOS/Electron' -w </code></pre> <p>Test it with: git config --global --edit. remember to refresh the terminal after you have changed the config file.</p>
119, 369, 111608
git, macos, visual-studio-code
<h1>Setting Visual Studio Code as my Mac's default editor (including editing Git commits)</h1> <p>I am trying to configure my Mac Book Pro (OSX El Capitan 10.11.1) to use Visual Studio Code as its default editor. I have created a <code>~/.bash_profile</code> file with the following two lines</p> <pre class="lang-bash ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,301
git
# Setting Visual Studio Code as my Mac's default editor (including editing Git commits) I am trying to configure my Mac Book Pro (OSX El Capitan 10.11.1) to use Visual Studio Code as its default editor. I have created a `~/.bash_profile` file with the following two lines ``` vscode () { VSCODE_CWD="$PWD" open -n -b "...
It's working with the latest version 0.10.9 of VS Code ``` [core] editor = '/Applications/Visual Studio Code.app/Contents/MacOS/Electron' -w ``` Test it with: git config --global --edit. remember to refresh the terminal after you have changed the config file.
25774895
Jenkins Git Plugin not pulling latest changes before building job
48
2014-09-10 20:53:18
<p>I am working with Jenkins CI and am trying to properly configure my jobs to use git.</p> <p>I have the git plugin installed and configured for one of my jobs. When I build the job, I expect it to pull the latest changes for the branch I specify and then continue with the rest of the build process (e.g., unit tests,...
91,724
4,020,834
2022-12-20 16:24:30
27,710,848
11
2014-12-30 18:46:40
3,416,320
2014-12-30 18:46:40
https://stackoverflow.com/q/25774895
https://stackoverflow.com/a/27710848
<p>I believe Jenkins pulls the changes and builds in it's own tmp directory. So, your repository directory isn't getting updated although Jenkins is properly building the new code in it's own sandbox.</p> <p>My solution to this has been to add a "git pull" step in my build process like so:</p> <p>When a new commit i...
<p>I believe Jenkins pulls the changes and builds in it's own tmp directory. So, your repository directory isn't getting updated although Jenkins is properly building the new code in it's own sandbox.</p> <p>My solution to this has been to add a "git pull" step in my build process like so:</p> <p>When a new commit i...
119, 965, 4860, 64999
git, jenkins, plugins, pull
<h1>Jenkins Git Plugin not pulling latest changes before building job</h1> <p>I am working with Jenkins CI and am trying to properly configure my jobs to use git.</p> <p>I have the git plugin installed and configured for one of my jobs. When I build the job, I expect it to pull the latest changes for the branch I spec...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,302
git
# Jenkins Git Plugin not pulling latest changes before building job I am working with Jenkins CI and am trying to properly configure my jobs to use git. I have the git plugin installed and configured for one of my jobs. When I build the job, I expect it to pull the latest changes for the branch I specify and then con...
I believe Jenkins pulls the changes and builds in it's own tmp directory. So, your repository directory isn't getting updated although Jenkins is properly building the new code in it's own sandbox. My solution to this has been to add a "git pull" step in my build process like so: When a new commit is delivered to my ...
27867775
How to cleanup garbage in remote git repo
43
2015-01-09 19:28:10
<p>I recently ran into a size limit with my Bitbucket repo. I followed the countless other questions answering how to clean up your git repo and ended up using BFG to remove some bad commits. </p> <p>This worked great, however, I noticed that after running a git count, there was a large amount of space sitting in garb...
24,597
301,816
2024-03-21 04:17:15
27,868,384
11
2015-01-09 20:08:03
301,816
2018-12-10 13:29:26
https://stackoverflow.com/q/27867775
https://stackoverflow.com/a/27868384
<p>If anyone else is experiencing this, the answer turned out to be yes. </p> <p>Bitbucket support ran the following:</p> <pre><code>git reflog expire --expire="1 hour" --all git reflog expire --expire-unreachable="1 hour" --all git prune --expire="1 hour" -v git gc --aggressive --prune="1 hour" </code></pre> <p>The...
<p>If anyone else is experiencing this, the answer turned out to be yes. </p> <p>Bitbucket support ran the following:</p> <pre><code>git reflog expire --expire="1 hour" --all git reflog expire --expire-unreachable="1 hour" --all git prune --expire="1 hour" -v git gc --aggressive --prune="1 hour" </code></pre> <p>The...
119, 8337
bitbucket, git
<h1>How to cleanup garbage in remote git repo</h1> <p>I recently ran into a size limit with my Bitbucket repo. I followed the countless other questions answering how to clean up your git repo and ended up using BFG to remove some bad commits. </p> <p>This worked great, however, I noticed that after running a git count...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,304
git
# How to cleanup garbage in remote git repo I recently ran into a size limit with my Bitbucket repo. I followed the countless other questions answering how to clean up your git repo and ended up using BFG to remove some bad commits. This worked great, however, I noticed that after running a git count, there was a lar...
If anyone else is experiencing this, the answer turned out to be yes. Bitbucket support ran the following: ``` git reflog expire --expire="1 hour" --all git reflog expire --expire-unreachable="1 hour" --all git prune --expire="1 hour" -v git gc --aggressive --prune="1 hour" ``` The before and after reduced the remot...
15112280
Git alias on current branch
42
2013-02-27 12:35:13
<p>I'd like to improve my current aliases, most of them work over a branch. Is there a way to refer to the current branch in a git alias so I don't need to pass it each time?</p> <p>like this one:</p> <pre><code>git config alias.po "push origin" </code></pre> <p>is use it like that:</p> <pre><code>git po foo_branch...
22,828
709,635
2024-07-29 15:05:40
15,112,401
11
2013-02-27 12:40:59
11,343
2013-02-27 12:57:18
https://stackoverflow.com/q/15112280
https://stackoverflow.com/a/15112401
<p><em>This answer will be valid starting from Git 2.0, where the default push behaviour will be <code>simple</code></em></p> <p>Unless <code>push.default</code> setting is set to <code>matching</code>, <code>git push</code> without specifying argument will always push the current branch, so in this case you don't nee...
<p><em>This answer will be valid starting from Git 2.0, where the default push behaviour will be <code>simple</code></em></p> <p>Unless <code>push.default</code> setting is set to <code>matching</code>, <code>git push</code> without specifying argument will always push the current branch, so in this case you don't nee...
119
git
<h1>Git alias on current branch</h1> <p>I'd like to improve my current aliases, most of them work over a branch. Is there a way to refer to the current branch in a git alias so I don't need to pass it each time?</p> <p>like this one:</p> <pre><code>git config alias.po "push origin" </code></pre> <p>is use it like th...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,305
git
# Git alias on current branch I'd like to improve my current aliases, most of them work over a branch. Is there a way to refer to the current branch in a git alias so I don't need to pass it each time? like this one: ``` git config alias.po "push origin" ``` is use it like that: ``` git po foo_branch ``` I'd like...
*This answer will be valid starting from Git 2.0, where the default push behaviour will be `simple`* Unless `push.default` setting is set to `matching`, `git push` without specifying argument will always push the current branch, so in this case you don't need to specify it.
7005142
Can I include other .gitignore file in a .gitignore file? (like #include in c-like languages)
40
2011-08-10 02:07:31
<p>I have some files like <code>vim.gitignore</code>, <code>SVN.gitignore</code> and <code>CVS.gitignore</code> (spread around on my hard disk).</p> <p>Can I simply include these gitignore files in a <code>.gitignore</code> file in a new Git project?</p> <p><strong>Edit</strong>: I have a global ignore file already.<...
19,043
631,613
2022-12-21 21:23:48
7,005,830
11
2011-08-10 04:14:06
6,309
2020-05-20 22:21:48
https://stackoverflow.com/q/7005142
https://stackoverflow.com/a/7005830
<p>You could:</p> <ul> <li>Have a template repo with: <ul> <li>those <code>xxx.gitignore</code> files in it: </li> <li>a <code>.gitignore</code> file with "<code>xxx-gitignore-xxx</code>" in it (in other word, with a <em>content</em> you can easily identify</li> <li>a <a href="https://stackoverflow.com/questions/2316...
<p>You could:</p> <ul> <li>Have a template repo with: <ul> <li>those <code>xxx.gitignore</code> files in it: </li> <li>a <code>.gitignore</code> file with "<code>xxx-gitignore-xxx</code>" in it (in other word, with a <em>content</em> you can easily identify</li> <li>a <a href="https://stackoverflow.com/questions/2316...
119, 25056
git, gitignore
<h1>Can I include other .gitignore file in a .gitignore file? (like #include in c-like languages)</h1> <p>I have some files like <code>vim.gitignore</code>, <code>SVN.gitignore</code> and <code>CVS.gitignore</code> (spread around on my hard disk).</p> <p>Can I simply include these gitignore files in a <code>.gitignore...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,306
git
# Can I include other .gitignore file in a .gitignore file? (like #include in c-like languages) I have some files like `vim.gitignore`, `SVN.gitignore` and `CVS.gitignore` (spread around on my hard disk). Can I simply include these gitignore files in a `.gitignore` file in a new Git project? **Edit**: I have a globa...
You could: - Have a template repo with: - those `xxx.gitignore` files in it: - a `.gitignore` file with "`xxx-gitignore-xxx`" in it (in other word, with a *content* you can easily identify - a [`.gitattribute` filter driver](https://stackoverflow.com/questions/2316677/can-git-automatically-switch-between-spaces-...
33429820
Is there a way to bypass post-merge git hook when executing `git merge` command
34
2015-10-30 06:16:55
<p>I have post-merge hook configured in order to integrate (semi-manually) with another version control system. However sometimes I would like to avoid the the hook from running is there some way to bypass it for <code>git merge</code>?</p> <p>I knew there is <code>--no-verify</code> command line parameter for <code>g...
32,271
2,219,266
2023-05-08 17:38:43
33,431,504
11
2015-10-30 08:23:09
1,256,452
2015-10-30 08:23:09
https://stackoverflow.com/q/33429820
https://stackoverflow.com/a/33431504
<p>There is no flag to disable running a post-merge hook, but you could easily rig your own post-merge hook (which you control completely, since it's in your own repository) to obey an environment variable. For instance, a shell script might start with:</p> <pre><code>#! /bin/sh warn() { echo "warning: $1" 1&gt;&...
<p>There is no flag to disable running a post-merge hook, but you could easily rig your own post-merge hook (which you control completely, since it's in your own repository) to obey an environment variable. For instance, a shell script might start with:</p> <pre><code>#! /bin/sh warn() { echo "warning: $1" 1&gt;&...
119, 717, 853, 43087
git, githooks, hook, merge
<h1>Is there a way to bypass post-merge git hook when executing `git merge` command</h1> <p>I have post-merge hook configured in order to integrate (semi-manually) with another version control system. However sometimes I would like to avoid the the hook from running is there some way to bypass it for <code>git merge</c...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,308
git
# Is there a way to bypass post-merge git hook when executing `git merge` command I have post-merge hook configured in order to integrate (semi-manually) with another version control system. However sometimes I would like to avoid the the hook from running is there some way to bypass it for `git merge`? I knew there ...
There is no flag to disable running a post-merge hook, but you could easily rig your own post-merge hook (which you control completely, since it's in your own repository) to obey an environment variable. For instance, a shell script might start with: ``` #! /bin/sh warn() { echo "warning: $1" 1>&2 } case ${SKIP_PO...
39412407
git-stash changes without reverting
32
2016-09-09 13:12:48
<p>I work on a project using Git. Every once in a while I find myself wanting to save my changes, without committing them, just as a backup, and then continue working. What I usually do is <code>git stash</code> and then immediately <code>git stash apply</code> to bring the code back to the same state as before stashin...
13,511
779,446
2025-09-04 21:46:03
55,437,320
11
2019-03-31 02:17:48
779,446
2019-04-02 10:28:37
https://stackoverflow.com/q/39412407
https://stackoverflow.com/a/55437320
<p>When I posted this question I was new to git and didn't understand its power in full. Now I realize that stashing is not what I needed and that git's local branches do the job much better.</p> <p>Assume you are on main_branch, which you want to keep clean from experimental changes.</p> <p>Simply create a new branc...
<p>When I posted this question I was new to git and didn't understand its power in full. Now I realize that stashing is not what I needed and that git's local branches do the job much better.</p> <p>Assume you are on main_branch, which you want to keep clean from experimental changes.</p> <p>Simply create a new branc...
119, 13091
git, git-stash
<h1>git-stash changes without reverting</h1> <p>I work on a project using Git. Every once in a while I find myself wanting to save my changes, without committing them, just as a backup, and then continue working. What I usually do is <code>git stash</code> and then immediately <code>git stash apply</code> to bring the ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,309
git
# git-stash changes without reverting I work on a project using Git. Every once in a while I find myself wanting to save my changes, without committing them, just as a backup, and then continue working. What I usually do is `git stash` and then immediately `git stash apply` to bring the code back to the same state as ...
When I posted this question I was new to git and didn't understand its power in full. Now I realize that stashing is not what I needed and that git's local branches do the job much better. Assume you are on main_branch, which you want to keep clean from experimental changes. Simply create a new branch in order to sto...
47562385
Is it possible to patch a submodule in Git from the parent project?
31
2017-11-29 21:46:25
<p>I have a project <code>main</code> that contains a submodule <code>foo</code>. For this particular project, I would like to make a small change to <code>foo</code> that only applies to this particular project <code>main</code>. </p> <pre><code>main/ + .git + main.c + lib/ | + bar.c + foo/ # My...
20,043
2,612,235
2019-09-18 00:32:33
47,566,736
11
2017-11-30 05:54:07
6,309
2017-11-30 12:43:35
https://stackoverflow.com/q/47562385
https://stackoverflow.com/a/47566736
<p>I would still go with the second option (have a real patch file on main), but adapt my build process to:</p> <ul> <li>make a copy of the <code>config.h</code> in the submodule</li> <li>apply the patch</li> <li>build</li> <li>restore <code>config.h</code> to its original content.</li> </ul> <p>That way, I keep the ...
<p>I would still go with the second option (have a real patch file on main), but adapt my build process to:</p> <ul> <li>make a copy of the <code>config.h</code> in the submodule</li> <li>apply the patch</li> <li>build</li> <li>restore <code>config.h</code> to its original content.</li> </ul> <p>That way, I keep the ...
119, 606, 2132, 5647, 41612
build, diff, git, git-submodules, patch
<h1>Is it possible to patch a submodule in Git from the parent project?</h1> <p>I have a project <code>main</code> that contains a submodule <code>foo</code>. For this particular project, I would like to make a small change to <code>foo</code> that only applies to this particular project <code>main</code>. </p> <pre><...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,310
git
# Is it possible to patch a submodule in Git from the parent project? I have a project `main` that contains a submodule `foo`. For this particular project, I would like to make a small change to `foo` that only applies to this particular project `main`. ``` main/ + .git + main.c + lib/ | + bar.c + foo/ ...
I would still go with the second option (have a real patch file on main), but adapt my build process to: - make a copy of the `config.h` in the submodule - apply the patch - build - restore `config.h` to its original content. That way, I keep the submodule status unchanged. The OP adds in the comments: > But your s...
8843131
git diff reporting mode changes after moving the repository
27
2012-01-12 22:15:12
<p>I moved a bunch of my git repositories to another OS by copying to an external hard drive. And now when I do <code>git diff</code> it reports all the files modes have changed.</p> <pre><code>diff --git a/.gitignore b/.gitignore old mode 100644 new mode 100755 diff --git a/.npmignore b/.npmignore old mode 100644 new...
7,392
157,629
2013-10-07 21:48:30
8,843,139
11
2012-01-12 22:16:18
116,908
2012-01-12 22:57:46
https://stackoverflow.com/q/8843131
https://stackoverflow.com/a/8843139
<p>Probably your external hard drive had a different filesystem on it that didn't respect the original file permissions. I'd just correct them by hand before committing.</p> <p>For example, FAT32, which is commonly used on USB thumb drives, doesn't support execute permissions. When you copy a file from a FAT32 files...
<p>Probably your external hard drive had a different filesystem on it that didn't respect the original file permissions. I'd just correct them by hand before committing.</p> <p>For example, FAT32, which is commonly used on USB thumb drives, doesn't support execute permissions. When you copy a file from a FAT32 files...
119
git
<h1>git diff reporting mode changes after moving the repository</h1> <p>I moved a bunch of my git repositories to another OS by copying to an external hard drive. And now when I do <code>git diff</code> it reports all the files modes have changed.</p> <pre><code>diff --git a/.gitignore b/.gitignore old mode 100644 new...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,314
git
# git diff reporting mode changes after moving the repository I moved a bunch of my git repositories to another OS by copying to an external hard drive. And now when I do `git diff` it reports all the files modes have changed. ``` diff --git a/.gitignore b/.gitignore old mode 100644 new mode 100755 diff --git a/.npmi...
Probably your external hard drive had a different filesystem on it that didn't respect the original file permissions. I'd just correct them by hand before committing. For example, FAT32, which is commonly used on USB thumb drives, doesn't support execute permissions. When you copy a file from a FAT32 filesystem to a n...
57479946
In bitbucket/git, what does "xx commits behind proto. Sync Now" do?
26
2019-08-13 14:30:45
<p>I've seen this message in bitbucket a couple times, for some feature branches that branched off from <code>proto</code>. </p> <p>If I click <code>Sync Now</code>, what does it do? </p> <p><a href="https://i.sstatic.net/tKIhD.png" rel="noreferrer"><img src="https://i.sstatic.net/tKIhD.png" alt="screeshot"></a></p>
15,555
3,703,783
2025-11-05 19:23:53
57,492,852
11
2019-08-14 10:25:11
6,309
2025-11-05 19:23:53
https://stackoverflow.com/q/57479946
https://stackoverflow.com/a/57492852
<blockquote> <p>so <code>Sync Now</code> would merge the all the new commits in <code>proto</code> into my current feature branch?</p> </blockquote> <p>It is the &quot;<code>Sync now</code>&quot; feature presented in this <a href="https://community.atlassian.com/t5/Bitbucket-questions/Where-is-the-fork-sync-feature/qaq...
<blockquote> <p>so <code>Sync Now</code> would merge the all the new commits in <code>proto</code> into my current feature branch?</p> </blockquote> <p>It is the &quot;<code>Sync now</code>&quot; feature presented in this <a href="https://community.atlassian.com/t5/Bitbucket-questions/Where-is-the-fork-sync-feature/qaq...
119, 8337
bitbucket, git
<h1>In bitbucket/git, what does "xx commits behind proto. Sync Now" do?</h1> <p>I've seen this message in bitbucket a couple times, for some feature branches that branched off from <code>proto</code>. </p> <p>If I click <code>Sync Now</code>, what does it do? </p> <p><a href="https://i.sstatic.net/tKIhD.png" rel="nor...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
23,315
git
# In bitbucket/git, what does "xx commits behind proto. Sync Now" do? I've seen this message in bitbucket a couple times, for some feature branches that branched off from `proto`. If I click `Sync Now`, what does it do? [![screeshot](https://i.sstatic.net/tKIhD.png)](https://i.sstatic.net/tKIhD.png)
> so `Sync Now` would merge the all the new commits in `proto` into my current feature branch? It is the "`Sync now`" feature presented in this [2018 thread](https://community.atlassian.com/t5/Bitbucket-questions/Where-is-the-fork-sync-feature/qaq-p/786862#U787679) (initially for SVN, and for complaining that feature ...