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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2899875 | Git add not working with .png files? | 14 | 2010-05-24 19:58:34 | <p>I have a dirty working tree, dirty because I made changes to source files and touched up some images. I was trying to add just the images to the index, so I ran this command:</p>
<pre><code>git add *.png
</code></pre>
<p>But, this doesn't add the files. There were a few <i>new</i> image files that were added, but ... | 29,464 | 291,736 | 2012-05-14 18:44:36 | 2,900,049 | 19 | 2010-05-24 20:21:39 | 119,963 | 2010-05-26 13:40:17 | https://stackoverflow.com/q/2899875 | https://stackoverflow.com/a/2900049 | <p>Michael Mrozek's comment is essentially the answer. <code>*.png</code> matches files of that name in the current directory, not in subdirectories. If you want to add ones in a subdirectory, do so:</p>
<pre><code>git add src/main/resources/icons/*.png
</code></pre>
<p>Or, depending on your shell, you may be able to... | <p>Michael Mrozek's comment is essentially the answer. <code>*.png</code> matches files of that name in the current directory, not in subdirectories. If you want to add ones in a subdirectory, do so:</p> <pre><code>git add src/main/resources/icons/*.png </code></pre> <p>Or, depending on your shell, you may be able to... | 119 | git | <h1>Git add not working with .png files?</h1>
<p>I have a dirty working tree, dirty because I made changes to source files and touched up some images. I was trying to add just the images to the index, so I ran this command:</p>
<pre><code>git add *.png
</code></pre>
<p>But, this doesn't add the files. There were a fe... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,813 | git | # Git add not working with .png files?
I have a dirty working tree, dirty because I made changes to source files and touched up some images. I was trying to add just the images to the index, so I ran this command:
```
git add *.png
```
But, this doesn't add the files. There were a few *new* image files that were add... | Michael Mrozek's comment is essentially the answer. `*.png` matches files of that name in the current directory, not in subdirectories. If you want to add ones in a subdirectory, do so:
```
git add src/main/resources/icons/*.png
```
Or, depending on your shell, you may be able to do:
```
git add **/*.png
```
The po... |
34620655 | SVN-Git migration: clean-git branch error | 13 | 2016-01-05 20:29:19 | <p>I'm following the SVN to Git <a href="https://www.atlassian.com/git/tutorials/migrating-overview" rel="noreferrer">migration guide</a>, the <code>git svn clone</code> goes fine but when I run the cleanup command I get this error, I'm not even sure what this means. How do I solve this ?</p>
<pre><code>java -Dfile.en... | 3,299 | 126,978 | 2017-01-05 16:31:01 | 37,920,818 | 19 | 2016-06-20 11:00:25 | 3,118,209 | 2016-06-20 12:16:29 | https://stackoverflow.com/q/34620655 | https://stackoverflow.com/a/37920818 | <p>This problem comes up when you are not specifying the <code>--branches</code> while running the <code>git svn clone</code> command. You can avoid it by specifying the <code>--branches</code> while executing the <code>git svn clone</code> as follows:</p>
<pre><code>git svn clone --username=ArpitAggarwal --branches=/... | <p>This problem comes up when you are not specifying the <code>--branches</code> while running the <code>git svn clone</code> command. You can avoid it by specifying the <code>--branches</code> while executing the <code>git svn clone</code> as follows:</p> <pre><code>git svn clone --username=ArpitAggarwal --branches=/... | 63, 119, 456, 6452 | git, git-svn, svn, version-control | <h1>SVN-Git migration: clean-git branch error</h1>
<p>I'm following the SVN to Git <a href="https://www.atlassian.com/git/tutorials/migrating-overview" rel="noreferrer">migration guide</a>, the <code>git svn clone</code> goes fine but when I run the cleanup command I get this error, I'm not even sure what this means. H... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,817 | git | # SVN-Git migration: clean-git branch error
I'm following the SVN to Git [migration guide](https://www.atlassian.com/git/tutorials/migrating-overview), the `git svn clone` goes fine but when I run the cleanup command I get this error, I'm not even sure what this means. How do I solve this ?
```
java -Dfile.encoding=u... | This problem comes up when you are not specifying the `--branches` while running the `git svn clone` command. You can avoid it by specifying the `--branches` while executing the `git svn clone` as follows:
```
git svn clone --username=ArpitAggarwal --branches=/dev --authors-file=C:/Users/ArpitAggarwal/authors.txt http... |
15535486 | I deleted the known_hosts file from .ssh folder and I can't pull or push in BitBucket repositories | 13 | 2013-03-20 21:52:37 | <p>I made a mistake and deleted the "known_hosts" file in ".ssh" folder! Now I can't pull or push in BitBucket repositories.</p>
<p>How can I solve it?</p>
| 31,133 | 575,643 | 2017-06-16 16:34:19 | 15,535,861 | 19 | 2013-03-20 22:17:27 | 380,757 | 2017-06-16 16:34:19 | https://stackoverflow.com/q/15535486 | https://stackoverflow.com/a/15535861 | <p>Try executing:</p>
<pre><code>ssh -T git@bitbucket.org
</code></pre>
<p>It would give you a message somethign like:</p>
<pre><code>The authenticity of host 'bitbucket.org (207.223.240.181)' can't be established.
RSA key fingerprint is 97:8c:1b:f2:6f:14:6b:5c:3b:ec:aa:46:46:74:7c:40.
Are you sure you want to conti... | <p>Try executing:</p> <pre><code>ssh -T git@bitbucket.org </code></pre> <p>It would give you a message somethign like:</p> <pre><code>The authenticity of host 'bitbucket.org (207.223.240.181)' can't be established. RSA key fingerprint is 97:8c:1b:f2:6f:14:6b:5c:3b:ec:aa:46:46:74:7c:40. Are you sure you want to conti... | 119, 386, 5350, 8337 | bitbucket, git, key, ssh | <h1>I deleted the known_hosts file from .ssh folder and I can't pull or push in BitBucket repositories</h1>
<p>I made a mistake and deleted the "known_hosts" file in ".ssh" folder! Now I can't pull or push in BitBucket repositories.</p>
<p>How can I solve it?</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,819 | git | # I deleted the known_hosts file from .ssh folder and I can't pull or push in BitBucket repositories
I made a mistake and deleted the "known_hosts" file in ".ssh" folder! Now I can't pull or push in BitBucket repositories.
How can I solve it? | Try executing:
```
ssh -T git@bitbucket.org
```
It would give you a message somethign like:
```
The authenticity of host 'bitbucket.org (207.223.240.181)' can't be established.
RSA key fingerprint is 97:8c:1b:f2:6f:14:6b:5c:3b:ec:aa:46:46:74:7c:40.
Are you sure you want to continue connecting (yes/no)? yes
```
Say ... |
9089878 | How to re-apply commits on top of unrelated branch? | 13 | 2012-02-01 02:20:52 | <p>I have a simple repository with linear history of commits, like:</p>
<pre><code>[A] -> [B] -> [C] -> [D] -> [E] ...
</code></pre>
<p>I basically need to remove commits A and B so I thought I'd create a new repository and would like to achieve something like:</p>
<pre><code>[X] -> [C] -> [D] ->... | 5,958 | 21,728 | 2015-12-27 04:40:50 | 9,091,843 | 19 | 2012-02-01 06:40:22 | 1,036,728 | 2015-12-27 04:40:50 | https://stackoverflow.com/q/9089878 | https://stackoverflow.com/a/9091843 | <p>Not sure why you need the commit date to stay the same but here goes:</p>
<pre><code>git rebase B E --onto X --committer-date-is-author-date
</code></pre>
<p>If <code>B..E</code> aren't in the same repository as <code>X</code> (as they can be <a href="http://book.git-scm.com/5_creating_new_empty_branches.html" rel... | <p>Not sure why you need the commit date to stay the same but here goes:</p> <pre><code>git rebase B E --onto X --committer-date-is-author-date </code></pre> <p>If <code>B..E</code> aren't in the same repository as <code>X</code> (as they can be <a href="http://book.git-scm.com/5_creating_new_empty_branches.html" rel... | 119 | git | <h1>How to re-apply commits on top of unrelated branch?</h1>
<p>I have a simple repository with linear history of commits, like:</p>
<pre><code>[A] -> [B] -> [C] -> [D] -> [E] ...
</code></pre>
<p>I basically need to remove commits A and B so I thought I'd create a new repository and would like to achieve... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,820 | git | # How to re-apply commits on top of unrelated branch?
I have a simple repository with linear history of commits, like:
```
[A] -> [B] -> [C] -> [D] -> [E] ...
```
I basically need to remove commits A and B so I thought I'd create a new repository and would like to achieve something like:
```
[X] -> [C] -> [D] -> [E... | Not sure why you need the commit date to stay the same but here goes:
```
git rebase B E --onto X --committer-date-is-author-date
```
If `B..E` aren't in the same repository as `X` (as they can be [if you create your *fresh start* in-place](http://book.git-scm.com/5_creating_new_empty_branches.html)), you'll need to ... |
8115044 | hg-git push silently fails | 13 | 2011-11-13 21:53:46 | <p>I'm trying to use <code>hg push</code> to a git repository, but it silently fails. I found <a href="http://groups.google.com/group/hg-git/browse_thread/thread/8ec99bad0fc59c6c" rel="noreferrer">a single post on the mailing list</a> and <a href="https://github.com/schacon/hg-git/issues/211" rel="noreferrer">a regist... | 3,113 | 380,587 | 2011-12-20 00:46:01 | 8,569,502 | 19 | 2011-12-20 00:46:01 | 380,587 | 2011-12-20 00:46:01 | https://stackoverflow.com/q/8115044 | https://stackoverflow.com/a/8569502 | <p>There are two issues here: push should explicitly fail, and hg-git should report it (but it doesn't).</p>
<p>Pushing should fail, giving <code>"abort: git remote error: refs/heads/master failed to update" when pushing to local clone</code>, because it's a push to a non-bare repository (see <a href="http://www.bitfl... | <p>There are two issues here: push should explicitly fail, and hg-git should report it (but it doesn't).</p> <p>Pushing should fail, giving <code>"abort: git remote error: refs/heads/master failed to update" when pushing to local clone</code>, because it's a push to a non-bare repository (see <a href="http://www.bitfl... | 119, 802, 51230 | git, hg-git, mercurial | <h1>hg-git push silently fails</h1>
<p>I'm trying to use <code>hg push</code> to a git repository, but it silently fails. I found <a href="http://groups.google.com/group/hg-git/browse_thread/thread/8ec99bad0fc59c6c" rel="noreferrer">a single post on the mailing list</a> and <a href="https://github.com/schacon/hg-git/i... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,821 | git | # hg-git push silently fails
I'm trying to use `hg push` to a git repository, but it silently fails. I found [a single post on the mailing list](http://groups.google.com/group/hg-git/browse_thread/thread/8ec99bad0fc59c6c) and [a registered hg-git issue](https://github.com/schacon/hg-git/issues/211), but both are about... | There are two issues here: push should explicitly fail, and hg-git should report it (but it doesn't).
Pushing should fail, giving `"abort: git remote error: refs/heads/master failed to update" when pushing to local clone`, because it's a push to a non-bare repository (see [more on that from a mercurial user's perspect... |
6621874 | git alias with optional parameter | 13 | 2011-07-08 08:28:24 | <p>I want to ensure that my latest commit has the current date before I push. Since I always rebase to master before a merge + push, I made this alias:</p>
<pre><code>[alias]
sync = !git commit --amend --date=today && git rebase master
</code></pre>
<p>Problem is, it keeps launching my text editor asking ... | 4,970 | 834,971 | 2011-07-09 05:44:40 | 6,632,770 | 19 | 2011-07-09 04:41:56 | 193,688 | 2011-07-09 05:44:40 | https://stackoverflow.com/q/6621874 | https://stackoverflow.com/a/6632770 | <p>To apply the extra parameters to anything except the end of your alias’ “command line”, you will need to put your shell commands in a script. You can do it with an external script (like <a href="https://stackoverflow.com/questions/6621874/git-alias-with-optional-parameter/6621952#6621952">jdelStrother’s answer</a>),... | <p>To apply the extra parameters to anything except the end of your alias’ “command line”, you will need to put your shell commands in a script. You can do it with an external script (like <a href="https://stackoverflow.com/questions/6621874/git-alias-with-optional-parameter/6621952#6621952">jdelStrother’s answer</a>),... | 119, 360, 1448 | alias, git, parameters | <h1>git alias with optional parameter</h1>
<p>I want to ensure that my latest commit has the current date before I push. Since I always rebase to master before a merge + push, I made this alias:</p>
<pre><code>[alias]
sync = !git commit --amend --date=today && git rebase master
</code></pre>
<p>Problem is... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,822 | git | # git alias with optional parameter
I want to ensure that my latest commit has the current date before I push. Since I always rebase to master before a merge + push, I made this alias:
```
[alias]
sync = !git commit --amend --date=today && git rebase master
```
Problem is, it keeps launching my text editor askin... | To apply the extra parameters to anything except the end of your alias’ “command line”, you will need to put your shell commands in a script. You can do it with an external script (like [jdelStrother’s answer](https://stackoverflow.com/questions/6621874/git-alias-with-optional-parameter/6621952#6621952)), or you can do... |
6262192 | How to handle a bunch of deleted files under Git? | 13 | 2011-06-07 07:54:50 | <p>I have deleted about 20 files from my project. How to commit them with one command instead of <code>git rm <filename></code> them one by one? </p>
| 3,895 | 740,018 | 2016-08-01 21:58:37 | 6,262,356 | 19 | 2011-06-07 08:10:54 | 279,627 | 2011-06-07 08:10:54 | https://stackoverflow.com/q/6262192 | https://stackoverflow.com/a/6262356 | <p>If you don't want to commit all other changes in your working directory at the same time (as <code>git add -A</code> would do), you can use</p>
<pre><code>git rm $(git ls-files --deleted)
</code></pre>
| <p>If you don't want to commit all other changes in your working directory at the same time (as <code>git add -A</code> would do), you can use</p> <pre><code>git rm $(git ls-files --deleted) </code></pre> | 119 | git | <h1>How to handle a bunch of deleted files under Git?</h1>
<p>I have deleted about 20 files from my project. How to commit them with one command instead of <code>git rm <filename></code> them one by one? </p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,823 | git | # How to handle a bunch of deleted files under Git?
I have deleted about 20 files from my project. How to commit them with one command instead of `git rm <filename>` them one by one? | If you don't want to commit all other changes in your working directory at the same time (as `git add -A` would do), you can use
```
git rm $(git ls-files --deleted)
``` |
61568292 | Do git tags persist after a branch is deleted? | 12 | 2020-05-03 00:50:19 | <p>If I have a tag on a specific commit that is part of a branch (no other branch has this commit), and I delete that branch, will the tag persist forever (as long as I don't delete the tag)?</p>
<pre><code>*-*-*---* (master)
\--x---* (foo)
</code></pre>
<p>A tag <code>foobar</code> points to the commit represented ... | 4,801 | 6,872,717 | 2024-05-22 12:41:25 | 61,568,351 | 19 | 2020-05-03 00:59:18 | 341,994 | 2020-05-03 01:04:24 | https://stackoverflow.com/q/61568292 | https://stackoverflow.com/a/61568351 | <p>Yes. A tag is a name for a commit. Names keep commits alive and make them reachable. As long as you don’t delete the tag, the commit (and all commits preceding it in its history) will live forever. So a user of this repo can checkout the tag. As for your particular code, <code>git clone --branch foobar</code> will w... | <p>Yes. A tag is a name for a commit. Names keep commits alive and make them reachable. As long as you don’t delete the tag, the commit (and all commits preceding it in its history) will live forever. So a user of this repo can checkout the tag. As for your particular code, <code>git clone --branch foobar</code> will w... | 119 | git | <h1>Do git tags persist after a branch is deleted?</h1>
<p>If I have a tag on a specific commit that is part of a branch (no other branch has this commit), and I delete that branch, will the tag persist forever (as long as I don't delete the tag)?</p>
<pre><code>*-*-*---* (master)
\--x---* (foo)
</code></pre>
<p>A t... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,827 | git | # Do git tags persist after a branch is deleted?
If I have a tag on a specific commit that is part of a branch (no other branch has this commit), and I delete that branch, will the tag persist forever (as long as I don't delete the tag)?
```
*-*-*---* (master)
\--x---* (foo)
```
A tag `foobar` points to the commi... | Yes. A tag is a name for a commit. Names keep commits alive and make them reachable. As long as you don’t delete the tag, the commit (and all commits preceding it in its history) will live forever. So a user of this repo can checkout the tag. As for your particular code, `git clone --branch foobar` will work with a tag... |
55591923 | How to create a git branch of a branch within Rstudio to work on individual functions seperately | 12 | 2019-04-09 11:35:12 | <p>I am pretty new to git but have got as far as getting my development and master branches working fine and merging etc.</p>
<p>I often have separate functions that I work on independently and in parallel so I dont want to merge the development branch (which may have several unfinished functions on it) into the maste... | 8,274 | 3,632,206 | 2019-04-09 12:24:57 | 55,592,824 | 19 | 2019-04-09 12:24:57 | 8,386,140 | 2019-04-09 12:24:57 | https://stackoverflow.com/q/55591923 | https://stackoverflow.com/a/55592824 | <p>You have two questions:</p>
<ol>
<li>"For each function should I create a separate branch that is a branch of the development branch... or should I simply create a new branch for each function that merges directly into master?"</li>
<li>"[H]ow do I do this branch of a branch in RStudio?"</li>
</ol>
<p>The first qu... | <p>You have two questions:</p> <ol> <li>"For each function should I create a separate branch that is a branch of the development branch... or should I simply create a new branch for each function that merges directly into master?"</li> <li>"[H]ow do I do this branch of a branch in RStudio?"</li> </ol> <p>The first qu... | 119, 4452, 67746 | git, r, rstudio | <h1>How to create a git branch of a branch within Rstudio to work on individual functions seperately</h1>
<p>I am pretty new to git but have got as far as getting my development and master branches working fine and merging etc.</p>
<p>I often have separate functions that I work on independently and in parallel so I do... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,828 | git | # How to create a git branch of a branch within Rstudio to work on individual functions seperately
I am pretty new to git but have got as far as getting my development and master branches working fine and merging etc.
I often have separate functions that I work on independently and in parallel so I dont want to merge... | You have two questions:
1. "For each function should I create a separate branch that is a branch of the development branch... or should I simply create a new branch for each function that merges directly into master?"
2. "[H]ow do I do this branch of a branch in RStudio?"
The first question is a matter of opinion. Th... |
53693889 | What is legacy-stash? | 12 | 2018-12-09 15:37:18 | <p>Today I ran git stash -h on my Windows box to get this response:</p>
<pre><code>usage: git legacy-stash list [<options>]
or: git legacy-stash show [<stash>]
or: git legacy-stash drop [-q|--quiet] [<stash>]
or: git legacy-stash ( pop | apply ) [--index] [-q|--quiet] [<stash>]
or: ... | 1,390 | 80,002 | 2018-12-09 16:28:26 | 53,694,333 | 19 | 2018-12-09 16:28:26 | 8,705,432 | 2018-12-09 16:28:26 | https://stackoverflow.com/q/53693889 | https://stackoverflow.com/a/53694333 | <p>There is ongoing work to port the <code>git stash</code> and <code>git rebase</code> programs to be built-ins written in C. They are faster on all systems, but this work is especially valuable for Windows because the programs written in shell are much slower there than on Unix. However, we're still finding a small n... | <p>There is ongoing work to port the <code>git stash</code> and <code>git rebase</code> programs to be built-ins written in C. They are faster on all systems, but this work is especially valuable for Windows because the programs written in shell are much slower there than on Unix. However, we're still finding a small n... | 64, 119, 13091 | git, git-stash, windows | <h1>What is legacy-stash?</h1>
<p>Today I ran git stash -h on my Windows box to get this response:</p>
<pre><code>usage: git legacy-stash list [<options>]
or: git legacy-stash show [<stash>]
or: git legacy-stash drop [-q|--quiet] [<stash>]
or: git legacy-stash ( pop | apply ) [--index] [-q|-... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,829 | git | # What is legacy-stash?
Today I ran git stash -h on my Windows box to get this response:
```
usage: git legacy-stash list [<options>]
or: git legacy-stash show [<stash>]
or: git legacy-stash drop [-q|--quiet] [<stash>]
or: git legacy-stash ( pop | apply ) [--index] [-q|--quiet] [<stash>]
or: git legacy-st... | There is ongoing work to port the `git stash` and `git rebase` programs to be built-ins written in C. They are faster on all systems, but this work is especially valuable for Windows because the programs written in shell are much slower there than on Unix. However, we're still finding a small number of bugs and issues ... |
53107027 | How to get a list of different commits between two git branches? | 12 | 2018-11-01 18:13:24 | <p>I want to see a list of only non-common commits between two branches.</p>
<h1>How can I get output like this?</h1>
<p>Basically a <code>git diff -y master new-feature</code> summary between two branches:</p>
<pre><code> master new-feature
-----------------------------------... | 16,934 | 151,312 | 2022-03-29 23:04:16 | 53,107,520 | 19 | 2018-11-01 18:47:53 | 3,606,400 | 2018-11-01 18:47:53 | https://stackoverflow.com/q/53107027 | https://stackoverflow.com/a/53107520 | <p>Here is a basic variant without fancy formatting:</p>
<p><code>git log master..new-feature</code></p>
<p>You can get "left side" or "right side" data by swapping the order of the branches:</p>
<p><code>git log left-side-branch..right-side-branch</code></p>
<p>This works with other refs (commit hashes, remote bra... | <p>Here is a basic variant without fancy formatting:</p> <p><code>git log master..new-feature</code></p> <p>You can get "left side" or "right side" data by swapping the order of the branches:</p> <p><code>git log left-side-branch..right-side-branch</code></p> <p>This works with other refs (commit hashes, remote bra... | 119, 606, 9033, 47913 | diff, git, git-diff, git-log | <h1>How to get a list of different commits between two git branches?</h1>
<p>I want to see a list of only non-common commits between two branches.</p>
<h1>How can I get output like this?</h1>
<p>Basically a <code>git diff -y master new-feature</code> summary between two branches:</p>
<pre><code> master ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,830 | git | # How to get a list of different commits between two git branches?
I want to see a list of only non-common commits between two branches.
# How can I get output like this?
Basically a `git diff -y master new-feature` summary between two branches:
```
master new-feature
---... | Here is a basic variant without fancy formatting:
`git log master..new-feature`
You can get "left side" or "right side" data by swapping the order of the branches:
`git log left-side-branch..right-side-branch`
This works with other refs (commit hashes, remote branches, tags) too.
To get the full date formatting yo... |
46205090 | May I list the files of the current commit? | 12 | 2017-09-13 19:04:49 | <p>Imagine that everytime I commit files, before I push them, I'd like to list them to check. How may I do that ? </p>
<p>I tried: </p>
<pre><code>git ls-tree -r --name-only master
git ls-files -stage
</code></pre>
<p>If I edit a single file, <code>add</code> then <code>commit</code> it. If I try the above codes, ... | 21,120 | 1,617,912 | 2017-09-13 20:17:59 | 46,205,186 | 19 | 2017-09-13 19:11:27 | 8,533,154 | 2017-09-13 19:48:49 | https://stackoverflow.com/q/46205090 | https://stackoverflow.com/a/46205186 | <p>Git diff to the rescue on this one. You'll use the <code>--name-only</code> flag. To get the contents of the current commit, use this command:</p>
<pre><code>#before stage
git diff --name-only
#staged changes before committing
git diff --name-only --cached
#after committing
git diff --name-only HEAD^ HEAD
</... | <p>Git diff to the rescue on this one. You'll use the <code>--name-only</code> flag. To get the contents of the current commit, use this command:</p> <pre><code>#before stage git diff --name-only #staged changes before committing git diff --name-only --cached #after committing git diff --name-only HEAD^ HEAD </... | 119, 53850 | git, git-commit | <h1>May I list the files of the current commit?</h1>
<p>Imagine that everytime I commit files, before I push them, I'd like to list them to check. How may I do that ? </p>
<p>I tried: </p>
<pre><code>git ls-tree -r --name-only master
git ls-files -stage
</code></pre>
<p>If I edit a single file, <code>add</code> th... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,831 | git | # May I list the files of the current commit?
Imagine that everytime I commit files, before I push them, I'd like to list them to check. How may I do that ?
I tried:
```
git ls-tree -r --name-only master
git ls-files -stage
```
If I edit a single file, `add` then `commit` it. If I try the above codes, it shows me a... | Git diff to the rescue on this one. You'll use the `--name-only` flag. To get the contents of the current commit, use this command:
```
#before stage
git diff --name-only
#staged changes before committing
git diff --name-only --cached
#after committing
git diff --name-only HEAD^ HEAD
```
If you want to see the... |
32910842 | Remove committer information from git commits | 12 | 2015-10-02 15:38:55 | <p>I have rebased a branch and now all its commits have committer section which I would like to remove completely (not just changing it's fields). Is it possible without losing the original author info?</p>
| 4,712 | 179,581 | 2018-05-29 13:32:21 | 32,944,640 | 19 | 2015-10-05 08:56:14 | 179,581 | 2015-10-05 09:14:17 | https://stackoverflow.com/q/32910842 | https://stackoverflow.com/a/32944640 | <p>Thanks to <strong>@sergej</strong> and <strong>GitHub</strong>, I got committer info removed with</p>
<pre><code>git filter-branch --env-filter '
if [ "$GIT_COMMITTER_EMAIL" != "$GIT_AUTHOR_EMAIL" ]; then
export GIT_COMMITTER_NAME="$GIT_AUTHOR_NAME"
export GIT_COMMITTER_EMAIL="$GIT_AUTHOR_EMAIL"
export GIT_CO... | <p>Thanks to <strong>@sergej</strong> and <strong>GitHub</strong>, I got committer info removed with</p> <pre><code>git filter-branch --env-filter ' if [ "$GIT_COMMITTER_EMAIL" != "$GIT_AUTHOR_EMAIL" ]; then export GIT_COMMITTER_NAME="$GIT_AUTHOR_NAME" export GIT_COMMITTER_EMAIL="$GIT_AUTHOR_EMAIL" export GIT_CO... | 119, 5597, 8974, 46509 | commit, git, git-filter-branch, rebase | <h1>Remove committer information from git commits</h1>
<p>I have rebased a branch and now all its commits have committer section which I would like to remove completely (not just changing it's fields). Is it possible without losing the original author info?</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,834 | git | # Remove committer information from git commits
I have rebased a branch and now all its commits have committer section which I would like to remove completely (not just changing it's fields). Is it possible without losing the original author info? | Thanks to **@sergej** and **GitHub**, I got committer info removed with
```
git filter-branch --env-filter '
if [ "$GIT_COMMITTER_EMAIL" != "$GIT_AUTHOR_EMAIL" ]; then
export GIT_COMMITTER_NAME="$GIT_AUTHOR_NAME"
export GIT_COMMITTER_EMAIL="$GIT_AUTHOR_EMAIL"
export GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE"
fi
' --t... |
31050548 | Git checkout HEAD+1 and HEAD-1 | 12 | 2015-06-25 12:34:01 | <p>In this situation: </p>
<pre><code> v HEAD
o--o--o--x--o--o (foo)
/
o--o--o--o--o--o--o (master)
</code></pre>
<p>If I want to move one step backward I type:</p>
<pre><code>$ git checkout HEAD~1
v HEAD
o--o--o--x--o--o (foo)
/
o--o--o--o--o--o--o (master)
</code></pre>... | 28,096 | 2,612,235 | 2015-06-25 12:55:02 | 31,050,667 | 19 | 2015-06-25 12:38:20 | 724,411 | 2015-06-25 12:38:20 | https://stackoverflow.com/q/31050548 | https://stackoverflow.com/a/31050667 | <p>Git commits have pointers back to their parents, which is why you can go backwards. They do not have pointers to their children, so you cannot "go forwards," as you are trying to do. The best you can do is look at the <code>git log</code> and determine the hash of the commit you want to checkout. </p>
| <p>Git commits have pointers back to their parents, which is why you can go backwards. They do not have pointers to their children, so you cannot "go forwards," as you are trying to do. The best you can do is look at the <code>git log</code> and determine the hash of the commit you want to checkout. </p> | 119 | git | <h1>Git checkout HEAD+1 and HEAD-1</h1>
<p>In this situation: </p>
<pre><code> v HEAD
o--o--o--x--o--o (foo)
/
o--o--o--o--o--o--o (master)
</code></pre>
<p>If I want to move one step backward I type:</p>
<pre><code>$ git checkout HEAD~1
v HEAD
o--o--o--x--o--o (foo)
/
o-... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,836 | git | # Git checkout HEAD+1 and HEAD-1
In this situation:
```
v HEAD
o--o--o--x--o--o (foo)
/
o--o--o--o--o--o--o (master)
```
If I want to move one step backward I type:
```
$ git checkout HEAD~1
v HEAD
o--o--o--x--o--o (foo)
/
o--o--o--o--o--o--o (master)
```
If I want to ... | Git commits have pointers back to their parents, which is why you can go backwards. They do not have pointers to their children, so you cannot "go forwards," as you are trying to do. The best you can do is look at the `git log` and determine the hash of the commit you want to checkout. |
15729491 | Makefile $(command) not working but `command` did | 12 | 2013-03-31 12:44:49 | <p>The thing is when I was writing a Makefile for my project, when I needed to detect the current branch name, in a make rule I did this : </p>
<pre><code>check_branch:
if [ "$(git rev-parse --abbrev-ref HEAD)" == "master" ]; then \
echo "In master"
else \
echo "Not in master"; \
fi
</code></pre>
... | 7,415 | 875,850 | 2013-03-31 13:10:36 | 15,729,690 | 19 | 2013-03-31 13:10:36 | 545,027 | 2013-03-31 13:10:36 | https://stackoverflow.com/q/15729491 | https://stackoverflow.com/a/15729690 | <p>Inside recipes you have to escape dollar signs in order to get them interpreted by the shell. Otherwise, Make treats <code>$(git ...)</code> as a built-in command or a variable and tries to evaluate it (of course, unsuccessfully).</p>
<pre>
check_branch:
if [ "<b>$$</b>(git rev-parse --abbrev-ref HEAD)" == "mas... | <p>Inside recipes you have to escape dollar signs in order to get them interpreted by the shell. Otherwise, Make treats <code>$(git ...)</code> as a built-in command or a variable and tries to evaluate it (of course, unsuccessfully).</p> <pre> check_branch: if [ "<b>$$</b>(git rev-parse --abbrev-ref HEAD)" == "mas... | 119, 4301, 28438 | backticks, git, makefile | <h1>Makefile $(command) not working but `command` did</h1>
<p>The thing is when I was writing a Makefile for my project, when I needed to detect the current branch name, in a make rule I did this : </p>
<pre><code>check_branch:
if [ "$(git rev-parse --abbrev-ref HEAD)" == "master" ]; then \
echo "In master"
... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,839 | git | # Makefile $(command) not working but `command` did
The thing is when I was writing a Makefile for my project, when I needed to detect the current branch name, in a make rule I did this :
```
check_branch:
if [ "$(git rev-parse --abbrev-ref HEAD)" == "master" ]; then \
echo "In master"
else \
echo "No... | Inside recipes you have to escape dollar signs in order to get them interpreted by the shell. Otherwise, Make treats `$(git ...)` as a built-in command or a variable and tries to evaluate it (of course, unsuccessfully).
```
check_branch:
if [ "$$(git rev-parse --abbrev-ref HEAD)" == "master" ]; then \
...
``` |
13786781 | What does "git remote add" exactly do? | 12 | 2012-12-09 10:52:16 | <p>I've recently been introduced to git in a project I've started working on, which encouraged me to start reading the online version of "Pro Git" by Scott Chacon.</p>
<p>There is a section in the book which briefly touches the subject of adding a "remote repository". Since Git is a distributed SCM, I understand that ... | 9,790 | 200,886 | 2012-12-09 11:03:20 | 13,786,813 | 19 | 2012-12-09 10:57:56 | 6,309 | 2012-12-09 11:03:20 | https://stackoverflow.com/q/13786781 | https://stackoverflow.com/a/13786813 | <p>You can add as many upstream repo address you want with <code>git remote add</code> (from "<a href="http://git-scm.com/book/en/Git-Basics-Working-with-Remotes" rel="noreferrer">Git Basics - Working with Remotes</a>").</p>
<p>When cloning, one is added for you, named '<code>origin</code>'.</p>
<blockquote>
<p>Doe... | <p>You can add as many upstream repo address you want with <code>git remote add</code> (from "<a href="http://git-scm.com/book/en/Git-Basics-Working-with-Remotes" rel="noreferrer">Git Basics - Working with Remotes</a>").</p> <p>When cloning, one is added for you, named '<code>origin</code>'.</p> <blockquote> <p>Doe... | 119, 456 | git, version-control | <h1>What does "git remote add" exactly do?</h1>
<p>I've recently been introduced to git in a project I've started working on, which encouraged me to start reading the online version of "Pro Git" by Scott Chacon.</p>
<p>There is a section in the book which briefly touches the subject of adding a "remote repository". Si... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,840 | git | # What does "git remote add" exactly do?
I've recently been introduced to git in a project I've started working on, which encouraged me to start reading the online version of "Pro Git" by Scott Chacon.
There is a section in the book which briefly touches the subject of adding a "remote repository". Since Git is a dis... | You can add as many upstream repo address you want with `git remote add` (from "[Git Basics - Working with Remotes](http://git-scm.com/book/en/Git-Basics-Working-with-Remotes)").
When cloning, one is added for you, named '`origin`'.
> Does it mean that the same project (commons-lang) could be hosted on multiple serve... |
12040934 | Get specific files from a GIT remote branch | 12 | 2012-08-20 15:48:35 | <p>Is it possible to pull from a remote repository but only selectively take files from that remote that I'm interested in? I don't want to simply pull down the entire branch.</p>
<p>Thanks.</p>
| 19,007 | 165,659 | 2012-08-20 15:57:26 | 12,041,061 | 19 | 2012-08-20 15:57:26 | 877,115 | 2012-08-20 15:57:26 | https://stackoverflow.com/q/12040934 | https://stackoverflow.com/a/12041061 | <p>A "remote branch" is nothing more than a commit pointer and the affiliated pack data. Just <code>git fetch <remote></code> and then if you want to view diffs between files on the remote and your local, you can do so with:</p>
<pre><code>git diff <local_branch> <remote>/<remote_branch> -- <... | <p>A "remote branch" is nothing more than a commit pointer and the affiliated pack data. Just <code>git fetch <remote></code> and then if you want to view diffs between files on the remote and your local, you can do so with:</p> <pre><code>git diff <local_branch> <remote>/<remote_branch> -- <... | 119 | git | <h1>Get specific files from a GIT remote branch</h1>
<p>Is it possible to pull from a remote repository but only selectively take files from that remote that I'm interested in? I don't want to simply pull down the entire branch.</p>
<p>Thanks.</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,841 | git | # Get specific files from a GIT remote branch
Is it possible to pull from a remote repository but only selectively take files from that remote that I'm interested in? I don't want to simply pull down the entire branch.
Thanks. | A "remote branch" is nothing more than a commit pointer and the affiliated pack data. Just `git fetch <remote>` and then if you want to view diffs between files on the remote and your local, you can do so with:
```
git diff <local_branch> <remote>/<remote_branch> -- <file>
```
This would in many cases be, for example... |
9969914 | How do you use the Ubuntu command line to pull a project that's been uploaded onto Git? | 12 | 2012-04-02 01:25:08 | <p>I (think) I've set up Git correctly. How do I pull my friend's project that he's shared with me so that I can help him with it?</p>
| 50,825 | 1,011,920 | 2017-06-15 13:10:47 | 9,969,946 | 19 | 2012-04-02 01:31:23 | 480,943 | 2014-08-02 00:43:31 | https://stackoverflow.com/q/9969914 | https://stackoverflow.com/a/9969946 | <p>By "uploaded onto Git" I assume you mean "uploaded onto GitHub". That's an important distinction: Git is a source control system. GitHub is a place to host repositories that are controlled via git.</p>
<p>To clone a repository that is hosted on GitHub, first log into your github account and go to the main page (<a ... | <p>By "uploaded onto Git" I assume you mean "uploaded onto GitHub". That's an important distinction: Git is a source control system. GitHub is a place to host repositories that are controlled via git.</p> <p>To clone a repository that is hosted on GitHub, first log into your github account and go to the main page (<a ... | 119, 549, 1231 | command-line, git, ubuntu | <h1>How do you use the Ubuntu command line to pull a project that's been uploaded onto Git?</h1>
<p>I (think) I've set up Git correctly. How do I pull my friend's project that he's shared with me so that I can help him with it?</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,842 | git | # How do you use the Ubuntu command line to pull a project that's been uploaded onto Git?
I (think) I've set up Git correctly. How do I pull my friend's project that he's shared with me so that I can help him with it? | By "uploaded onto Git" I assume you mean "uploaded onto GitHub". That's an important distinction: Git is a source control system. GitHub is a place to host repositories that are controlled via git.
To clone a repository that is hosted on GitHub, first log into your github account and go to the main page (<https://gith... |
9015741 | Git: retrieve specific commit | 12 | 2012-01-26 08:57:25 | <p>I need to export to an archive a set of commits in a git repository.
How do I do this?
Using svn, I could choose commits and export to zip.</p>
| 11,116 | 1,170,896 | 2013-04-15 12:43:20 | 9,015,789 | 19 | 2012-01-26 09:01:25 | 413,735 | 2013-04-15 12:43:20 | https://stackoverflow.com/q/9015741 | https://stackoverflow.com/a/9015789 | <p>To export the repository up to a certain commit:</p>
<p><code>git archive -o export.zip <COMMIT></code>. Replace <code><COMMIT></code> with the commit number you want to export.</p>
<p>To create a patch between two commits:</p>
<p><code>git diff COMMIT1 COMMIT2 > patch.txt</code></p>
| <p>To export the repository up to a certain commit:</p> <p><code>git archive -o export.zip <COMMIT></code>. Replace <code><COMMIT></code> with the commit number you want to export.</p> <p>To create a patch between two commits:</p> <p><code>git diff COMMIT1 COMMIT2 > patch.txt</code></p> | 119, 4167, 5597 | commit, export, git | <h1>Git: retrieve specific commit</h1>
<p>I need to export to an archive a set of commits in a git repository.
How do I do this?
Using svn, I could choose commits and export to zip.</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,844 | git | # Git: retrieve specific commit
I need to export to an archive a set of commits in a git repository.
How do I do this?
Using svn, I could choose commits and export to zip. | To export the repository up to a certain commit:
`git archive -o export.zip <COMMIT>`. Replace `<COMMIT>` with the commit number you want to export.
To create a patch between two commits:
`git diff COMMIT1 COMMIT2 > patch.txt` |
8716594 | How can I un-do a git commit AFTER a git push? | 12 | 2012-01-03 17:58:50 | <p>From here <a href="http://blog.prabir.me/post/Undo-in-Git.aspx" rel="noreferrer">http://blog.prabir.me/post/Undo-in-Git.aspx</a>, it said </p>
<pre><code>This undo’s your commit and also resets your working tree to the last commit.
1 git reset --hard HEAD^
</code></pre>
<p>But how can I un-do my last commit AFTER... | 39,175 | 286,802 | 2024-06-05 12:48:34 | 8,716,640 | 19 | 2012-01-03 18:02:58 | 201,270 | 2012-01-03 19:09:31 | https://stackoverflow.com/q/8716594 | https://stackoverflow.com/a/8716640 | <p>you can use <code>git revert HEAD</code>, which generates a new commit, which will undo the changes in your previous commit. Look <a href="http://gitready.com/intermediate/2009/03/16/rolling-back-changes-with-revert.html" rel="noreferrer">here</a>. Note however that both the commit and the revert commit will show up... | <p>you can use <code>git revert HEAD</code>, which generates a new commit, which will undo the changes in your previous commit. Look <a href="http://gitready.com/intermediate/2009/03/16/rolling-back-changes-with-revert.html" rel="noreferrer">here</a>. Note however that both the commit and the revert commit will show up... | 119 | git | <h1>How can I un-do a git commit AFTER a git push?</h1>
<p>From here <a href="http://blog.prabir.me/post/Undo-in-Git.aspx" rel="noreferrer">http://blog.prabir.me/post/Undo-in-Git.aspx</a>, it said </p>
<pre><code>This undo’s your commit and also resets your working tree to the last commit.
1 git reset --hard HEAD^
</... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,845 | git | # How can I un-do a git commit AFTER a git push?
From here <http://blog.prabir.me/post/Undo-in-Git.aspx>, it said
```
This undo’s your commit and also resets your working tree to the last commit.
1 git reset --hard HEAD^
```
But how can I un-do my last commit AFTER I did a 'git push'?
Thank you.
When I do 'git lo... | you can use `git revert HEAD`, which generates a new commit, which will undo the changes in your previous commit. Look [here](http://gitready.com/intermediate/2009/03/16/rolling-back-changes-with-revert.html). Note however that both the commit and the revert commit will show up in the history.
Edit: As KingChrunch men... |
2989825 | Migrating from Subversion to Git how can I find a commit given a revision number? | 12 | 2010-06-07 13:17:33 | <p>Migrating from Subversion to Git using svn2git (which internally uses git-svn) I'd like to know how I can find a specific revision commit.</p>
<p>It is quite common to have issues tracker to have comments like:
"Fixed in r12345".</p>
<p>Given this, I'd like to be able, for example, to extract the diff correspondin... | 2,790 | 201,453 | 2010-06-08 11:24:53 | 2,989,941 | 19 | 2010-06-07 13:33:48 | 4,161 | 2010-06-08 11:24:53 | https://stackoverflow.com/q/2989825 | https://stackoverflow.com/a/2989941 | <p>Given the revision number, you can find the Git SHA with</p>
<pre><code>git svn find-rev r1938
</code></pre>
<p>I don't know if there's a "one-shot" way to get the commit or anything, but you can write something like</p>
<pre><code>git log -p `git svn find-rev r1938`
</code></pre>
<hr>
<p>Update: note that you ... | <p>Given the revision number, you can find the Git SHA with</p> <pre><code>git svn find-rev r1938 </code></pre> <p>I don't know if there's a "one-shot" way to get the commit or anything, but you can write something like</p> <pre><code>git log -p `git svn find-rev r1938` </code></pre> <hr> <p>Update: note that you ... | 63, 97, 119, 6452 | git, git-svn, migration, svn | <h1>Migrating from Subversion to Git how can I find a commit given a revision number?</h1>
<p>Migrating from Subversion to Git using svn2git (which internally uses git-svn) I'd like to know how I can find a specific revision commit.</p>
<p>It is quite common to have issues tracker to have comments like:
"Fixed in r123... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,846 | git | # Migrating from Subversion to Git how can I find a commit given a revision number?
Migrating from Subversion to Git using svn2git (which internally uses git-svn) I'd like to know how I can find a specific revision commit.
It is quite common to have issues tracker to have comments like:
"Fixed in r12345".
Given this... | Given the revision number, you can find the Git SHA with
```
git svn find-rev r1938
```
I don't know if there's a "one-shot" way to get the commit or anything, but you can write something like
```
git log -p `git svn find-rev r1938`
```
---
Update: note that you can also grab the commit message with
```
git svn l... |
2915000 | How can I git archive an arbitrary branch? | 12 | 2010-05-26 16:42:04 | <pre><code>git checkout master
git archive stage | tar -czf archive.tar.gz htdocs
# archives master because it's checked out.
</code></pre>
<p>How can I archives the stage branch, regardless of the current I'm on?</p>
| 12,378 | 112,377 | 2010-05-27 06:10:18 | 2,915,074 | 19 | 2010-05-26 16:52:38 | 19,563 | 2010-05-27 06:10:18 | https://stackoverflow.com/q/2915000 | https://stackoverflow.com/a/2915074 | <p>git archive creates a tar archive so you don't need to pipe its output tar, indeed it's not doing what you expect. You are creating an tar archive of the stage branch and piping it to a normal tar command which doesn't use its standard input but just creates its own archive of <code>htdocs</code> in the working tree... | <p>git archive creates a tar archive so you don't need to pipe its output tar, indeed it's not doing what you expect. You are creating an tar archive of the stage branch and piping it to a normal tar command which doesn't use its standard input but just creates its own archive of <code>htdocs</code> in the working tree... | 119 | git | <h1>How can I git archive an arbitrary branch?</h1>
<pre><code>git checkout master
git archive stage | tar -czf archive.tar.gz htdocs
# archives master because it's checked out.
</code></pre>
<p>How can I archives the stage branch, regardless of the current I'm on?</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,847 | git | # How can I git archive an arbitrary branch?
```
git checkout master
git archive stage | tar -czf archive.tar.gz htdocs
# archives master because it's checked out.
```
How can I archives the stage branch, regardless of the current I'm on? | git archive creates a tar archive so you don't need to pipe its output tar, indeed it's not doing what you expect. You are creating an tar archive of the stage branch and piping it to a normal tar command which doesn't use its standard input but just creates its own archive of `htdocs` in the working tree, independentl... |
69091601 | git branch displays my branch names in a VIM window, instead of in my current iterm2 window | 11 | 2021-09-07 16:19:46 | <p>Not sure why this is happening.</p>
<p>I use iterm2, and have .zshrc bash</p>
<p>When I run <code>git branch</code></p>
<p>It displays my branches "in a new window" is there a way to fix this?</p>
<p><a href="https://i.sstatic.net/Zqi18.png" rel="noreferrer"><img src="https://i.sstatic.net/Zqi18.png" alt="... | 3,394 | 168,738 | 2021-09-22 16:35:54 | 69,108,857 | 19 | 2021-09-08 19:44:55 | 1,256,452 | 2021-09-08 19:44:55 | https://stackoverflow.com/q/69091601 | https://stackoverflow.com/a/69108857 | <p>This is not actually a <em>new</em> window, and it is not vim either: it is <code>less</code>, which is the default pager on a lot of systems including yours. The <code>git branch</code> command uses the pager by default now (as of Git 2.16); see in particular <a href="https://stackoverflow.com/a/48370253/1256452">... | <p>This is not actually a <em>new</em> window, and it is not vim either: it is <code>less</code>, which is the default pager on a lot of systems including yours. The <code>git branch</code> command uses the pager by default now (as of Git 2.16); see in particular <a href="https://stackoverflow.com/a/48370253/1256452">... | 119, 76220 | git, git-branch | <h1>git branch displays my branch names in a VIM window, instead of in my current iterm2 window</h1>
<p>Not sure why this is happening.</p>
<p>I use iterm2, and have .zshrc bash</p>
<p>When I run <code>git branch</code></p>
<p>It displays my branches "in a new window" is there a way to fix this?</p>
<p><a hre... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,848 | git | # git branch displays my branch names in a VIM window, instead of in my current iterm2 window
Not sure why this is happening.
I use iterm2, and have .zshrc bash
When I run `git branch`
It displays my branches "in a new window" is there a way to fix this?
[; see in particular [this answer](https://stackoverflow.com/a/48370253/1256452) to [Git branch command behav... |
55949329 | git merge: how did I get a conflict in BASE file? | 11 | 2019-05-02 09:23:02 | <p>I have the following in the BASE file of a <code>git merge</code>:</p>
<pre><code><<<<<<<<< Temporary merge branch 1
- _modifiedTimeWeak = 4.25.2019::11:41:6;
- _lastID = 3;
- weakCGTime = 4.25.2019::11:42:20;
- strongCGTime = 1.2.1990::0:0:0;
=========
- _modifiedTime... | 2,339 | 4,022,608 | 2025-04-22 09:05:20 | 55,957,650 | 19 | 2019-05-02 17:41:27 | 1,256,452 | 2019-05-03 01:45:04 | https://stackoverflow.com/q/55949329 | https://stackoverflow.com/a/55957650 | <h3>Jargon answer</h3>
<p>These occur when there are multiple merge bases <em>and</em> merging the merge bases produces a merge conflict. The merge base candidates are the LCAs of the commits you choose to merge, in the subgraph induced by the commits:</p>
<blockquote>
<p>DEFINITION 3.1. Let <em>G = (V; E)</em> be... | <h3>Jargon answer</h3> <p>These occur when there are multiple merge bases <em>and</em> merging the merge bases produces a merge conflict. The merge base candidates are the LCAs of the commits you choose to merge, in the subgraph induced by the commits:</p> <blockquote> <p>DEFINITION 3.1. Let <em>G = (V; E)</em> be... | 119, 717 | git, merge | <h1>git merge: how did I get a conflict in BASE file?</h1>
<p>I have the following in the BASE file of a <code>git merge</code>:</p>
<pre><code><<<<<<<<< Temporary merge branch 1
- _modifiedTimeWeak = 4.25.2019::11:41:6;
- _lastID = 3;
- weakCGTime = 4.25.2019::11:42:20;
- st... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,850 | git | # git merge: how did I get a conflict in BASE file?
I have the following in the BASE file of a `git merge`:
```
<<<<<<<<< Temporary merge branch 1
- _modifiedTimeWeak = 4.25.2019::11:41:6;
- _lastID = 3;
- weakCGTime = 4.25.2019::11:42:20;
- strongCGTime = 1.2.1990::0:0:0;
=========
- _modifiedTim... | ### Jargon answer
These occur when there are multiple merge bases *and* merging the merge bases produces a merge conflict. The merge base candidates are the LCAs of the commits you choose to merge, in the subgraph induced by the commits:
> DEFINITION 3.1. Let *G = (V; E)* be a DAG, and let *x; y* ∈ *V*. Let *Gx; y* b... |
48854585 | Error with run "npm run eject". Error 'Remove untracked files, stash or commit any changes, and try again.' | 11 | 2018-02-18 17:31:34 | <p>I have try lot's of things to solve this error.</p>
<p>Command:'npm run eject'</p>
<pre><code>Remove untracked files, stash or commit any changes, and try again.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! devportalfrontend@0.1.0 eject: `react-scripts eject`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed ... | 20,457 | 8,231,270 | 2022-03-30 18:43:32 | 48,868,985 | 19 | 2018-02-19 15:10:19 | 8,231,270 | 2018-02-19 15:10:19 | https://stackoverflow.com/q/48854585 | https://stackoverflow.com/a/48868985 | <p>I have tried this command it's worked:</p>
<pre><code>git add .
git commit -am "Save before ejecting"
</code></pre>
<p>and then try again.</p>
| <p>I have tried this command it's worked:</p> <pre><code>git add . git commit -am "Save before ejecting" </code></pre> <p>and then try again.</p> | 119, 61387, 92497, 115613 | git, npm, npm-install, reactjs | <h1>Error with run "npm run eject". Error 'Remove untracked files, stash or commit any changes, and try again.'</h1>
<p>I have try lot's of things to solve this error.</p>
<p>Command:'npm run eject'</p>
<pre><code>Remove untracked files, stash or commit any changes, and try again.
npm ERR! code ELIFECYCLE
npm ERR! er... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,851 | git | # Error with run "npm run eject". Error 'Remove untracked files, stash or commit any changes, and try again.'
I have try lot's of things to solve this error.
Command:'npm run eject'
```
Remove untracked files, stash or commit any changes, and try again.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! devportalfro... | I have tried this command it's worked:
```
git add .
git commit -am "Save before ejecting"
```
and then try again. |
48301920 | What types of binary files does Git keep deltas for? | 11 | 2018-01-17 13:06:55 | <p>We're dealing with a very large project that needs to be migrated to Git. Unfortunately, it contains a large number of binaries as well, some of which are zip-s, dll-s and so on. At the moment, it's not possible to remove these binaries from the version control system.</p>
<p>I would like to find out more about how... | 4,944 | 774,183 | 2025-02-23 16:55:04 | 48,305,739 | 19 | 2018-01-17 16:27:56 | 1,256,452 | 2025-02-23 16:55:04 | https://stackoverflow.com/q/48301920 | https://stackoverflow.com/a/48305739 | <p>First, let's get a bit of terminology out of the way. Files are stored as <em>blob objects</em>. These are one of four object types, the other three being <em>commit</em>, <em>tree</em>, and <em>annotated tag</em>.</p>
<p>Git's model is that <em>all</em> objects are logically independent. Everything is stored by ... | <p>First, let's get a bit of terminology out of the way. Files are stored as <em>blob objects</em>. These are one of four object types, the other three being <em>commit</em>, <em>tree</em>, and <em>annotated tag</em>.</p> <p>Git's model is that <em>all</em> objects are logically independent. Everything is stored by ... | 119, 115244 | git, git-lfs | <h1>What types of binary files does Git keep deltas for?</h1>
<p>We're dealing with a very large project that needs to be migrated to Git. Unfortunately, it contains a large number of binaries as well, some of which are zip-s, dll-s and so on. At the moment, it's not possible to remove these binaries from the version c... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,852 | git | # What types of binary files does Git keep deltas for?
We're dealing with a very large project that needs to be migrated to Git. Unfortunately, it contains a large number of binaries as well, some of which are zip-s, dll-s and so on. At the moment, it's not possible to remove these binaries from the version control sy... | First, let's get a bit of terminology out of the way. Files are stored as *blob objects*. These are one of four object types, the other three being *commit*, *tree*, and *annotated tag*.
Git's model is that *all* objects are logically independent. Everything is stored by its hash ID key, in a database. To retrieve any... |
46603239 | git push --mirror gives "failed to push some refs" | 11 | 2017-10-06 10:04:14 | <p>I am trying to create a script that can mirror my git repository to another repository. Everything goes fine, but it it keeps saying </p>
<pre><code>[remote rejected] refs/pull/xx/head -> refs/pull/xx/head (The current action can only be performed by the system.)
</code></pre>
<p>The repository is cloned to a f... | 14,481 | 3,752,353 | 2018-10-22 06:02:27 | 46,608,826 | 19 | 2017-10-06 15:10:12 | 1,256,452 | 2017-10-06 15:10:12 | https://stackoverflow.com/q/46603239 | https://stackoverflow.com/a/46608826 | <p>When you run <code>git push</code>, you have your Git call up another Git over the Internet-phone. Your Git hands their Git some objects (commits and the like), and then sends their Git a pile of requests:</p>
<ul>
<li>please set <code>refs/heads/branch</code> to point to commit <code>1234567...</code></li>
<li>pl... | <p>When you run <code>git push</code>, you have your Git call up another Git over the Internet-phone. Your Git hands their Git some objects (commits and the like), and then sends their Git a pile of requests:</p> <ul> <li>please set <code>refs/heads/branch</code> to point to commit <code>1234567...</code></li> <li>pl... | 119 | git | <h1>git push --mirror gives "failed to push some refs"</h1>
<p>I am trying to create a script that can mirror my git repository to another repository. Everything goes fine, but it it keeps saying </p>
<pre><code>[remote rejected] refs/pull/xx/head -> refs/pull/xx/head (The current action can only be performed by th... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,853 | git | # git push --mirror gives "failed to push some refs"
I am trying to create a script that can mirror my git repository to another repository. Everything goes fine, but it it keeps saying
```
[remote rejected] refs/pull/xx/head -> refs/pull/xx/head (The current action can only be performed by the system.)
```
The repo... | When you run `git push`, you have your Git call up another Git over the Internet-phone. Your Git hands their Git some objects (commits and the like), and then sends their Git a pile of requests:
- please set `refs/heads/branch` to point to commit `1234567...`
- please set `refs/tags/v1.2` to point to annotated tag obj... |
38985239 | VSCode how to add keyboard shortcut for staging selected lines | 11 | 2016-08-16 22:06:46 | <p>There is a <code>Stage Selected Lines</code> button for Git, but is there a way to add a keyboard shortcut for it?</p>
<p><a href="https://i.sstatic.net/B5f8x.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/B5f8x.png" alt="stage selected lines option" /></a></p>
<p>It is too much trouble having to cli... | 5,356 | 5,784,322 | 2021-10-02 17:20:57 | 46,069,010 | 19 | 2017-09-06 07:13:48 | 6,279,949 | 2021-10-02 17:17:43 | https://stackoverflow.com/q/38985239 | https://stackoverflow.com/a/46069010 | <p>In case anyone is still looking for this:</p>
<p>The commands <code>stageSelectedRanges</code>, <code>unstageSelectedRanges</code>, <code>revertSelectedRanges</code> have been introduced a while ago. Note that there is currently a <a href="https://github.com/Microsoft/vscode/issues/26642" rel="nofollow noreferrer">r... | <p>In case anyone is still looking for this:</p> <p>The commands <code>stageSelectedRanges</code>, <code>unstageSelectedRanges</code>, <code>revertSelectedRanges</code> have been introduced a while ago. Note that there is currently a <a href="https://github.com/Microsoft/vscode/issues/26642" rel="nofollow noreferrer">r... | 119, 74978, 111608 | git, git-stage, visual-studio-code | <h1>VSCode how to add keyboard shortcut for staging selected lines</h1>
<p>There is a <code>Stage Selected Lines</code> button for Git, but is there a way to add a keyboard shortcut for it?</p>
<p><a href="https://i.sstatic.net/B5f8x.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/B5f8x.png" alt="stage s... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,854 | git | # VSCode how to add keyboard shortcut for staging selected lines
There is a `Stage Selected Lines` button for Git, but is there a way to add a keyboard shortcut for it?
[](https://i.sstatic.net/B5f8x.png)
It is too much trouble having to click twice (`th... | In case anyone is still looking for this:
The commands `stageSelectedRanges`, `unstageSelectedRanges`, `revertSelectedRanges` have been introduced a while ago. Note that there is currently a [related bug](https://github.com/Microsoft/vscode/issues/26642) in VSCode: the diff view does not refresh after a partial stage ... |
44318543 | How to git tag all submodules? | 11 | 2017-06-01 23:23:02 | <p>I would like to tag all of the submodules of my project. I tried to do that with:</p>
<pre><code>git submodule foreach git tag tagName
</code></pre>
<p>... but it appears to just return with no errors, having done nothing.</p>
<p>Edit: Here are the results of my attempt:</p>
<p><a href="https://i.sstatic.net/1d... | 14,466 | 2,183,021 | 2024-06-11 15:12:32 | 44,320,966 | 19 | 2017-06-02 04:46:00 | 6,309 | 2024-06-11 15:12:32 | https://stackoverflow.com/q/44318543 | https://stackoverflow.com/a/44320966 | <p>First, make sure your submodule folder has a content:</p>
<pre><code>git submodule update --init --recursive
</code></pre>
<p>Then, simply do:</p>
<pre><code> git submodule foreach git tag -l
</code></pre>
<p>You should see, for each submodule, <code>tagName</code>.<br />
Meaning your previous command did indeed tag... | <p>First, make sure your submodule folder has a content:</p> <pre><code>git submodule update --init --recursive </code></pre> <p>Then, simply do:</p> <pre><code> git submodule foreach git tag -l </code></pre> <p>You should see, for each submodule, <code>tagName</code>.<br /> Meaning your previous command did indeed tag... | 119, 41612, 60718 | git, git-submodules, git-tag | <h1>How to git tag all submodules?</h1>
<p>I would like to tag all of the submodules of my project. I tried to do that with:</p>
<pre><code>git submodule foreach git tag tagName
</code></pre>
<p>... but it appears to just return with no errors, having done nothing.</p>
<p>Edit: Here are the results of my attempt:</... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,855 | git | # How to git tag all submodules?
I would like to tag all of the submodules of my project. I tried to do that with:
```
git submodule foreach git tag tagName
```
... but it appears to just return with no errors, having done nothing.
Edit: Here are the results of my attempt:
[ where the `Icon?` gitignore rule also matches directories such as `icons/`. The solution is to write the rule with the correct control character (which is a carriage return) at the end. [This question](https://superuser.com/qu... |
19498404 | Setting up Xamarin Studio Version Control with TFS + git | 11 | 2013-10-21 15:17:55 | <p>I am setting up <strong>Xamarin</strong> with <strong>Team Foundation Service + git</strong> to develop iOS apps. I have tried many different settings trying to set up my TFS + git integration on our MAC with no avail. I keep getting exceptions of either <code>not authorized</code> or <code>failed to fetch</code>. <... | 13,108 | 1,385,264 | 2017-04-17 14:30:40 | 19,498,405 | 19 | 2013-10-21 15:17:55 | 1,385,264 | 2017-04-17 14:30:40 | https://stackoverflow.com/q/19498404 | https://stackoverflow.com/a/19498405 | <p>I am going to list all steps I took to be as complete as possible. </p>
<ol>
<li>First of all, I created a hosted TFS account and added a <code>New Team Project + Git</code></li>
<li>I then had to create alternative login credentials since you cannot have an <code>@</code> symbol in your login info.
To set up ... | <p>I am going to list all steps I took to be as complete as possible. </p> <ol> <li>First of all, I created a hosted TFS account and added a <code>New Team Project + Git</code></li> <li>I then had to create alternative login credentials since you cannot have an <code>@</code> symbol in your login info. To set up ... | 119, 733, 89066, 116537 | azure-devops, git, tfs, xamarin-studio | <h1>Setting up Xamarin Studio Version Control with TFS + git</h1>
<p>I am setting up <strong>Xamarin</strong> with <strong>Team Foundation Service + git</strong> to develop iOS apps. I have tried many different settings trying to set up my TFS + git integration on our MAC with no avail. I keep getting exceptions of eit... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,860 | git | # Setting up Xamarin Studio Version Control with TFS + git
I am setting up **Xamarin** with **Team Foundation Service + git** to develop iOS apps. I have tried many different settings trying to set up my TFS + git integration on our MAC with no avail. I keep getting exceptions of either `not authorized` or `failed to ... | I am going to list all steps I took to be as complete as possible.
1. First of all, I created a hosted TFS account and added a `New Team Project + Git`
2. I then had to create alternative login credentials since you cannot have an `@` symbol in your login info.
To set up alternate creds in Visual Studio Team Servic... |
14420977 | How do I git pull -f | 11 | 2013-01-20 01:58:17 | <p>Where is</p>
<pre><code>git pull --force
</code></pre>
<p>as in <code>rm -rf</code> and then <code>git clone</code> again from scratch?</p>
<p>End result should be <code>git diff</code> returns nothing.</p>
| 7,913 | 300,224 | 2013-01-23 07:38:30 | 14,421,483 | 19 | 2013-01-20 03:43:55 | 1,451,820 | 2013-01-23 07:38:30 | https://stackoverflow.com/q/14420977 | https://stackoverflow.com/a/14421483 | <p>In addition to the other answers, I would also add a <code>git clean -fdx</code> to remove all untracked files and directories, to avoid potential issues with files being added in the remote repository, but also present in the current clone.</p>
<pre><code>git clean -fdx
git fetch
git reset --hard origin/master
</c... | <p>In addition to the other answers, I would also add a <code>git clean -fdx</code> to remove all untracked files and directories, to avoid potential issues with files being added in the remote repository, but also present in the current clone.</p> <pre><code>git clean -fdx git fetch git reset --hard origin/master </c... | 119 | git | <h1>How do I git pull -f</h1>
<p>Where is</p>
<pre><code>git pull --force
</code></pre>
<p>as in <code>rm -rf</code> and then <code>git clone</code> again from scratch?</p>
<p>End result should be <code>git diff</code> returns nothing.</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,862 | git | # How do I git pull -f
Where is
```
git pull --force
```
as in `rm -rf` and then `git clone` again from scratch?
End result should be `git diff` returns nothing. | In addition to the other answers, I would also add a `git clean -fdx` to remove all untracked files and directories, to avoid potential issues with files being added in the remote repository, but also present in the current clone.
```
git clean -fdx
git fetch
git reset --hard origin/master
``` |
11990090 | git pull based on SHA | 11 | 2012-08-16 15:01:26 | <p>I would like to know how to do a pull from repo based on a SHA?</p>
<pre><code>git pull origin master
</code></pre>
<p>the above code will pull master once we've done <code>git add remote</code>.</p>
| 40,234 | 1,471,938 | 2012-08-16 20:59:03 | 11,995,335 | 19 | 2012-08-16 20:59:03 | 1,604,346 | 2012-08-16 20:59:03 | https://stackoverflow.com/q/11990090 | https://stackoverflow.com/a/11995335 | <p>A git pull does two things for you:</p>
<ol>
<li>Fetches a specific branch from the repository</li>
<li>Merges it with your current branch.</li>
</ol>
<p>It sounds like what you want to do is to get a specific revision from the repository and merge it with your current branch.</p>
<p>The best way to do this is tw... | <p>A git pull does two things for you:</p> <ol> <li>Fetches a specific branch from the repository</li> <li>Merges it with your current branch.</li> </ol> <p>It sounds like what you want to do is to get a specific revision from the repository and merge it with your current branch.</p> <p>The best way to do this is tw... | 119 | git | <h1>git pull based on SHA</h1>
<p>I would like to know how to do a pull from repo based on a SHA?</p>
<pre><code>git pull origin master
</code></pre>
<p>the above code will pull master once we've done <code>git add remote</code>.</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,863 | git | # git pull based on SHA
I would like to know how to do a pull from repo based on a SHA?
```
git pull origin master
```
the above code will pull master once we've done `git add remote`. | A git pull does two things for you:
1. Fetches a specific branch from the repository
2. Merges it with your current branch.
It sounds like what you want to do is to get a specific revision from the repository and merge it with your current branch.
The best way to do this is two commands:
```
git fetch origin
git me... |
11054240 | Putting existing project under source control in Xcode 4.3.2 | 11 | 2012-06-15 15:57:07 | <p>I was looking for a way to put my existing project under source control, and I looked at <a href="https://stackoverflow.com/questions/5618686/how-to-add-a-new-project-to-source-control-in-xcode-4?rq=1">this question</a>, but it looks like that solution only worked with Xcode 4.0 because I can't find a way to do what... | 7,068 | 599,097 | 2014-08-15 20:27:33 | 11,056,426 | 19 | 2012-06-15 18:40:13 | 796,368 | 2012-06-15 18:40:13 | https://stackoverflow.com/q/11054240 | https://stackoverflow.com/a/11056426 | <p>you can do it in terminal using:</p>
<p>cd /to/app/folder</p>
<pre><code>git init
git add .
git commit -am 'a descriptor of your first commit'
</code></pre>
<p>This should then be picked up in Xcode, you may need to close and re-open</p>
<p>Hope it helps</p>
| <p>you can do it in terminal using:</p> <p>cd /to/app/folder</p> <pre><code>git init git add . git commit -am 'a descriptor of your first commit' </code></pre> <p>This should then be picked up in Xcode, you may need to close and re-open</p> <p>Hope it helps</p> | 119, 456, 908, 77527 | git, version-control, xcode, xcode4.3 | <h1>Putting existing project under source control in Xcode 4.3.2</h1>
<p>I was looking for a way to put my existing project under source control, and I looked at <a href="https://stackoverflow.com/questions/5618686/how-to-add-a-new-project-to-source-control-in-xcode-4?rq=1">this question</a>, but it looks like that sol... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,864 | git | # Putting existing project under source control in Xcode 4.3.2
I was looking for a way to put my existing project under source control, and I looked at [this question](https://stackoverflow.com/questions/5618686/how-to-add-a-new-project-to-source-control-in-xcode-4?rq=1), but it looks like that solution only worked wi... | you can do it in terminal using:
cd /to/app/folder
```
git init
git add .
git commit -am 'a descriptor of your first commit'
```
This should then be picked up in Xcode, you may need to close and re-open
Hope it helps |
8161376 | Reverting to a specific sha or commit | 11 | 2011-11-17 02:27:55 | <p>I'm trying to revert to a specific commit ( 3d5575f8e4c97ddab8ad5d540fee4664c04db75d ), but when i do:</p>
<pre><code>git revert 3d5575f8e4c97ddab8ad5d540fee4664c04db75d
</code></pre>
<p>it says:</p>
<pre><code>fatal: 'revert' is not possible because you have unmerged files.
Please, fix them up in the work tree, ... | 16,307 | 144,833 | 2018-01-08 13:37:12 | 8,161,518 | 19 | 2011-11-17 02:52:09 | 1,048,842 | 2011-11-17 02:52:09 | https://stackoverflow.com/q/8161376 | https://stackoverflow.com/a/8161518 | <p>I think you want to use <code>git reset 3d5575f8e4c97ddab8ad5d540fee4664c04db75d</code>. This will keep your working files as is, but reset your HEAD to the commit you specified. Additionally, it should reset your index as well (clears out files you have selected to commit, add, remove, etc). </p>
<p>If you want to... | <p>I think you want to use <code>git reset 3d5575f8e4c97ddab8ad5d540fee4664c04db75d</code>. This will keep your working files as is, but reset your HEAD to the commit you specified. Additionally, it should reset your index as well (clears out files you have selected to commit, add, remove, etc). </p> <p>If you want to... | 119, 12196, 12309 | git, revert, rollback | <h1>Reverting to a specific sha or commit</h1>
<p>I'm trying to revert to a specific commit ( 3d5575f8e4c97ddab8ad5d540fee4664c04db75d ), but when i do:</p>
<pre><code>git revert 3d5575f8e4c97ddab8ad5d540fee4664c04db75d
</code></pre>
<p>it says:</p>
<pre><code>fatal: 'revert' is not possible because you have unmerge... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,865 | git | # Reverting to a specific sha or commit
I'm trying to revert to a specific commit ( 3d5575f8e4c97ddab8ad5d540fee4664c04db75d ), but when i do:
```
git revert 3d5575f8e4c97ddab8ad5d540fee4664c04db75d
```
it says:
```
fatal: 'revert' is not possible because you have unmerged files.
Please, fix them up in the work tre... | I think you want to use `git reset 3d5575f8e4c97ddab8ad5d540fee4664c04db75d`. This will keep your working files as is, but reset your HEAD to the commit you specified. Additionally, it should reset your index as well (clears out files you have selected to commit, add, remove, etc).
If you want to get rid of all the ch... |
7685433 | How to get files and content by SHA of commit | 11 | 2011-10-07 09:34:18 | <p>How to list files that are changed in specific commit and get content of that files when I have sha number of commit ?</p>
| 6,202 | 486,578 | 2011-10-07 09:42:30 | 7,685,473 | 19 | 2011-10-07 09:37:38 | 223,092 | 2011-10-07 09:37:38 | https://stackoverflow.com/q/7685433 | https://stackoverflow.com/a/7685473 | <p>To list the files that were changed by a particular commit, you can do:</p>
<pre><code>git show --name-only <commit>
</code></pre>
<p>If you want to suppress the log message from that output, you can add <code>--pretty=format:</code> to the options.</p>
<p>As for your second question, to see the content of ... | <p>To list the files that were changed by a particular commit, you can do:</p> <pre><code>git show --name-only <commit> </code></pre> <p>If you want to suppress the log message from that output, you can add <code>--pretty=format:</code> to the options.</p> <p>As for your second question, to see the content of ... | 119 | git | <h1>How to get files and content by SHA of commit</h1>
<p>How to list files that are changed in specific commit and get content of that files when I have sha number of commit ?</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,866 | git | # How to get files and content by SHA of commit
How to list files that are changed in specific commit and get content of that files when I have sha number of commit ? | To list the files that were changed by a particular commit, you can do:
```
git show --name-only <commit>
```
If you want to suppress the log message from that output, you can add `--pretty=format:` to the options.
As for your second question, to see the content of a particular file from that commit, say with SHA1su... |
7332124 | gitolite with non-default port | 11 | 2011-09-07 10:10:51 | <p>To clone a repository managed by gitolite one usually uses following syntax</p>
<pre><code>git clone gitolite@server:repository
</code></pre>
<p>This tells the SSH client to connect to port 22 of <em>server</em> using <em>gitolite</em> as user name. When I try it with the port number:</p>
<pre><code>git clone git... | 7,508 | 209,706 | 2011-10-06 20:14:23 | 7,343,433 | 19 | 2011-09-08 05:21:49 | 193,688 | 2011-09-08 05:43:50 | https://stackoverflow.com/q/7332124 | https://stackoverflow.com/a/7343433 | <p>The “SCP style” Git URL syntax (<code>user@server:path</code>) does not support including a port. To include a port, you must use an <code>ssh://</code> “Git URL”. For example:</p>
<pre><code>ssh://gitolite@server:2222/repository
</code></pre>
<p>Note: As compared to <code>gitolite@server:repository</code>, this p... | <p>The “SCP style” Git URL syntax (<code>user@server:path</code>) does not support including a port. To include a port, you must use an <code>ssh://</code> “Git URL”. For example:</p> <pre><code>ssh://gitolite@server:2222/repository </code></pre> <p>Note: As compared to <code>gitolite@server:repository</code>, this p... | 386, 39151 | gitolite, ssh | <h1>gitolite with non-default port</h1>
<p>To clone a repository managed by gitolite one usually uses following syntax</p>
<pre><code>git clone gitolite@server:repository
</code></pre>
<p>This tells the SSH client to connect to port 22 of <em>server</em> using <em>gitolite</em> as user name. When I try it with the po... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,867 | git | # gitolite with non-default port
To clone a repository managed by gitolite one usually uses following syntax
```
git clone gitolite@server:repository
```
This tells the SSH client to connect to port 22 of *server* using *gitolite* as user name. When I try it with the port number:
```
git clone gitolite@server:22:re... | The “SCP style” Git URL syntax (`user@server:path`) does not support including a port. To include a port, you must use an `ssh://` “Git URL”. For example:
```
ssh://gitolite@server:2222/repository
```
Note: As compared to `gitolite@server:repository`, this presents a slightly different repository path to the remote e... |
3968281 | Git: pushing amended commits | 11 | 2010-10-19 12:27:03 | <p>I am currently working on a project and using machines in two different locations to do it. I have created a branch for the feature I am working on and when I finish some work on it I amend my commit to that branch and push it to the server so I can pick up where I left off on my other machine.</p>
<p>When I try to... | 13,962 | 130,006 | 2021-05-17 12:30:10 | 3,968,449 | 19 | 2010-10-19 12:47:31 | 356,716 | 2010-10-19 12:47:31 | https://stackoverflow.com/q/3968281 | https://stackoverflow.com/a/3968449 | <p>There is no way to overwrite remote branch without --force in this case. You have 2 options:</p>
<ul>
<li>continue to use <code>git push --force</code></li>
<li>don't use <code>--amend</code>. If some work you've done deserves a separate commit (is stable enough, compiling, passing more tests, etc...), create new c... | <p>There is no way to overwrite remote branch without --force in this case. You have 2 options:</p> <ul> <li>continue to use <code>git push --force</code></li> <li>don't use <code>--amend</code>. If some work you've done deserves a separate commit (is stable enough, compiling, passing more tests, etc...), create new c... | 119 | git | <h1>Git: pushing amended commits</h1>
<p>I am currently working on a project and using machines in two different locations to do it. I have created a branch for the feature I am working on and when I finish some work on it I amend my commit to that branch and push it to the server so I can pick up where I left off on m... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,868 | git | # Git: pushing amended commits
I am currently working on a project and using machines in two different locations to do it. I have created a branch for the feature I am working on and when I finish some work on it I amend my commit to that branch and push it to the server so I can pick up where I left off on my other m... | There is no way to overwrite remote branch without --force in this case. You have 2 options:
- continue to use `git push --force`
- don't use `--amend`. If some work you've done deserves a separate commit (is stable enough, compiling, passing more tests, etc...), create new commit. If not, create temporary branch (som... |
1367258 | Using Git without Sudo in many accounts | 11 | 2009-09-02 11:53:57 | <p><strong>How can you use Git without Sudo in multiple accounts in one Ubuntu?</strong></p>
<p>My Ubuntu has many accounts.
The creation of new accounts has made Git inaccessible by me without sudo.</p>
<p>I changed the owner to be me, masi, and the group to be <code>admin</code> where the <em>masi</em> belongs to.
... | 19,240 | 164,148 | 2015-11-10 15:46:23 | 1,367,437 | 19 | 2009-09-02 12:36:10 | 121,364 | 2014-05-02 11:12:50 | https://stackoverflow.com/q/1367258 | https://stackoverflow.com/a/1367437 | <p>If I understand your question correctly, you need grant several *nix user accounts write access to the same git repository. Using the <code>--share</code> command line argument for <code>git init</code> should enable this. The GitWiki has <a href="https://git.wiki.kernel.org/articles/g/i/t/GitFaq_ebc3.html#How_do_I_... | <p>If I understand your question correctly, you need grant several *nix user accounts write access to the same git repository. Using the <code>--share</code> command line argument for <code>git init</code> should enable this. The GitWiki has <a href="https://git.wiki.kernel.org/articles/g/i/t/GitFaq_ebc3.html#How_do_I_... | 119, 549, 1674 | git, sudo, ubuntu | <h1>Using Git without Sudo in many accounts</h1>
<p><strong>How can you use Git without Sudo in multiple accounts in one Ubuntu?</strong></p>
<p>My Ubuntu has many accounts.
The creation of new accounts has made Git inaccessible by me without sudo.</p>
<p>I changed the owner to be me, masi, and the group to be <code>... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,869 | git | # Using Git without Sudo in many accounts
**How can you use Git without Sudo in multiple accounts in one Ubuntu?**
My Ubuntu has many accounts.
The creation of new accounts has made Git inaccessible by me without sudo.
I changed the owner to be me, masi, and the group to be `admin` where the *masi* belongs to.
I hav... | If I understand your question correctly, you need grant several *nix user accounts write access to the same git repository. Using the `--share` command line argument for `git init` should enable this. The GitWiki has [a few words to say about this](https://git.wiki.kernel.org/articles/g/i/t/GitFaq_ebc3.html#How_do_I_sh... |
72008301 | Error updating changes: unsafe repository ... is owned by someone else | 10 | 2022-04-26 04:13:48 | <p>Recently when I open git projects in Android Studio, I receive this error :</p>
<pre><code>Error updating changes: Unsafe repository (`project name` is owned by someone else). To add an exception to this directory, call : git config --global --add safe.directory ...
</code></pre>
<p>I know using command line mention... | 14,580 | 305,135 | 2023-06-04 08:30:49 | 72,009,598 | 19 | 2022-04-26 06:59:46 | 6,309 | 2022-04-26 06:59:46 | https://stackoverflow.com/q/72008301 | https://stackoverflow.com/a/72009598 | <p>Check your Git version first:</p>
<pre><code>git version
</code></pre>
<p>If it is the recent 2.35.2 or 2.36, you need to set the <a href="https://git-scm.com/docs/git-config/#Documentation/git-config.txt-safedirectory" rel="noreferrer"><code>safe.directory</code> setting</a>, because of <a href="https://github.blog... | <p>Check your Git version first:</p> <pre><code>git version </code></pre> <p>If it is the recent 2.35.2 or 2.36, you need to set the <a href="https://git-scm.com/docs/git-config/#Documentation/git-config.txt-safedirectory" rel="noreferrer"><code>safe.directory</code> setting</a>, because of <a href="https://github.blog... | 119, 136, 456, 7330, 91905 | android-studio, git, repository, security, version-control | <h1>Error updating changes: unsafe repository ... is owned by someone else</h1>
<p>Recently when I open git projects in Android Studio, I receive this error :</p>
<pre><code>Error updating changes: Unsafe repository (`project name` is owned by someone else). To add an exception to this directory, call : git config --gl... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,870 | git | # Error updating changes: unsafe repository ... is owned by someone else
Recently when I open git projects in Android Studio, I receive this error :
```
Error updating changes: Unsafe repository (`project name` is owned by someone else). To add an exception to this directory, call : git config --global --add safe.dir... | Check your Git version first:
```
git version
```
If it is the recent 2.35.2 or 2.36, you need to set the [`safe.directory` setting](https://git-scm.com/docs/git-config/#Documentation/git-config.txt-safedirectory), because of [CVE-2022-24765](https://github.blog/2022-04-12-git-security-vulnerability-announced/).
```... |
59508121 | "No url found for submodule path in .gitmodules" error in Azure DevOps build | 10 | 2019-12-28 04:29:59 | <p>A repo ("website") has a submodule ("template"). The submodule is referenced inside a directory of the repo. The goal is to use an Azure DevOps pipeline to build the repo and submodule together. However, the Azure DevOps build throws the following errors:</p>
<ul>
<li><code>fatal: No url found for submodule path '&... | 25,051 | 7,848,350 | 2021-11-29 12:53:06 | 61,222,882 | 19 | 2020-04-15 06:48:13 | 403,161 | 2020-04-15 06:48:13 | https://stackoverflow.com/q/59508121 | https://stackoverflow.com/a/61222882 | <p>Not sure if this helps here, but I've struggled with the same error for a submodule that was relocated (moved from /my-submodule to /src/my-submodule in the repository). Doing <code>git rm --force /my-submodule</code>, commit and push to remote resolved the issue for me.</p>
<p>I found that using <code>git submodul... | <p>Not sure if this helps here, but I've struggled with the same error for a submodule that was relocated (moved from /my-submodule to /src/my-submodule in the repository). Doing <code>git rm --force /my-submodule</code>, commit and push to remote resolved the issue for me.</p> <p>I found that using <code>git submodul... | 119, 14158, 119596 | azure, azure-pipelines, git | <h1>"No url found for submodule path in .gitmodules" error in Azure DevOps build</h1>
<p>A repo ("website") has a submodule ("template"). The submodule is referenced inside a directory of the repo. The goal is to use an Azure DevOps pipeline to build the repo and submodule together. However, the Azure DevOps build thro... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,872 | git | # "No url found for submodule path in .gitmodules" error in Azure DevOps build
A repo ("website") has a submodule ("template"). The submodule is referenced inside a directory of the repo. The goal is to use an Azure DevOps pipeline to build the repo and submodule together. However, the Azure DevOps build throws the fo... | Not sure if this helps here, but I've struggled with the same error for a submodule that was relocated (moved from /my-submodule to /src/my-submodule in the repository). Doing `git rm --force /my-submodule`, commit and push to remote resolved the issue for me.
I found that using `git submodule status` is helpful to lo... |
60853992 | How to git show a staged file? | 10 | 2020-03-25 17:18:41 | <p>I can do <code>git show <some-commit>:path/to/some/file</code> but what do I replace <code><some-commit></code> to get the currently staged version of the file?</p>
<p>Context: I'm writing a pre-commit hook and I want to run a check on the staged files without resorting to stashing unstaged changes. Is t... | 4,722 | 2,644,016 | 2020-07-31 05:18:31 | 60,854,287 | 19 | 2020-03-25 17:36:55 | 1,256,452 | 2020-03-25 17:36:55 | https://stackoverflow.com/q/60853992 | https://stackoverflow.com/a/60854287 | <p>Use <code>git show :path/to/some/file</code>.</p>
<p>Files that are "staged" represent an index copy of the file that differs from some other copy, such as the current commit copy that you can access via <code>HEAD:path/to/some/file</code>.</p>
<p>Files that are stored in the index have a <em>stage number</em>, us... | <p>Use <code>git show :path/to/some/file</code>.</p> <p>Files that are "staged" represent an index copy of the file that differs from some other copy, such as the current commit copy that you can access via <code>HEAD:path/to/some/file</code>.</p> <p>Files that are stored in the index have a <em>stage number</em>, us... | 119, 74295, 74978 | git, git-show, git-stage | <h1>How to git show a staged file?</h1>
<p>I can do <code>git show <some-commit>:path/to/some/file</code> but what do I replace <code><some-commit></code> to get the currently staged version of the file?</p>
<p>Context: I'm writing a pre-commit hook and I want to run a check on the staged files without reso... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,873 | git | # How to git show a staged file?
I can do `git show <some-commit>:path/to/some/file` but what do I replace `<some-commit>` to get the currently staged version of the file?
Context: I'm writing a pre-commit hook and I want to run a check on the staged files without resorting to stashing unstaged changes. Is there a be... | Use `git show :path/to/some/file`.
Files that are "staged" represent an index copy of the file that differs from some other copy, such as the current commit copy that you can access via `HEAD:path/to/some/file`.
Files that are stored in the index have a *stage number*, usually zero. (Staging slots 1, 2, and 3 are use... |
41726632 | How to find nearest tag ahead of commit in git | 10 | 2017-01-18 18:16:01 | <p>I am trying to find the nearest tag after a commit in a particular branch.</p>
<p>I am aware that git describe will walk back and find the nearest ancestor with a tag but how do I move in the opposite direction.</p>
<p>For example:</p>
<p><a href="https://i.sstatic.net/Csq5k.png" rel="noreferrer"><img src="https:... | 8,093 | 2,292,477 | 2023-04-29 19:31:21 | 41,727,737 | 19 | 2017-01-18 19:22:05 | 1,127,485 | 2017-01-18 19:22:05 | https://stackoverflow.com/q/41726632 | https://stackoverflow.com/a/41727737 | <p>How about <code>git describe --contains <commit 2> | cut -d'~' -f1</code>? As that would refer back to <code><commit 2></code> from the tag by the number of commits, only take the part before <code>~</code> as the tag name (given that your tag names do not contain <code>~</code>).</p>
| <p>How about <code>git describe --contains <commit 2> | cut -d'~' -f1</code>? As that would refer back to <code><commit 2></code> from the tag by the number of commits, only take the part before <code>~</code> as the tag name (given that your tag names do not contain <code>~</code>).</p> | 119 | git | <h1>How to find nearest tag ahead of commit in git</h1>
<p>I am trying to find the nearest tag after a commit in a particular branch.</p>
<p>I am aware that git describe will walk back and find the nearest ancestor with a tag but how do I move in the opposite direction.</p>
<p>For example:</p>
<p><a href="https://i.... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,875 | git | # How to find nearest tag ahead of commit in git
I am trying to find the nearest tag after a commit in a particular branch.
I am aware that git describe will walk back and find the nearest ancestor with a tag but how do I move in the opposite direction.
For example:
[. |
38547870 | Android How to Convert Latitude Longitude into Degree format | 10 | 2016-07-24 01:17:35 | <p>I want to convert latitude 40.7127837, longitude -74.0059413
and to the following format</p>
<p>N 40°42'46.0218"
W 74°0'21.3876"</p>
<p>What is the best way to do that?</p>
<p>I tried methods like location.FORMAT_DEGREES, location.FORMAT_MINUTES and location.FORMAT_SECONDS, but I'm not sure how to convert them to... | 10,738 | 1,391,580 | 2017-11-11 09:19:24 | 38,551,230 | 19 | 2016-07-24 10:51:45 | 4,558,709 | 2016-07-24 10:51:45 | https://stackoverflow.com/q/38547870 | https://stackoverflow.com/a/38551230 | <p>The <code>Location.convert()</code> method that you are using gives very good results and is well implemented and tested. You just need to format the output to suit your needs:</p>
<pre><code>private String convert(double latitude, double longitude) {
StringBuilder builder = new StringBuilder();
if (latitu... | <p>The <code>Location.convert()</code> method that you are using gives very good results and is well implemented and tested. You just need to format the output to suit your needs:</p> <pre><code>private String convert(double latitude, double longitude) { StringBuilder builder = new StringBuilder(); if (latitu... | 17, 1386, 1819, 20301, 115232 | android, android-gps, google-maps, java, latitude-longitude | <h1>Android How to Convert Latitude Longitude into Degree format</h1>
<p>I want to convert latitude 40.7127837, longitude -74.0059413
and to the following format</p>
<p>N 40°42'46.0218"
W 74°0'21.3876"</p>
<p>What is the best way to do that?</p>
<p>I tried methods like location.FORMAT_DEGREES, location.FORMAT_MINUTE... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,876 | git | # Android How to Convert Latitude Longitude into Degree format
I want to convert latitude 40.7127837, longitude -74.0059413
and to the following format
N 40°42'46.0218"
W 74°0'21.3876"
What is the best way to do that?
I tried methods like location.FORMAT_DEGREES, location.FORMAT_MINUTES and location.FORMAT_SECONDS,... | The `Location.convert()` method that you are using gives very good results and is well implemented and tested. You just need to format the output to suit your needs:
```
private String convert(double latitude, double longitude) {
StringBuilder builder = new StringBuilder();
if (latitude < 0) {
builder... |
32085652 | What's the meaning of `()` in git command SYNOPSIS? | 10 | 2015-08-19 02:37:48 | <p>In the <a href="http://git-scm.com/docs/git-reset" rel="noreferrer">synopsis</a> of <code>git reset</code>:</p>
<blockquote>
<p>'git reset' (--patch | -p) [<tree-ish>] [--] [<paths>...]</p>
</blockquote>
<p>I have an issue with the markers' meaning.</p>
<p>I know <code>[]</code> stands for options, ... | 1,080 | 661,935 | 2015-08-19 03:19:53 | 32,085,970 | 19 | 2015-08-19 03:19:24 | 5,241,578 | 2015-08-19 03:19:24 | https://stackoverflow.com/q/32085652 | https://stackoverflow.com/a/32085970 | <p>This is covered in git's <a href="https://github.com/git/git/blob/master/Documentation/CodingGuidelines" rel="noreferrer">CodingGuidelines</a>, found on their Github. It gives contributors a style guide while also describing how help options should be written. Other sources like POSIX or BSD should not be taken as a... | <p>This is covered in git's <a href="https://github.com/git/git/blob/master/Documentation/CodingGuidelines" rel="noreferrer">CodingGuidelines</a>, found on their Github. It gives contributors a style guide while also describing how help options should be written. Other sources like POSIX or BSD should not be taken as a... | 119, 367, 1993 | git, posix, syntax | <h1>What's the meaning of `()` in git command SYNOPSIS?</h1>
<p>In the <a href="http://git-scm.com/docs/git-reset" rel="noreferrer">synopsis</a> of <code>git reset</code>:</p>
<blockquote>
<p>'git reset' (--patch | -p) [<tree-ish>] [--] [<paths>...]</p>
</blockquote>
<p>I have an issue with the markers'... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,878 | git | # What's the meaning of `()` in git command SYNOPSIS?
In the [synopsis](http://git-scm.com/docs/git-reset) of `git reset`:
> 'git reset' (--patch | -p) [<tree-ish>] [--] [<paths>...]
I have an issue with the markers' meaning.
I know `[]` stands for options, `<>` stands for replacement. But, what's the meaning of `(... | This is covered in git's [CodingGuidelines](https://github.com/git/git/blob/master/Documentation/CodingGuidelines), found on their Github. It gives contributors a style guide while also describing how help options should be written. Other sources like POSIX or BSD should not be taken as authoritative, especially since ... |
31298464 | Error reading response length from authentication socket | 10 | 2015-07-08 16:28:52 | <p>In my ruby on rails project, I am using capistrano , unicorn, postgresql and nginx for deploying my project. when I run <code>cap production git:check</code> I am getting this error:</p>
<pre><code>Error reading response length from authentication socket.
</code></pre>
<p>log trace:</p>
<pre><code>INFO [13522bc0... | 13,064 | 2,980,650 | 2017-05-15 12:57:39 | 31,299,669 | 19 | 2015-07-08 17:31:17 | 4,820,428 | 2017-05-15 12:57:39 | https://stackoverflow.com/q/31298464 | https://stackoverflow.com/a/31299669 | <p><strong>TL;DR</strong></p>
<pre><code># start/restart ssh-agent
eval "$(ssh-agent -s)"
# add the desired ssh-key
ssh-add ~/.ssh/id_rsa
</code></pre>
<p>See: <a href="https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/" rel="noreferrer">https://help.github.com/articles/generat... | <p><strong>TL;DR</strong></p> <pre><code># start/restart ssh-agent eval "$(ssh-agent -s)" # add the desired ssh-key ssh-add ~/.ssh/id_rsa </code></pre> <p>See: <a href="https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/" rel="noreferrer">https://help.github.com/articles/generat... | 119, 85786, 97592 | capistrano3, git, ruby-on-rails-4 | <h1>Error reading response length from authentication socket</h1>
<p>In my ruby on rails project, I am using capistrano , unicorn, postgresql and nginx for deploying my project. when I run <code>cap production git:check</code> I am getting this error:</p>
<pre><code>Error reading response length from authentication s... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,879 | git | # Error reading response length from authentication socket
In my ruby on rails project, I am using capistrano , unicorn, postgresql and nginx for deploying my project. when I run `cap production git:check` I am getting this error:
```
Error reading response length from authentication socket.
```
log trace:
```
INFO... | **TL;DR**
```
# start/restart ssh-agent
eval "$(ssh-agent -s)"
# add the desired ssh-key
ssh-add ~/.ssh/id_rsa
```
See: <https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/> for more details.
---
I went through the same issue in the past and this post helped me a lot to fix it... |
25610958 | Installing laravel on existing project | 10 | 2014-09-01 18:00:13 | <p>I'm developing a laravel application and my computer die.
Now I want to get my project from the repository (Bitbucket + Git) but thanks to the git ignore file, the vendor folder is missing. I can't do a composer install on my project because is not allowed (the directory should be empty). The structure of my project... | 23,942 | 2,429,342 | 2014-09-01 18:05:36 | 25,611,010 | 19 | 2014-09-01 18:05:36 | 1,959,747 | 2014-09-01 18:05:36 | https://stackoverflow.com/q/25610958 | https://stackoverflow.com/a/25611010 | <p>Go to your www folder</p>
<pre><code>cd /var/www
</code></pre>
<p>Git clone your application (not that here the directory must not exist):</p>
<pre><code>git clone https://github.com/antonioribeiro/application
</code></pre>
<p>CD into the folder</p>
<pre><code>cd application
</code></pre>
<p>Execute composer u... | <p>Go to your www folder</p> <pre><code>cd /var/www </code></pre> <p>Git clone your application (not that here the directory must not exist):</p> <pre><code>git clone https://github.com/antonioribeiro/application </code></pre> <p>CD into the folder</p> <pre><code>cd application </code></pre> <p>Execute composer u... | 5, 119, 8337, 75151, 78546 | bitbucket, composer-php, git, laravel, php | <h1>Installing laravel on existing project</h1>
<p>I'm developing a laravel application and my computer die.
Now I want to get my project from the repository (Bitbucket + Git) but thanks to the git ignore file, the vendor folder is missing. I can't do a composer install on my project because is not allowed (the directo... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,880 | git | # Installing laravel on existing project
I'm developing a laravel application and my computer die.
Now I want to get my project from the repository (Bitbucket + Git) but thanks to the git ignore file, the vendor folder is missing. I can't do a composer install on my project because is not allowed (the directory should... | Go to your www folder
```
cd /var/www
```
Git clone your application (not that here the directory must not exist):
```
git clone https://github.com/antonioribeiro/application
```
CD into the folder
```
cd application
```
Execute composer update (if you are in a development environment)
```
composer update
```
O... |
23036572 | Visual Studio Tools for GIT - FETCH / PUBLISH vs PULL / PUSH | 10 | 2014-04-12 21:54:02 | <p>I like using the CLI for interacting with GIT but I'm trying to understand the VS Tools for Git extension for the benefit of some team members who would prefer not to 'CLI'.</p>
<p>The UI for VS Tools for Git extension has actions labeled <code>FETCH</code> and <code>PUBLISH</code> which sound like <code>PULL</code... | 14,610 | 1,760,479 | 2014-04-12 22:12:45 | 23,036,758 | 19 | 2014-04-12 22:12:45 | 241,605 | 2014-04-12 22:12:45 | https://stackoverflow.com/q/23036572 | https://stackoverflow.com/a/23036758 | <p><strong>Fetch</strong>, <strong>pull</strong> and <strong>push</strong> are all standard Git commands. Type <code>git help fetch</code>, etc. from a console Window for the in-depth details, but it boils down to this:</p>
<ul>
<li><strong>fetch</strong>: bring in changes without merging them</li>
<li><strong>pull</s... | <p><strong>Fetch</strong>, <strong>pull</strong> and <strong>push</strong> are all standard Git commands. Type <code>git help fetch</code>, etc. from a console Window for the in-depth details, but it boils down to this:</p> <ul> <li><strong>fetch</strong>: bring in changes without merging them</li> <li><strong>pull</s... | 119, 33953 | git, visual-studio | <h1>Visual Studio Tools for GIT - FETCH / PUBLISH vs PULL / PUSH</h1>
<p>I like using the CLI for interacting with GIT but I'm trying to understand the VS Tools for Git extension for the benefit of some team members who would prefer not to 'CLI'.</p>
<p>The UI for VS Tools for Git extension has actions labeled <code>F... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,882 | git | # Visual Studio Tools for GIT - FETCH / PUBLISH vs PULL / PUSH
I like using the CLI for interacting with GIT but I'm trying to understand the VS Tools for Git extension for the benefit of some team members who would prefer not to 'CLI'.
The UI for VS Tools for Git extension has actions labeled `FETCH` and `PUBLISH` w... | **Fetch**, **pull** and **push** are all standard Git commands. Type `git help fetch`, etc. from a console Window for the in-depth details, but it boils down to this:
- **fetch**: bring in changes without merging them
- **pull**: bring in changes and *do* merge them
- **push**: send out your changes.
**Publish** is m... |
22335987 | What happens when I 'git pull --rebase origin development' from within a feature branch? | 10 | 2014-03-11 20:30:59 | <p>Let's say I have a feature branch called <code>FeatureA</code>, and it is out of sync with (remote) <code>development</code> on which it is based. Normally I would rebase my branch by calling <code>git rebase development</code> (after syncing my local development with <code>origin/development</code> naturally).</p>
... | 18,639 | 2,818,703 | 2014-03-11 22:37:20 | 22,336,169 | 19 | 2014-03-11 20:40:22 | 641,955 | 2014-03-11 22:37:20 | https://stackoverflow.com/q/22335987 | https://stackoverflow.com/a/22336169 | <p><code>git pull --rebase origin development</code> is a shortcut to these commands:</p>
<pre><code>git fetch origin development
git rebase origin/development
</code></pre>
<p>That is, fetch <code>origin/development</code> and then rebase the current branch on top of it.</p>
<p><strong>UPDATE</strong></p>
<p>As <a... | <p><code>git pull --rebase origin development</code> is a shortcut to these commands:</p> <pre><code>git fetch origin development git rebase origin/development </code></pre> <p>That is, fetch <code>origin/development</code> and then rebase the current branch on top of it.</p> <p><strong>UPDATE</strong></p> <p>As <a... | 119, 8974, 40701 | feature-branch, git, rebase | <h1>What happens when I 'git pull --rebase origin development' from within a feature branch?</h1>
<p>Let's say I have a feature branch called <code>FeatureA</code>, and it is out of sync with (remote) <code>development</code> on which it is based. Normally I would rebase my branch by calling <code>git rebase developmen... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,883 | git | # What happens when I 'git pull --rebase origin development' from within a feature branch?
Let's say I have a feature branch called `FeatureA`, and it is out of sync with (remote) `development` on which it is based. Normally I would rebase my branch by calling `git rebase development` (after syncing my local developme... | `git pull --rebase origin development` is a shortcut to these commands:
```
git fetch origin development
git rebase origin/development
```
That is, fetch `origin/development` and then rebase the current branch on top of it.
**UPDATE**
As [@torek](https://stackoverflow.com/users/1256452/torek) pointed out:
> Yes, e... |
20033023 | revert the git last commit and save it in a different branch | 10 | 2013-11-17 16:14:47 | <p>Is there a way to rollback the last commit and put it into a separate branch for later testing? I did some changes which I don't want to entirely throw away, I just want to keep them aside in a different branch for further testing.</p>
<p>Can anyone help me with this?</p>
| 6,527 | 145,277 | 2013-11-17 16:47:09 | 20,033,043 | 19 | 2013-11-17 16:16:54 | 1,860,929 | 2013-11-17 16:28:02 | https://stackoverflow.com/q/20033023 | https://stackoverflow.com/a/20033043 | <p>Yes you can achieve this - branch away from the current branch and create a new branch to preserve the commit, checkout back to the original branch, and then rollback the commit in the original branch.</p>
<p>So from your current branch, (lets call it <code>current</code>), create and checkout a new branch <code>se... | <p>Yes you can achieve this - branch away from the current branch and create a new branch to preserve the commit, checkout back to the original branch, and then rollback the commit in the original branch.</p> <p>So from your current branch, (lets call it <code>current</code>), create and checkout a new branch <code>se... | 119, 51381, 53850, 76220 | git, git-branch, git-commit, git-reset | <h1>revert the git last commit and save it in a different branch</h1>
<p>Is there a way to rollback the last commit and put it into a separate branch for later testing? I did some changes which I don't want to entirely throw away, I just want to keep them aside in a different branch for further testing.</p>
<p>Can any... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,884 | git | # revert the git last commit and save it in a different branch
Is there a way to rollback the last commit and put it into a separate branch for later testing? I did some changes which I don't want to entirely throw away, I just want to keep them aside in a different branch for further testing.
Can anyone help me with... | Yes you can achieve this - branch away from the current branch and create a new branch to preserve the commit, checkout back to the original branch, and then rollback the commit in the original branch.
So from your current branch, (lets call it `current`), create and checkout a new branch `separate`
```
git checkout ... |
19915679 | trouble with adding/removing a git submodule | 10 | 2013-11-11 20:51:56 | <p>I'm trying to add a git submodule to my project, specifically ShareKit. My project is a git repo, and when I try to type</p>
<pre><code>git submodule add git://github.com/ShareKit/ShareKit.git Submodules/ShareKit
</code></pre>
<p>into Terminal I got an error saying that the submodule already existed. I guess I add... | 14,595 | 1,003,984 | 2015-03-11 17:29:08 | 19,916,707 | 19 | 2013-11-11 21:52:50 | 2,359,982 | 2013-11-11 21:58:39 | https://stackoverflow.com/q/19915679 | https://stackoverflow.com/a/19916707 | <p>Try the following to force git to re-add the submodule:</p>
<pre><code>git submodule add --force git://github.com/ShareKit/ShareKit.git Submodules/ShareKit
</code></pre>
<p>Note the --force after add.</p>
<p>If you'd want to remove version handling altogether, simply remove .git and .gitmodules.</p>
| <p>Try the following to force git to re-add the submodule:</p> <pre><code>git submodule add --force git://github.com/ShareKit/ShareKit.git Submodules/ShareKit </code></pre> <p>Note the --force after add.</p> <p>If you'd want to remove version handling altogether, simply remove .git and .gitmodules.</p> | 119, 41612 | git, git-submodules | <h1>trouble with adding/removing a git submodule</h1>
<p>I'm trying to add a git submodule to my project, specifically ShareKit. My project is a git repo, and when I try to type</p>
<pre><code>git submodule add git://github.com/ShareKit/ShareKit.git Submodules/ShareKit
</code></pre>
<p>into Terminal I got an error sa... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,885 | git | # trouble with adding/removing a git submodule
I'm trying to add a git submodule to my project, specifically ShareKit. My project is a git repo, and when I try to type
```
git submodule add git://github.com/ShareKit/ShareKit.git Submodules/ShareKit
```
into Terminal I got an error saying that the submodule already e... | Try the following to force git to re-add the submodule:
```
git submodule add --force git://github.com/ShareKit/ShareKit.git Submodules/ShareKit
```
Note the --force after add.
If you'd want to remove version handling altogether, simply remove .git and .gitmodules. |
12246037 | How do I remove the only branch in a bare `git` repository? | 10 | 2012-09-03 10:26:02 | <p>I'm experimenting with some <code>githooks</code>, so I have setup a local bare repository with a symlink from <code>hooks</code> to the hooks stored elsewhere.</p>
<p>I have pushed the <code>master</code> branch to the <code>git</code> repo and, of course, the hook failed. :)</p>
<p>I want to reset the <code>git<... | 9,004 | 961,353 | 2018-06-08 08:35:28 | 12,246,257 | 19 | 2012-09-03 10:42:17 | 438,742 | 2012-09-03 11:17:13 | https://stackoverflow.com/q/12246037 | https://stackoverflow.com/a/12246257 | <p>To remove the <code>master</code> ref, use <code>git update-ref -d refs/heads/master</code>.</p>
<h3>Why shouldn't you <code>rm /refs/heads/master</code>?</h3>
<p><code>packed-refs</code> could exist, so <code>rm</code> sometimes doesn't work as expected.</p>
<p>BTW, what's the point to reset if you could just cr... | <p>To remove the <code>master</code> ref, use <code>git update-ref -d refs/heads/master</code>.</p> <h3>Why shouldn't you <code>rm /refs/heads/master</code>?</h3> <p><code>packed-refs</code> could exist, so <code>rm</code> sometimes doesn't work as expected.</p> <p>BTW, what's the point to reset if you could just cr... | 119 | git | <h1>How do I remove the only branch in a bare `git` repository?</h1>
<p>I'm experimenting with some <code>githooks</code>, so I have setup a local bare repository with a symlink from <code>hooks</code> to the hooks stored elsewhere.</p>
<p>I have pushed the <code>master</code> branch to the <code>git</code> repo and, ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,886 | git | # How do I remove the only branch in a bare `git` repository?
I'm experimenting with some `githooks`, so I have setup a local bare repository with a symlink from `hooks` to the hooks stored elsewhere.
I have pushed the `master` branch to the `git` repo and, of course, the hook failed. :)
I want to reset the `git` re... | To remove the `master` ref, use `git update-ref -d refs/heads/master`.
### Why shouldn't you `rm /refs/heads/master`?
`packed-refs` could exist, so `rm` sometimes doesn't work as expected.
BTW, what's the point to reset if you could just create a new empty repo instead? Just use `git init --bare repo.git`. |
11905360 | How best to manage TYPO3 installations using git? | 10 | 2012-08-10 16:04:36 | <p>Hello I have been meaning to get around to this for a while now, but I would like to use git to maintain some typo3 development sites. I did some digging around and the most informative (<a href="http://www.chmuul.net/2010/02/saubere-git-repositories-fur-typo3-projekte/">chromium translated site</a>) info on the sub... | 6,097 | 107,301 | 2013-03-07 12:32:09 | 11,905,810 | 19 | 2012-08-10 16:35:40 | 1,066,240 | 2012-08-10 16:35:40 | https://stackoverflow.com/q/11905360 | https://stackoverflow.com/a/11905810 | <p>There's is typical <code>.gitignore</code></p>
<pre><code>/fileadmin/user_upload/
/fileadmin/_temp_/
/uploads/
/typo3conf/temp_CACHED*
/typo3conf/temp_fieldInfo.php
/typo3conf/localconf_local.php
/typo3/
/t3lib/
/typo3temp/
</code></pre>
<p>Keep in mind that when using <code>TYPO3</code> with <code>git</code> y... | <p>There's is typical <code>.gitignore</code></p> <pre><code>/fileadmin/user_upload/ /fileadmin/_temp_/ /uploads/ /typo3conf/temp_CACHED* /typo3conf/temp_fieldInfo.php /typo3conf/localconf_local.php /typo3/ /t3lib/ /typo3temp/ </code></pre> <p>Keep in mind that when using <code>TYPO3</code> with <code>git</code> y... | 119, 5505, 20971, 27066 | content-management-system, git, typo3, web-deployment | <h1>How best to manage TYPO3 installations using git?</h1>
<p>Hello I have been meaning to get around to this for a while now, but I would like to use git to maintain some typo3 development sites. I did some digging around and the most informative (<a href="http://www.chmuul.net/2010/02/saubere-git-repositories-fur-typ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,887 | git | # How best to manage TYPO3 installations using git?
Hello I have been meaning to get around to this for a while now, but I would like to use git to maintain some typo3 development sites. I did some digging around and the most informative ([chromium translated site](http://www.chmuul.net/2010/02/saubere-git-repositorie... | There's is typical `.gitignore`
```
/fileadmin/user_upload/
/fileadmin/_temp_/
/uploads/
/typo3conf/temp_CACHED*
/typo3conf/temp_fieldInfo.php
/typo3conf/localconf_local.php
/typo3/
/t3lib/
/typo3temp/
```
Keep in mind that when using `TYPO3` with `git` you should not install any extension on the remote with `Exte... |
11667838 | How do I get an addresses latitude-longitude using HTML5 geolocation or Google API? | 10 | 2012-07-26 11:01:17 | <p>I am getting baffled with a problem that is, I can get the location of a user from Facebook and all I need is to get the latitude and longitude of that location, but I still couldn't find a solution.</p>
<p>It will help if I can get that latitude and longitude using an HTML5 geolocation or any Google API. What is t... | 43,221 | 1,440,250 | 2020-07-27 10:41:08 | 11,670,315 | 19 | 2012-07-26 13:25:05 | 2,566,840 | 2012-07-26 13:25:05 | https://stackoverflow.com/q/11667838 | https://stackoverflow.com/a/11670315 | <pre>
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(successFunction, errorFunction);
} else {
alert('It seems like Geolocation, which is required for this page, is not enabled in your browser. Please use a browser which supports it.');
}
</pre>
<p>If the browser supports geolocation and... | <pre> if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(successFunction, errorFunction); } else { alert('It seems like Geolocation, which is required for this page, is not enabled in your browser. Please use a browser which supports it.'); } </pre> <p>If the browser supports geolocation and... | 2, 3, 10580, 20301 | geolocation, html, javascript, latitude-longitude | <h1>How do I get an addresses latitude-longitude using HTML5 geolocation or Google API?</h1>
<p>I am getting baffled with a problem that is, I can get the location of a user from Facebook and all I need is to get the latitude and longitude of that location, but I still couldn't find a solution.</p>
<p>It will help if ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,888 | git | # How do I get an addresses latitude-longitude using HTML5 geolocation or Google API?
I am getting baffled with a problem that is, I can get the location of a user from Facebook and all I need is to get the latitude and longitude of that location, but I still couldn't find a solution.
It will help if I can get that l... | ```
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(successFunction, errorFunction);
} else {
alert('It seems like Geolocation, which is required for this page, is not enabled in your browser. Please use a browser which supports it.');
}
```
If the browser supports geolocation and if `get... |
11085882 | git pull (update local file only) | 10 | 2012-06-18 15:19:55 | <p>i just want to update my local files with git. but every time i try to pull i get and error saying that i need to commit certain file first. what is the way to update local file without using commit??</p>
<p>here is the error message</p>
<p>$ git pull
Enter passphrase for key '/c/Users/me/.ssh/id_rsa':
Updating 4d... | 14,906 | 1,097,800 | 2015-03-27 18:50:49 | 11,086,271 | 19 | 2012-06-18 15:41:34 | 1,220,479 | 2015-03-27 18:50:49 | https://stackoverflow.com/q/11085882 | https://stackoverflow.com/a/11086271 | <p>If you don't want to commit, you'll need to stash your changes. This sounds like what you're looking for:</p>
<pre><code>git stash save "Changes I don't want to commit yet"
git pull
git stash pop
</code></pre>
<p>The first line stashes your changes onto a stack and reverts your code to the last commit. From there,... | <p>If you don't want to commit, you'll need to stash your changes. This sounds like what you're looking for:</p> <pre><code>git stash save "Changes I don't want to commit yet" git pull git stash pop </code></pre> <p>The first line stashes your changes onto a stack and reverts your code to the last commit. From there,... | 119 | git | <h1>git pull (update local file only)</h1>
<p>i just want to update my local files with git. but every time i try to pull i get and error saying that i need to commit certain file first. what is the way to update local file without using commit??</p>
<p>here is the error message</p>
<p>$ git pull
Enter passphrase for... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,890 | git | # git pull (update local file only)
i just want to update my local files with git. but every time i try to pull i get and error saying that i need to commit certain file first. what is the way to update local file without using commit??
here is the error message
$ git pull
Enter passphrase for key '/c/Users/me/.ssh/... | If you don't want to commit, you'll need to stash your changes. This sounds like what you're looking for:
```
git stash save "Changes I don't want to commit yet"
git pull
git stash pop
```
The first line stashes your changes onto a stack and reverts your code to the last commit. From there, you can pull like normal. ... |
9040083 | Error when pulling warning: suboptimal pack - out of memory | 10 | 2012-01-27 21:07:47 | <p>I keep getting this error when trying to do a <code>git pull</code> or a <code>git gc</code>.</p>
<pre><code>warning: suboptimal pack - out of memory
Compressing objects: 100% (10955/10955), done.
fatal: Out of memory, malloc failed (tried to allocate 827101023 bytes)
error: failed to run repack
</code></pre>
<p>... | 19,522 | 430,004 | 2020-01-14 21:07:56 | 9,041,551 | 19 | 2012-01-27 23:42:23 | 6,309 | 2020-01-14 21:07:56 | https://stackoverflow.com/q/9040083 | https://stackoverflow.com/a/9041551 | <p><a href="http://git.661346.n2.nabble.com/git-gc-out-of-memory-td4005235.html" rel="nofollow noreferrer">This thread</a> suggests</p>
<blockquote>
<p>run <code>git repack -adf --window=memory</code> on the repo where memory is escalated appropriately for your machine.</p>
</blockquote>
<p>That is pretty much the ... | <p><a href="http://git.661346.n2.nabble.com/git-gc-out-of-memory-td4005235.html" rel="nofollow noreferrer">This thread</a> suggests</p> <blockquote> <p>run <code>git repack -adf --window=memory</code> on the repo where memory is escalated appropriately for your machine.</p> </blockquote> <p>That is pretty much the ... | 119 | git | <h1>Error when pulling warning: suboptimal pack - out of memory</h1>
<p>I keep getting this error when trying to do a <code>git pull</code> or a <code>git gc</code>.</p>
<pre><code>warning: suboptimal pack - out of memory
Compressing objects: 100% (10955/10955), done.
fatal: Out of memory, malloc failed (tried to all... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,891 | git | # Error when pulling warning: suboptimal pack - out of memory
I keep getting this error when trying to do a `git pull` or a `git gc`.
```
warning: suboptimal pack - out of memory
Compressing objects: 100% (10955/10955), done.
fatal: Out of memory, malloc failed (tried to allocate 827101023 bytes)
error: failed to ru... | [This thread](http://git.661346.n2.nabble.com/git-gc-out-of-memory-td4005235.html) suggests
> run `git repack -adf --window=memory` on the repo where memory is escalated appropriately for your machine.
That is pretty much the same solution than for the SO question "[Repack of Git repository fails](https://stackoverfl... |
8551574 | "HEAD not found below refs/heads" after I push commit with CR/CRLF changes | 10 | 2011-12-18 12:04:27 | <p>I have local repository, and a remote bare repository. I've made changes to my local files, and other guy has made changes too, but he just sent me files. I've copy-pasted them in my local tree and committed. On commit I've got messages on files that I have copy-pasted</p>
<blockquote>
<p>LF will be replaced by C... | 12,504 | 852,399 | 2016-04-21 14:35:46 | 8,551,617 | 19 | 2011-12-18 12:12:42 | 19,563 | 2011-12-18 12:12:42 | https://stackoverflow.com/q/8551574 | https://stackoverflow.com/a/8551617 | <p>It looks like the <code>HEAD</code> on your remote is pointing to an invalid branch. You can view what it's pointing to with:</p>
<pre><code>git symbolic-ref HEAD
</code></pre>
<p>and fix it to point at a valid branch with:</p>
<pre><code>git symbolic-ref HEAD refs/heads/branch-that-exists
</code></pre>
| <p>It looks like the <code>HEAD</code> on your remote is pointing to an invalid branch. You can view what it's pointing to with:</p> <pre><code>git symbolic-ref HEAD </code></pre> <p>and fix it to point at a valid branch with:</p> <pre><code>git symbolic-ref HEAD refs/heads/branch-that-exists </code></pre> | 119 | git | <h1>"HEAD not found below refs/heads" after I push commit with CR/CRLF changes</h1>
<p>I have local repository, and a remote bare repository. I've made changes to my local files, and other guy has made changes too, but he just sent me files. I've copy-pasted them in my local tree and committed. On commit I've got messa... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,892 | git | # "HEAD not found below refs/heads" after I push commit with CR/CRLF changes
I have local repository, and a remote bare repository. I've made changes to my local files, and other guy has made changes too, but he just sent me files. I've copy-pasted them in my local tree and committed. On commit I've got messages on fi... | It looks like the `HEAD` on your remote is pointing to an invalid branch. You can view what it's pointing to with:
```
git symbolic-ref HEAD
```
and fix it to point at a valid branch with:
```
git symbolic-ref HEAD refs/heads/branch-that-exists
``` |
7374591 | Recursively include Nuget DLLs via Gitignore | 10 | 2011-09-10 20:43:58 | <p>I am using GIT with a new ASP.NET MVC project. I have a line in my gitignore file to ignore dlls </p>
<pre><code>*.dll
</code></pre>
<p>I would like to add something along the lines of the following to include (i.e. do not ignore) DLLs in my NUGET packages folder</p>
<pre><code> !/packages/*.dll
</code></pre>
<... | 2,435 | 69,032 | 2017-08-15 15:08:03 | 7,374,649 | 19 | 2011-09-10 20:53:00 | 492,405 | 2011-09-10 20:53:00 | https://stackoverflow.com/q/7374591 | https://stackoverflow.com/a/7374649 | <p>Leave your top level <code>gitignore</code> alone by keeping <code>*.dll</code> in it.</p>
<p>Create another <code>.gitignore</code> file in the packages directory and put <code>!*.dll</code> in it.</p>
| <p>Leave your top level <code>gitignore</code> alone by keeping <code>*.dll</code> in it.</p> <p>Create another <code>.gitignore</code> file in the packages directory and put <code>!*.dll</code> in it.</p> | 119, 470, 25056, 62770 | asp.net-mvc, git, gitignore, nuget | <h1>Recursively include Nuget DLLs via Gitignore</h1>
<p>I am using GIT with a new ASP.NET MVC project. I have a line in my gitignore file to ignore dlls </p>
<pre><code>*.dll
</code></pre>
<p>I would like to add something along the lines of the following to include (i.e. do not ignore) DLLs in my NUGET packages fold... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,893 | git | # Recursively include Nuget DLLs via Gitignore
I am using GIT with a new ASP.NET MVC project. I have a line in my gitignore file to ignore dlls
```
*.dll
```
I would like to add something along the lines of the following to include (i.e. do not ignore) DLLs in my NUGET packages folder
```
!/packages/*.dll
```
Th... | Leave your top level `gitignore` alone by keeping `*.dll` in it.
Create another `.gitignore` file in the packages directory and put `!*.dll` in it. |
5559321 | "fetch --all" in a git bare repository doesn't synchronize local branches to the remote ones | 10 | 2011-04-05 22:27:05 | <p>I'm trying to synchronize periodically a git bare repository, my local branches are created using the "--track" option. here is my config (without unnecessary things):</p>
<pre><code>[core]
bare = true
[remote "origin"]
url = git@github.com:Ummon/D-LAN.git
fetch = +refs/heads/*:refs/remotes/... | 12,274 | 212,675 | 2018-04-04 19:04:59 | 5,559,586 | 19 | 2011-04-05 23:02:46 | 85,371 | 2014-01-13 15:18:39 | https://stackoverflow.com/q/5559321 | https://stackoverflow.com/a/5559586 | <p>Instead of copying the ref files around (bad bad!) use <code>git update-ref</code></p>
<p>Note that you can have what you wanted pretty easily to a bare repository when pushing instead of pulling.</p>
<p>Use this:</p>
<pre><code> git clone --mirror . /tmp/bareclone
</code></pre>
<p>to create the bare repository ... | <p>Instead of copying the ref files around (bad bad!) use <code>git update-ref</code></p> <p>Note that you can have what you wanted pretty easily to a bare repository when pushing instead of pulling.</p> <p>Use this:</p> <pre><code> git clone --mirror . /tmp/bareclone </code></pre> <p>to create the bare repository ... | 119, 33720, 64465 | git, git-bare, git-fetch | <h1>"fetch --all" in a git bare repository doesn't synchronize local branches to the remote ones</h1>
<p>I'm trying to synchronize periodically a git bare repository, my local branches are created using the "--track" option. here is my config (without unnecessary things):</p>
<pre><code>[core]
bare = true
[rem... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,894 | git | # "fetch --all" in a git bare repository doesn't synchronize local branches to the remote ones
I'm trying to synchronize periodically a git bare repository, my local branches are created using the "--track" option. here is my config (without unnecessary things):
```
[core]
bare = true
[remote "origin"]
... | Instead of copying the ref files around (bad bad!) use `git update-ref`
Note that you can have what you wanted pretty easily to a bare repository when pushing instead of pulling.
Use this:
```
git clone --mirror . /tmp/bareclone
```
to create the bare repository that you want to keep completely in synch
Now, to sy... |
4121631 | Am I misunderstanding git cherry-pick? | 10 | 2010-11-08 06:05:16 | <p>On reading the man page for git cherry-pick, my understanding is that it takes just the changes introduced by one commit, and you can then apply these changes pretty much anywhere.</p>
<p>So let's say I have a file that I build up over 4 commits like so:</p>
<pre><code>line from commit 1
line from commit 2
line fr... | 3,553 | 500,304 | 2010-11-08 06:16:32 | 4,121,669 | 19 | 2010-11-08 06:16:32 | 119,963 | 2010-11-08 06:16:32 | https://stackoverflow.com/q/4121631 | https://stackoverflow.com/a/4121669 | <p>The problem here isn't that git's actually <em>trying</em> to insert content from commits 2 and 3, it's that the content from commit 4 is intertwined with that from commits 2 and 3. The patch for commit 4 looks something like this:</p>
<pre><code> line from commit 1
line from commit 2
line from commit 3
+line fro... | <p>The problem here isn't that git's actually <em>trying</em> to insert content from commits 2 and 3, it's that the content from commit 4 is intertwined with that from commits 2 and 3. The patch for commit 4 looks something like this:</p> <pre><code> line from commit 1 line from commit 2 line from commit 3 +line fro... | 119 | git | <h1>Am I misunderstanding git cherry-pick?</h1>
<p>On reading the man page for git cherry-pick, my understanding is that it takes just the changes introduced by one commit, and you can then apply these changes pretty much anywhere.</p>
<p>So let's say I have a file that I build up over 4 commits like so:</p>
<pre><co... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,895 | git | # Am I misunderstanding git cherry-pick?
On reading the man page for git cherry-pick, my understanding is that it takes just the changes introduced by one commit, and you can then apply these changes pretty much anywhere.
So let's say I have a file that I build up over 4 commits like so:
```
line from commit 1
line ... | The problem here isn't that git's actually *trying* to insert content from commits 2 and 3, it's that the content from commit 4 is intertwined with that from commits 2 and 3. The patch for commit 4 looks something like this:
```
line from commit 1
line from commit 2
line from commit 3
+line from commit 4
```
(exce... |
31275868 | What git branch should I commit unit tests to? | 9 | 2015-07-07 17:50:07 | <p>I'm currently following the ever-popular git workflow described <a href="http://nvie.com/posts/a-successful-git-branching-model/" rel="noreferrer">here</a>.</p>
<p>One thing it doesn't discuss is how to handle unit testing. Let's say I write some code and commit to <code>develop</code>. I want to write a test for i... | 5,659 | 4,761,302 | 2015-07-08 06:46:49 | 31,275,969 | 19 | 2015-07-07 17:55:51 | 1,426,891 | 2015-07-07 17:55:51 | https://stackoverflow.com/q/31275868 | https://stackoverflow.com/a/31275969 | <p>Unit tests are part of your source tree: They evolve as your code evolves, and feature branches have their own unit tests that evolve as the features evolve. There's no reason to keep them in a separate branch.</p>
<p>Note that <code>git log</code> accepts a path parameter, so if you want to avoid seeing test-only ... | <p>Unit tests are part of your source tree: They evolve as your code evolves, and feature branches have their own unit tests that evolve as the features evolve. There's no reason to keep them in a separate branch.</p> <p>Note that <code>git log</code> accepts a path parameter, so if you want to avoid seeing test-only ... | 119, 456, 1931, 64339 | git, git-flow, unit-testing, version-control | <h1>What git branch should I commit unit tests to?</h1>
<p>I'm currently following the ever-popular git workflow described <a href="http://nvie.com/posts/a-successful-git-branching-model/" rel="noreferrer">here</a>.</p>
<p>One thing it doesn't discuss is how to handle unit testing. Let's say I write some code and comm... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,898 | git | # What git branch should I commit unit tests to?
I'm currently following the ever-popular git workflow described [here](http://nvie.com/posts/a-successful-git-branching-model/).
One thing it doesn't discuss is how to handle unit testing. Let's say I write some code and commit to `develop`. I want to write a test for ... | Unit tests are part of your source tree: They evolve as your code evolves, and feature branches have their own unit tests that evolve as the features evolve. There's no reason to keep them in a separate branch.
Note that `git log` accepts a path parameter, so if you want to avoid seeing test-only log entries, you can ... |
29937881 | Git pre-push hook not working | 9 | 2015-04-29 08:09:47 | <p>I have placed a file inside .git/hooks named pre-push.sh</p>
<p>I am not making any check, just want to echo some error while pushing to the remote. Below is the .sh file content</p>
<pre><code>protected_branch='test'
echo $protected_branch
exit 1
</code></pre>
<p>However it is still allowing to push changes with... | 9,959 | 4,715,988 | 2023-05-11 19:41:29 | 29,938,130 | 19 | 2015-04-29 08:21:58 | 86,072 | 2023-05-11 19:41:29 | https://stackoverflow.com/q/29937881 | https://stackoverflow.com/a/29938130 | <p>The name of the hook must be exactly <code>pre-push</code> (not <code>pre-push.sh</code>, not <code>pre-push.exe</code>, not <code>pre-push.py</code> ...)</p>
<p>Also: the hook should be executable, otherwise it will be ignored</p>
<pre><code>chmod u+x .git/hooks/pre-push
</code></pre>
| <p>The name of the hook must be exactly <code>pre-push</code> (not <code>pre-push.sh</code>, not <code>pre-push.exe</code>, not <code>pre-push.py</code> ...)</p> <p>Also: the hook should be executable, otherwise it will be ignored</p> <pre><code>chmod u+x .git/hooks/pre-push </code></pre> | 119 | git | <h1>Git pre-push hook not working</h1>
<p>I have placed a file inside .git/hooks named pre-push.sh</p>
<p>I am not making any check, just want to echo some error while pushing to the remote. Below is the .sh file content</p>
<pre><code>protected_branch='test'
echo $protected_branch
exit 1
</code></pre>
<p>However it... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,899 | git | # Git pre-push hook not working
I have placed a file inside .git/hooks named pre-push.sh
I am not making any check, just want to echo some error while pushing to the remote. Below is the .sh file content
```
protected_branch='test'
echo $protected_branch
exit 1
```
However it is still allowing to push changes witho... | The name of the hook must be exactly `pre-push` (not `pre-push.sh`, not `pre-push.exe`, not `pre-push.py` ...)
Also: the hook should be executable, otherwise it will be ignored
```
chmod u+x .git/hooks/pre-push
``` |
28832815 | Git commands require sudo on OSX | 9 | 2015-03-03 13:17:29 | <p>I've moved back from my work MBP to my home MBP. The work one allowed to run git commands without the need for sudo. But I'm finding this is a requirement on my home machine.</p>
<p>I would prefer to be able to run <code>git</code> commands without <code>sudo</code>.</p>
<p>I looked at the git commands in <code>/usr... | 11,252 | 138,863 | 2021-10-20 09:50:23 | 28,832,942 | 19 | 2015-03-03 13:23:11 | 69,755 | 2015-03-03 13:23:11 | https://stackoverflow.com/q/28832815 | https://stackoverflow.com/a/28832942 | <p>The permission on the <code>git</code> executable are fine; there is no reason you should need to change that, or change your group.</p>
<p>It's more likely that the permissions on your Git checkout are wrong. If you accidentally checked it out with something like <code>sudo git clone ssh://user@host/project.git</c... | <p>The permission on the <code>git</code> executable are fine; there is no reason you should need to change that, or change your group.</p> <p>It's more likely that the permissions on your Git checkout are wrong. If you accidentally checked it out with something like <code>sudo git clone ssh://user@host/project.git</c... | 119, 369, 1674 | git, macos, sudo | <h1>Git commands require sudo on OSX</h1>
<p>I've moved back from my work MBP to my home MBP. The work one allowed to run git commands without the need for sudo. But I'm finding this is a requirement on my home machine.</p>
<p>I would prefer to be able to run <code>git</code> commands without <code>sudo</code>.</p>
<p>... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,901 | git | # Git commands require sudo on OSX
I've moved back from my work MBP to my home MBP. The work one allowed to run git commands without the need for sudo. But I'm finding this is a requirement on my home machine.
I would prefer to be able to run `git` commands without `sudo`.
I looked at the git commands in `/usr/bin`,... | The permission on the `git` executable are fine; there is no reason you should need to change that, or change your group.
It's more likely that the permissions on your Git checkout are wrong. If you accidentally checked it out with something like `sudo git clone ssh://user@host/project.git`, or at some point you perfo... |
22525906 | git clone from bitbucket.org is not working by https | 9 | 2014-03-20 07:11:56 | <p>I am facing the same problem as <a href="https://stackoverflow.com/questions/18928722/i-cant-clone-a-bitbucket-repository-using-terminal">Could not resolve host: bitbucket.org; nodename nor servname provided, or not known</a>. I have tried ip address given in comment, but it also gave the same message. Please, help ... | 20,274 | 3,436,941 | 2023-12-25 15:32:49 | 25,981,431 | 19 | 2014-09-22 19:07:42 | 1,561,764 | 2023-12-25 15:32:49 | https://stackoverflow.com/q/22525906 | https://stackoverflow.com/a/25981431 | <p>Sometimes we make mistakes configuring our proxy.
Maybe this can help, reset your proxy.</p>
<pre><code>git config --global --unset http.proxy
git config --global --unset https.proxy
</code></pre>
<p>or one liner</p>
<pre><code>git config --global --unset http.proxy https.proxy
</code></pre>
| <p>Sometimes we make mistakes configuring our proxy. Maybe this can help, reset your proxy.</p> <pre><code>git config --global --unset http.proxy git config --global --unset https.proxy </code></pre> <p>or one liner</p> <pre><code>git config --global --unset http.proxy https.proxy </code></pre> | 119, 3050, 8337 | bitbucket, clone, git | <h1>git clone from bitbucket.org is not working by https</h1>
<p>I am facing the same problem as <a href="https://stackoverflow.com/questions/18928722/i-cant-clone-a-bitbucket-repository-using-terminal">Could not resolve host: bitbucket.org; nodename nor servname provided, or not known</a>. I have tried ip address give... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,902 | git | # git clone from bitbucket.org is not working by https
I am facing the same problem as [Could not resolve host: bitbucket.org; nodename nor servname provided, or not known](https://stackoverflow.com/questions/18928722/i-cant-clone-a-bitbucket-repository-using-terminal). I have tried ip address given in comment, but it... | Sometimes we make mistakes configuring our proxy.
Maybe this can help, reset your proxy.
```
git config --global --unset http.proxy
git config --global --unset https.proxy
```
or one liner
```
git config --global --unset http.proxy https.proxy
``` |
14410733 | Git modify contents of index directly for pre-commit formatting hook | 9 | 2013-01-19 03:10:41 | <p>I would like to automatically format my files before they are added to Git's index. Right now, I have a pre-commit hook that looks like this:</p>
<pre><code>#!/bin/bash
set -e
exec 1>&2
workingext="working.$$"
ext="bak.$$"
git diff -z --cached --name-only | egrep -z '\.(pl|pm|t)$' | \
while read -d... | 3,209 | 207,384 | 2016-02-02 09:21:25 | 14,415,123 | 19 | 2013-01-19 14:02:40 | 758,345 | 2016-02-02 09:21:25 | https://stackoverflow.com/q/14410733 | https://stackoverflow.com/a/14415123 | <p>Yes, that’s possible. First, you need to create a blob from your file by running this command:</p>
<pre><code>git hash-object -w foo.pl.tmp
</code></pre>
<p>See here: <a href="http://www.kernel.org/pub/software/scm/git/docs/git-hash-object.html" rel="noreferrer">http://www.kernel.org/pub/software/scm/git/docs/git-... | <p>Yes, that’s possible. First, you need to create a blob from your file by running this command:</p> <pre><code>git hash-object -w foo.pl.tmp </code></pre> <p>See here: <a href="http://www.kernel.org/pub/software/scm/git/docs/git-hash-object.html" rel="noreferrer">http://www.kernel.org/pub/software/scm/git/docs/git-... | 119, 4162, 43087 | code-formatting, git, githooks | <h1>Git modify contents of index directly for pre-commit formatting hook</h1>
<p>I would like to automatically format my files before they are added to Git's index. Right now, I have a pre-commit hook that looks like this:</p>
<pre><code>#!/bin/bash
set -e
exec 1>&2
workingext="working.$$"
ext="bak.$$"
git di... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,903 | git | # Git modify contents of index directly for pre-commit formatting hook
I would like to automatically format my files before they are added to Git's index. Right now, I have a pre-commit hook that looks like this:
```
#!/bin/bash
set -e
exec 1>&2
workingext="working.$$"
ext="bak.$$"
git diff -z --cached --name-only ... | Yes, that’s possible. First, you need to create a blob from your file by running this command:
```
git hash-object -w foo.pl.tmp
```
See here: <http://www.kernel.org/pub/software/scm/git/docs/git-hash-object.html>
> Computes the object ID value for an object with specified type with the contents of the named file (w... |
11764148 | How to get my git-integrated Kaleidoscope to display all files that are about to be committed? | 9 | 2012-08-01 17:06:26 | <p>I'm using command-line git and <a href="http://www.kaleidoscopeapp.com/" rel="nofollow noreferrer">Kaleidoscope</a> to perform my code reviews. When I merge a branch into another and type</p>
<pre><code>git difftool
</code></pre>
<p>Kaleidoscope only displays changes that are 'not staged for commit' and don't displa... | 6,342 | 455,016 | 2022-09-07 10:07:45 | 11,765,774 | 19 | 2012-08-01 19:00:45 | 315,346 | 2012-08-01 19:07:18 | https://stackoverflow.com/q/11764148 | https://stackoverflow.com/a/11765774 | <p>Short answer: what you want to be typing on the command line is <code>git difftool HEAD</code>, not <code>git difftool</code>.</p>
<p>Long answer: This is normal git behavior, and it's kind of frustrating if you don't realize what's happening. I'm not sure why the command-line diff is working as you expect, but bo... | <p>Short answer: what you want to be typing on the command line is <code>git difftool HEAD</code>, not <code>git difftool</code>.</p> <p>Long answer: This is normal git behavior, and it's kind of frustrating if you don't realize what's happening. I'm not sure why the command-line diff is working as you expect, but bo... | 119, 606 | diff, git | <h1>How to get my git-integrated Kaleidoscope to display all files that are about to be committed?</h1>
<p>I'm using command-line git and <a href="http://www.kaleidoscopeapp.com/" rel="nofollow noreferrer">Kaleidoscope</a> to perform my code reviews. When I merge a branch into another and type</p>
<pre><code>git diffto... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,904 | git | # How to get my git-integrated Kaleidoscope to display all files that are about to be committed?
I'm using command-line git and [Kaleidoscope](http://www.kaleidoscopeapp.com/) to perform my code reviews. When I merge a branch into another and type
```
git difftool
```
Kaleidoscope only displays changes that are 'not... | Short answer: what you want to be typing on the command line is `git difftool HEAD`, not `git difftool`.
Long answer: This is normal git behavior, and it's kind of frustrating if you don't realize what's happening. I'm not sure why the command-line diff is working as you expect, but both `git diff` and `git difftool` ... |
11625746 | Git delete a file with space in name | 9 | 2012-07-24 07:04:18 | <p>I have added a file and also committed <code>webpageone fresh.rhtml</code>. I left a space in the name. When I a try to remove it, using:</p>
<pre><code>git rm -f /webpageone fresh.rhtml
</code></pre>
<p>I get this error:</p>
<pre><code>pathspec '/webpageone' did not match any files.
</code></pre>
<p>I tried rem... | 11,886 | 1,547,810 | 2024-02-06 17:58:40 | 11,625,790 | 19 | 2012-07-24 07:08:13 | 1,402,641 | 2012-07-24 07:08:13 | https://stackoverflow.com/q/11625746 | https://stackoverflow.com/a/11625790 | <p>That's a shell problem, not a git problem. You need to escape the space. This should work:</p>
<pre><code>git rm -f /webpageone\ fresh.rhtml
</code></pre>
<p>I guess this should also work:</p>
<pre><code>git rm -f "/webpageone fresh.rhtml"
</code></pre>
| <p>That's a shell problem, not a git problem. You need to escape the space. This should work:</p> <pre><code>git rm -f /webpageone\ fresh.rhtml </code></pre> <p>I guess this should also work:</p> <pre><code>git rm -f "/webpageone fresh.rhtml" </code></pre> | 119 | git | <h1>Git delete a file with space in name</h1>
<p>I have added a file and also committed <code>webpageone fresh.rhtml</code>. I left a space in the name. When I a try to remove it, using:</p>
<pre><code>git rm -f /webpageone fresh.rhtml
</code></pre>
<p>I get this error:</p>
<pre><code>pathspec '/webpageone' did not ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,905 | git | # Git delete a file with space in name
I have added a file and also committed `webpageone fresh.rhtml`. I left a space in the name. When I a try to remove it, using:
```
git rm -f /webpageone fresh.rhtml
```
I get this error:
```
pathspec '/webpageone' did not match any files.
```
I tried removing another file and... | That's a shell problem, not a git problem. You need to escape the space. This should work:
```
git rm -f /webpageone\ fresh.rhtml
```
I guess this should also work:
```
git rm -f "/webpageone fresh.rhtml"
``` |
10804017 | extract all files changed in a git commit | 9 | 2012-05-29 17:38:07 | <p>I need to make a patch for someone (they are not using git) - a zip of the files changed by a commit.</p>
<p>I thought something like </p>
<p>git archive --format=zip commitguid > myfiles.zip</p>
<p>but this extracts the entire thing, not just the changed files. Is there any way to do this?
And to make it more c... | 7,747 | 107,565 | 2019-10-10 10:34:53 | 10,804,078 | 19 | 2012-05-29 17:43:14 | 148,870 | 2012-05-29 17:43:14 | https://stackoverflow.com/q/10804017 | https://stackoverflow.com/a/10804078 | <pre><code>git diff --name-only <oldsha> <newsha> | zip dest.zip -@
</code></pre>
<p>filling in the proper SHAs/refs. For instance, to create a zip of only the files that changed between the <code>master</code> and <code>feature</code> branches:</p>
<pre><code>git diff --name-only master feature | zip des... | <pre><code>git diff --name-only <oldsha> <newsha> | zip dest.zip -@ </code></pre> <p>filling in the proper SHAs/refs. For instance, to create a zip of only the files that changed between the <code>master</code> and <code>feature</code> branches:</p> <pre><code>git diff --name-only master feature | zip des... | 64, 119 | git, windows | <h1>extract all files changed in a git commit</h1>
<p>I need to make a patch for someone (they are not using git) - a zip of the files changed by a commit.</p>
<p>I thought something like </p>
<p>git archive --format=zip commitguid > myfiles.zip</p>
<p>but this extracts the entire thing, not just the changed files. ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,906 | git | # extract all files changed in a git commit
I need to make a patch for someone (they are not using git) - a zip of the files changed by a commit.
I thought something like
git archive --format=zip commitguid > myfiles.zip
but this extracts the entire thing, not just the changed files. Is there any way to do this?
An... | ```
git diff --name-only <oldsha> <newsha> | zip dest.zip -@
```
filling in the proper SHAs/refs. For instance, to create a zip of only the files that changed between the `master` and `feature` branches:
```
git diff --name-only master feature | zip dest.zip -@
``` |
10606101 | Automatically Add All Submodules to a Repo | 9 | 2012-05-15 17:47:00 | <p>I have a big Directory <code>~/.vim</code> and in it I have a subdirectory with many other git repos in it. I want to make a git repo of my <code>~/.vim</code> directory though, but don't want to go through each of my other git subdirectories. </p>
<p>Is there any way of just recursively going through and adding al... | 5,685 | 763,116 | 2023-02-09 18:07:04 | 10,607,225 | 19 | 2012-05-15 19:07:13 | 462,233 | 2018-04-13 17:10:43 | https://stackoverflow.com/q/10606101 | https://stackoverflow.com/a/10607225 | <p><strong>Suppose</strong> that .vim is already <strong>a valid git repo</strong> and your want to add all git repos to your main git repo, then the for loop below is probably what you need:</p>
<p>First, <code>cd</code> to the root of <strong>your</strong> git repository.</p>
<p>Paste-able preview command- echo onl... | <p><strong>Suppose</strong> that .vim is already <strong>a valid git repo</strong> and your want to add all git repos to your main git repo, then the for loop below is probably what you need:</p> <p>First, <code>cd</code> to the root of <strong>your</strong> git repository.</p> <p>Paste-able preview command- echo onl... | 119, 41612 | git, git-submodules | <h1>Automatically Add All Submodules to a Repo</h1>
<p>I have a big Directory <code>~/.vim</code> and in it I have a subdirectory with many other git repos in it. I want to make a git repo of my <code>~/.vim</code> directory though, but don't want to go through each of my other git subdirectories. </p>
<p>Is there any... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,907 | git | # Automatically Add All Submodules to a Repo
I have a big Directory `~/.vim` and in it I have a subdirectory with many other git repos in it. I want to make a git repo of my `~/.vim` directory though, but don't want to go through each of my other git subdirectories.
Is there any way of just recursively going through ... | **Suppose** that .vim is already **a valid git repo** and your want to add all git repos to your main git repo, then the for loop below is probably what you need:
First, `cd` to the root of **your** git repository.
Paste-able preview command- echo only, won't make any changes:
```
for x in $(find . -type d) ; do if ... |
5518576 | Make IntelliJ IDEA use public key authentication on Windows | 9 | 2011-04-01 20:37:23 | <p>I'm an Eclipse user who's evaluating a switch to IntelliJ IDEA. I'm currently trying out IDEA 10.0.2. My operating system is Windows.</p>
<p>When working with Git over SSH, IDEA always asks me for password. I can't find any option in the settings to make it use public key authentication. As per <a href="http://blog... | 20,538 | 58,099 | 2019-04-29 18:14:22 | 5,518,771 | 19 | 2011-04-01 20:56:53 | 104,891 | 2011-04-01 21:04:08 | https://stackoverflow.com/q/5518576 | https://stackoverflow.com/a/5518771 | <p>If your command line git uses public key auth, the same should work from IDEA. In the IDEA VCS settings switch SSH implementation from <code>IDEA ssh</code> to <code>native</code> so that the same SSH is used as when running command line git.</p>
| <p>If your command line git uses public key auth, the same should work from IDEA. In the IDEA VCS settings switch SSH implementation from <code>IDEA ssh</code> to <code>native</code> so that the same SSH is used as when running command line git.</p> | 119, 386, 8945, 57931 | git, intellij-idea, public-key, ssh | <h1>Make IntelliJ IDEA use public key authentication on Windows</h1>
<p>I'm an Eclipse user who's evaluating a switch to IntelliJ IDEA. I'm currently trying out IDEA 10.0.2. My operating system is Windows.</p>
<p>When working with Git over SSH, IDEA always asks me for password. I can't find any option in the settings ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,908 | git | # Make IntelliJ IDEA use public key authentication on Windows
I'm an Eclipse user who's evaluating a switch to IntelliJ IDEA. I'm currently trying out IDEA 10.0.2. My operating system is Windows.
When working with Git over SSH, IDEA always asks me for password. I can't find any option in the settings to make it use p... | If your command line git uses public key auth, the same should work from IDEA. In the IDEA VCS settings switch SSH implementation from `IDEA ssh` to `native` so that the same SSH is used as when running command line git. |
5380634 | What is wrong with this git smudge/clean filter? | 9 | 2011-03-21 16:33:18 | <p>I want to apply this filter in my git repository to remove a section from a solution file during checkout and to add this section during commit.</p>
<p>This is the section i want to remove or add:</p>
<pre><code>GlobalSection(SubversionScc) = preSolution
Svn-Managed = True
Manager = AnkhSVN - Subversion Su... | 7,776 | 114,798 | 2011-03-24 02:00:46 | 5,389,872 | 19 | 2011-03-22 10:31:55 | 193,688 | 2011-03-24 02:00:46 | https://stackoverflow.com/q/5380634 | https://stackoverflow.com/a/5389872 | <p>I see a few issues here:</p>
<ol>
<li><p>You have <code>%</code> at the end of both filters.<br>
This has no special meaning and will be passed as an extra argument to <em>sed</em>, which will probably generate an error (unless you have a file named <code>%</code>).<br>
Filters should be “streaming” (read from stdi... | <p>I see a few issues here:</p> <ol> <li><p>You have <code>%</code> at the end of both filters.<br> This has no special meaning and will be passed as an extra argument to <em>sed</em>, which will probably generate an error (unless you have a file named <code>%</code>).<br> Filters should be “streaming” (read from stdi... | 119, 5282, 10052, 56102 | filter, git, gitattributes, sed | <h1>What is wrong with this git smudge/clean filter?</h1>
<p>I want to apply this filter in my git repository to remove a section from a solution file during checkout and to add this section during commit.</p>
<p>This is the section i want to remove or add:</p>
<pre><code>GlobalSection(SubversionScc) = preSolution
... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,909 | git | # What is wrong with this git smudge/clean filter?
I want to apply this filter in my git repository to remove a section from a solution file during checkout and to add this section during commit.
This is the section i want to remove or add:
```
GlobalSection(SubversionScc) = preSolution
Svn-Managed = True
Ma... | I see a few issues here:
1. You have `%` at the end of both filters.
This has no special meaning and will be passed as an extra argument to *sed*, which will probably generate an error (unless you have a file named `%`).
Filters should be “streaming” (read from stdin and write to stdout). Their definition ca... |
550787 | Can't git fetch through SSH | 9 | 2009-02-15 12:14:29 | <p>I've setup a git repository one a remote server. Now I'm trying to checkout from it with:</p>
<pre><code>git fetch ssh://username@url.com/~username/workfolder/
</code></pre>
<p>but I get an error:</p>
<pre><code>fatal: Not a git repository
</code></pre>
<p>What am I doing wrong? Could it be the server does not s... | 27,640 | 58,521 | 2010-05-07 02:30:26 | 550,801 | 19 | 2009-02-15 12:25:59 | 46,460 | 2009-02-15 17:43:17 | https://stackoverflow.com/q/550787 | https://stackoverflow.com/a/550801 | <p>Try </p>
<pre><code>git clone ssh://username@url.com/~username/workfolder/
</code></pre>
<p>Which will create the repository on your local machine. Any commits you make to that branch are to your local repository, and when you want to push back up to the remote server you can run:</p>
<pre><code>git push ssh://us... | <p>Try </p> <pre><code>git clone ssh://username@url.com/~username/workfolder/ </code></pre> <p>Which will create the repository on your local machine. Any commits you make to that branch are to your local repository, and when you want to push back up to the remote server you can run:</p> <pre><code>git push ssh://us... | 119, 386, 456 | git, ssh, version-control | <h1>Can't git fetch through SSH</h1>
<p>I've setup a git repository one a remote server. Now I'm trying to checkout from it with:</p>
<pre><code>git fetch ssh://username@url.com/~username/workfolder/
</code></pre>
<p>but I get an error:</p>
<pre><code>fatal: Not a git repository
</code></pre>
<p>What am I doing wro... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,910 | git | # Can't git fetch through SSH
I've setup a git repository one a remote server. Now I'm trying to checkout from it with:
```
git fetch ssh://username@url.com/~username/workfolder/
```
but I get an error:
```
fatal: Not a git repository
```
What am I doing wrong? Could it be the server does not support Git+SSH? | Try
```
git clone ssh://username@url.com/~username/workfolder/
```
Which will create the repository on your local machine. Any commits you make to that branch are to your local repository, and when you want to push back up to the remote server you can run:
```
git push ssh://username@url.com/~username/workfolder/
``... |
55963836 | How to run swiftlint for git diff files only | 8 | 2019-05-03 05:38:11 | <p>I am working on an iOS Swift project. Git is being used for version controlling. I want to run <code>swiftlint</code> tool only for newly changed files. On other words, I want to check static issues only for the files that have been edited till last commit. If possible, I will add the script in <code>Build phase -&g... | 4,441 | 1,084,174 | 2023-05-17 02:04:56 | 55,963,837 | 19 | 2019-05-03 05:38:11 | 1,084,174 | 2019-05-15 21:36:06 | https://stackoverflow.com/q/55963836 | https://stackoverflow.com/a/55963837 | <p>Adding this below command in Build phase - run script will be helpful.</p>
<p>Below code will work for staged files</p>
<pre><code>git diff --cached --name-only | grep "\.swift" | while read filename; do
swiftlint lint --path "$filename";
done
</code></pre>
<p>For unstaged files you need to remove <code>--cac... | <p>Adding this below command in Build phase - run script will be helpful.</p> <p>Below code will work for staged files</p> <pre><code>git diff --cached --name-only | grep "\.swift" | while read filename; do swiftlint lint --path "$filename"; done </code></pre> <p>For unstaged files you need to remove <code>--cac... | 119, 456, 104797, 118277 | git, swift, swiftlint, version-control | <h1>How to run swiftlint for git diff files only</h1>
<p>I am working on an iOS Swift project. Git is being used for version controlling. I want to run <code>swiftlint</code> tool only for newly changed files. On other words, I want to check static issues only for the files that have been edited till last commit. If po... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,912 | git | # How to run swiftlint for git diff files only
I am working on an iOS Swift project. Git is being used for version controlling. I want to run `swiftlint` tool only for newly changed files. On other words, I want to check static issues only for the files that have been edited till last commit. If possible, I will add t... | Adding this below command in Build phase - run script will be helpful.
Below code will work for staged files
```
git diff --cached --name-only | grep "\.swift" | while read filename; do
swiftlint lint --path "$filename";
done
```
For unstaged files you need to remove `--cached` argument
```
git diff --name-only... |
48490000 | How to ignore merge conflict? | 8 | 2018-01-28 18:41:37 | <p>I have next merge conflict:</p>
<pre><code><<<<<<< Updated upstream
my( $c, $name ) = (shift,shift);
my %name = defined $name ? ( name => $name ) : ();
||||||| merged common ancestors
my( $c ) = shift;
=======
my( $c, $name ) = (shift,shift);
my %name = defined $name ?... | 51,500 | 4,632,019 | 2024-06-10 20:35:45 | 48,491,107 | 19 | 2018-01-28 20:46:10 | 2,722,336 | 2020-03-08 15:01:46 | https://stackoverflow.com/q/48490000 | https://stackoverflow.com/a/48491107 | <p>Well, you can not ignore conflicts, because that means that something is wrong, and you have to tell Git that you fixed the conflict.</p>
<p>If you really want to keep the file as-is, you can remove the conflict diff lines, and then git add / git commit the files that were in conflict so that you keep all lines of ... | <p>Well, you can not ignore conflicts, because that means that something is wrong, and you have to tell Git that you fixed the conflict.</p> <p>If you really want to keep the file as-is, you can remove the conflict diff lines, and then git add / git commit the files that were in conflict so that you keep all lines of ... | 119, 62599 | git, merge-conflict-resolution | <h1>How to ignore merge conflict?</h1>
<p>I have next merge conflict:</p>
<pre><code><<<<<<< Updated upstream
my( $c, $name ) = (shift,shift);
my %name = defined $name ? ( name => $name ) : ();
||||||| merged common ancestors
my( $c ) = shift;
=======
my( $c, $name ) = (shift... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,913 | git | # How to ignore merge conflict?
I have next merge conflict:
```
<<<<<<< Updated upstream
my( $c, $name ) = (shift,shift);
my %name = defined $name ? ( name => $name ) : ();
||||||| merged common ancestors
my( $c ) = shift;
=======
my( $c, $name ) = (shift,shift);
my %name = defined $name ? ( na... | Well, you can not ignore conflicts, because that means that something is wrong, and you have to tell Git that you fixed the conflict.
If you really want to keep the file as-is, you can remove the conflict diff lines, and then git add / git commit the files that were in conflict so that you keep all lines of the file.
... |
41356766 | unknown option `allow-unrelated-histories' | 8 | 2016-12-28 06:48:16 | <p>I have two repos: Market and Android. When I merge Android to Market use these steps:</p>
<pre><code>cd market
git remote add android ../android
git fetch android
git merge --allow-unrelated-histories android/master
</code></pre>
<p>But I get this error:</p>
<blockquote>
<p>ei@localhost:~/market$ git merge --al... | 13,634 | 6,521,116 | 2019-09-03 12:40:59 | 41,357,503 | 19 | 2016-12-28 07:38:29 | 6,309 | 2018-03-12 21:53:23 | https://stackoverflow.com/q/41356766 | https://stackoverflow.com/a/41357503 | <p>I documented before how that option has been introduced in <a href="https://stackoverflow.com/a/36528527/6309">Git 2.9, June 2016</a> (as mentioned by <a href="https://stackoverflow.com/users/391161/merlin2011">merlin2011</a> in <a href="https://stackoverflow.com/questions/41356766/unknown-option-allow-unrelated-his... | <p>I documented before how that option has been introduced in <a href="https://stackoverflow.com/a/36528527/6309">Git 2.9, June 2016</a> (as mentioned by <a href="https://stackoverflow.com/users/391161/merlin2011">merlin2011</a> in <a href="https://stackoverflow.com/questions/41356766/unknown-option-allow-unrelated-his... | 119, 456, 1386, 1879, 28897 | android, branch, git, git-merge, version-control | <h1>unknown option `allow-unrelated-histories'</h1>
<p>I have two repos: Market and Android. When I merge Android to Market use these steps:</p>
<pre><code>cd market
git remote add android ../android
git fetch android
git merge --allow-unrelated-histories android/master
</code></pre>
<p>But I get this error:</p>
<bl... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,914 | git | # unknown option `allow-unrelated-histories'
I have two repos: Market and Android. When I merge Android to Market use these steps:
```
cd market
git remote add android ../android
git fetch android
git merge --allow-unrelated-histories android/master
```
But I get this error:
> ei@localhost:~/market$ git merge --all... | I documented before how that option has been introduced in [Git 2.9, June 2016](https://stackoverflow.com/a/36528527/6309) (as mentioned by [merlin2011](https://stackoverflow.com/users/391161/merlin2011) in [the comments](https://stackoverflow.com/questions/41356766/unknown-option-allow-unrelated-histories/41357503#com... |
26936545 | Cloning a Git repo into a new repo - without commit history | 8 | 2014-11-14 18:28:33 | <p>So I'm trying to get my head around Git, and have the need (why I have this need I won't go into) to be able to take the files from one repo, via command line, and put them into a brand new repository WITHOUT taking all of the previous commit history with it. </p>
<p>What I'm trying to do at the moment is <code>gi... | 8,673 | 297,243 | 2018-07-20 15:37:50 | 26,936,694 | 19 | 2014-11-14 18:37:49 | 4,072,522 | 2018-07-20 15:37:50 | https://stackoverflow.com/q/26936545 | https://stackoverflow.com/a/26936694 | <p>You can clone the old repository like:</p>
<pre><code>git clone git@bitbucket.org:username/repository.git
</code></pre>
<p>and then you delete the git directory:</p>
<pre><code>rm -rf .git/
</code></pre>
<p>Now you create the new repository:</p>
<pre><code>git init
</code></pre>
| <p>You can clone the old repository like:</p> <pre><code>git clone git@bitbucket.org:username/repository.git </code></pre> <p>and then you delete the git directory:</p> <pre><code>rm -rf .git/ </code></pre> <p>Now you create the new repository:</p> <pre><code>git init </code></pre> | 119, 1231, 8337 | bitbucket, command-line, git | <h1>Cloning a Git repo into a new repo - without commit history</h1>
<p>So I'm trying to get my head around Git, and have the need (why I have this need I won't go into) to be able to take the files from one repo, via command line, and put them into a brand new repository WITHOUT taking all of the previous commit histo... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,915 | git | # Cloning a Git repo into a new repo - without commit history
So I'm trying to get my head around Git, and have the need (why I have this need I won't go into) to be able to take the files from one repo, via command line, and put them into a brand new repository WITHOUT taking all of the previous commit history with i... | You can clone the old repository like:
```
git clone git@bitbucket.org:username/repository.git
```
and then you delete the git directory:
```
rm -rf .git/
```
Now you create the new repository:
```
git init
``` |
19092333 | Add a tag in remote repository without adding the repo on local | 8 | 2013-09-30 10:49:42 | <p>Do have anyway to add a tag in remote repository without cloning/adding it on local. I just need to do it for marking QA builds</p>
| 3,658 | 1,185,665 | 2024-06-12 15:11:50 | 19,468,911 | 19 | 2013-10-19 17:28:43 | 202,443 | 2019-02-19 11:17:41 | https://stackoverflow.com/q/19092333 | https://stackoverflow.com/a/19468911 | <p>You can create a remote tag having no local tags at all with</p>
<pre><code>git push origin HEAD:refs/tags/foo
</code></pre>
<p>You can remove the same tag with </p>
<pre><code>git push origin :refs/tags/foo
</code></pre>
<p>Here's an explanation.</p>
<p>Take the command <code>git push</code>. Without being too... | <p>You can create a remote tag having no local tags at all with</p> <pre><code>git push origin HEAD:refs/tags/foo </code></pre> <p>You can remove the same tag with </p> <pre><code>git push origin :refs/tags/foo </code></pre> <p>Here's an explanation.</p> <p>Take the command <code>git push</code>. Without being too... | 119 | git | <h1>Add a tag in remote repository without adding the repo on local</h1>
<p>Do have anyway to add a tag in remote repository without cloning/adding it on local. I just need to do it for marking QA builds</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,917 | git | # Add a tag in remote repository without adding the repo on local
Do have anyway to add a tag in remote repository without cloning/adding it on local. I just need to do it for marking QA builds | You can create a remote tag having no local tags at all with
```
git push origin HEAD:refs/tags/foo
```
You can remove the same tag with
```
git push origin :refs/tags/foo
```
Here's an explanation.
Take the command `git push`. Without being too strict, the general syntax could be interpreted as
```
git push wher... |
10259477 | How to remove a local Git repo from TortoiseGit? | 8 | 2012-04-21 13:48:16 | <p>I started messing around with Git today. I think I've done something wrong because when I installed TortoiseGit it looks like a lot of folders in my C and F (second partition) have a green tick next to them (meaning the file is commited? I think?). What can I do to remove these ticks. Is there a way to NOT delete th... | 25,032 | null | 2019-01-10 09:03:17 | 10,259,582 | 19 | 2012-04-21 14:03:20 | 1,347,968 | 2012-04-21 14:03:20 | https://stackoverflow.com/q/10259477 | https://stackoverflow.com/a/10259582 | <p>Don't know about TortoiseGit but the <code>git init</code> command simply creates a (hidden) <code>.git</code> directory in the root of the repository and fills it with some needed files. So to undo an init all you need to do is to delete this <code>.git</code> directory. Note that some files in this directory can b... | <p>Don't know about TortoiseGit but the <code>git init</code> command simply creates a (hidden) <code>.git</code> directory in the root of the repository and fills it with some needed files. So to undo an init all you need to do is to delete this <code>.git</code> directory. Note that some files in this directory can b... | 119, 31409 | git, tortoisegit | <h1>How to remove a local Git repo from TortoiseGit?</h1>
<p>I started messing around with Git today. I think I've done something wrong because when I installed TortoiseGit it looks like a lot of folders in my C and F (second partition) have a green tick next to them (meaning the file is commited? I think?). What can I... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,918 | git | # How to remove a local Git repo from TortoiseGit?
I started messing around with Git today. I think I've done something wrong because when I installed TortoiseGit it looks like a lot of folders in my C and F (second partition) have a green tick next to them (meaning the file is commited? I think?). What can I do to re... | Don't know about TortoiseGit but the `git init` command simply creates a (hidden) `.git` directory in the root of the repository and fills it with some needed files. So to undo an init all you need to do is to delete this `.git` directory. Note that some files in this directory can be write protected, so a warning dial... |
5958905 | Show git logs for range of commits on remote server? | 8 | 2011-05-11 03:27:36 | <p>I am looking for a way to query a git server for its logs for a given range of commits. Being an SVN user, I'm in the wrong mindset so Im hoping GIT experts can help. I'm looking to something similar to:</p>
<pre><code>svn log -r 5:20 --xml svn.myserver.com
</code></pre>
<p>but for a git server. In other words,... | 14,948 | 202,431 | 2012-05-18 11:16:59 | 5,959,161 | 19 | 2011-05-11 04:12:53 | 6,309 | 2012-05-18 11:16:59 | https://stackoverflow.com/q/5958905 | https://stackoverflow.com/a/5959161 | <p>First, since there is no simple revision number with Git, you would specify revision as mentioned in the <a href="http://schacon.github.com/git/git-rev-parse.html#_specifying_revisions" rel="noreferrer">rev-parse command</a>. </p>
<p>But the only command which queries directly a remote repo (without cloning or fet... | <p>First, since there is no simple revision number with Git, you would specify revision as mentioned in the <a href="http://schacon.github.com/git/git-rev-parse.html#_specifying_revisions" rel="noreferrer">rev-parse command</a>. </p> <p>But the only command which queries directly a remote repo (without cloning or fet... | 119, 942 | git, logging | <h1>Show git logs for range of commits on remote server?</h1>
<p>I am looking for a way to query a git server for its logs for a given range of commits. Being an SVN user, I'm in the wrong mindset so Im hoping GIT experts can help. I'm looking to something similar to:</p>
<pre><code>svn log -r 5:20 --xml svn.myserve... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,920 | git | # Show git logs for range of commits on remote server?
I am looking for a way to query a git server for its logs for a given range of commits. Being an SVN user, I'm in the wrong mindset so Im hoping GIT experts can help. I'm looking to something similar to:
```
svn log -r 5:20 --xml svn.myserver.com
```
but for a g... | First, since there is no simple revision number with Git, you would specify revision as mentioned in the [rev-parse command](http://schacon.github.com/git/git-rev-parse.html#_specifying_revisions).
But the only command which queries directly a remote repo (without cloning or fetching data) is [`git ls-remote`](http://... |
2930802 | How do i view the index version of a file before it is committed? | 8 | 2010-05-28 16:35:07 | <p>I have just performed <code>git add --interactive</code>, so the index version of some files is different than the working-directory versions. Instead of doing <code>git diff --cached</code>, I want to actually dump the contents of each file in the index, but I can't find a command to do that. I should think that ... | 706 | 270,511 | 2010-05-28 21:08:35 | 2,930,824 | 19 | 2010-05-28 16:39:26 | 19,563 | 2010-05-28 16:39:26 | https://stackoverflow.com/q/2930802 | https://stackoverflow.com/a/2930824 | <p>Yes, simply:</p>
<pre><code>git show :filename
</code></pre>
<p>If you have multiple index versions (such as in a merge conflict situation) you can view versions in different index slots with:</p>
<pre><code>git show :1:filename
git show :2:filename
git show :3:filename
</code></pre>
<p>In most other situations ... | <p>Yes, simply:</p> <pre><code>git show :filename </code></pre> <p>If you have multiple index versions (such as in a merge conflict situation) you can view versions in different index slots with:</p> <pre><code>git show :1:filename git show :2:filename git show :3:filename </code></pre> <p>In most other situations ... | 119 | git | <h1>How do i view the index version of a file before it is committed?</h1>
<p>I have just performed <code>git add --interactive</code>, so the index version of some files is different than the working-directory versions. Instead of doing <code>git diff --cached</code>, I want to actually dump the contents of each file... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,921 | git | # How do i view the index version of a file before it is committed?
I have just performed `git add --interactive`, so the index version of some files is different than the working-directory versions. Instead of doing `git diff --cached`, I want to actually dump the contents of each file in the index, but I can't find ... | Yes, simply:
```
git show :filename
```
If you have multiple index versions (such as in a merge conflict situation) you can view versions in different index slots with:
```
git show :1:filename
git show :2:filename
git show :3:filename
```
In most other situations only slot 0 is populated and `:0:filename` is the i... |
63069653 | How to disable Auto Fetch in PhpStorm? | 7 | 2020-07-24 08:19:09 | <p>How to disable Git Auto Fetch in PhpStorm?</p>
<p>I think this is default function of PhpStorm, it will open a Login Popup every 5 minutes if I don't login, which really annoying.</p>
<p><a href="https://i.sstatic.net/7xSxA.png" rel="noreferrer"><img src="https://i.sstatic.net/7xSxA.png" alt="enter image description... | 5,664 | 8,962,929 | 2021-04-14 14:26:13 | 64,787,120 | 19 | 2020-11-11 13:12:40 | 770,704 | 2021-04-14 14:26:13 | https://stackoverflow.com/q/63069653 | https://stackoverflow.com/a/64787120 | <p>Uncheck the <code>Auto fetch</code> option on the <a href="https://plugins.jetbrains.com/plugin/7499-gittoolbox" rel="noreferrer">GitToolBox</a> plugin settings:</p>
<p><a href="https://i.sstatic.net/6Nxch.png" rel="noreferrer"><img src="https://i.sstatic.net/6Nxch.png" alt="enter image description here" /></a></p>
| <p>Uncheck the <code>Auto fetch</code> option on the <a href="https://plugins.jetbrains.com/plugin/7499-gittoolbox" rel="noreferrer">GitToolBox</a> plugin settings:</p> <p><a href="https://i.sstatic.net/6Nxch.png" rel="noreferrer"><img src="https://i.sstatic.net/6Nxch.png" alt="enter image description here" /></a></p> | 119, 5794, 66821 | git, jetbrains-ide, phpstorm | <h1>How to disable Auto Fetch in PhpStorm?</h1>
<p>How to disable Git Auto Fetch in PhpStorm?</p>
<p>I think this is default function of PhpStorm, it will open a Login Popup every 5 minutes if I don't login, which really annoying.</p>
<p><a href="https://i.sstatic.net/7xSxA.png" rel="noreferrer"><img src="https://i.sst... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,922 | git | # How to disable Auto Fetch in PhpStorm?
How to disable Git Auto Fetch in PhpStorm?
I think this is default function of PhpStorm, it will open a Login Popup every 5 minutes if I don't login, which really annoying.
[](https://i.sstatic.net/7xSxA.png) | Uncheck the `Auto fetch` option on the [GitToolBox](https://plugins.jetbrains.com/plugin/7499-gittoolbox) plugin settings:
[](https://i.sstatic.net/6Nxch.png) |
43411941 | I cannot clone git tree | 7 | 2017-04-14 12:53:57 | <p>I have a question about git, I tried to clone a tree but without success.</p>
<pre><code>git clone https://github.com/cer/event-sourcing-examples/tree/d2077e21aa677a00095f90250470ff011c132ab8/java-spring
</code></pre>
<p>I cloned the project </p>
<pre><code>git clone https://github.com/cer/event-sourcing-examples... | 33,353 | 7,544,861 | 2020-04-26 19:08:18 | 43,415,350 | 19 | 2017-04-14 16:18:01 | 134,252 | 2017-04-14 16:18:01 | https://stackoverflow.com/q/43411941 | https://stackoverflow.com/a/43415350 | <p>Git cannot clone a tree directly. You need to clone the entire repository, and then check out a commit that uses the tree you want. For the sake of reducing confusions, though, do note that there is a difference between the terms "tree" and "commit", though:</p>
<ul>
<li>A tree is a Git object representing a direct... | <p>Git cannot clone a tree directly. You need to clone the entire repository, and then check out a commit that uses the tree you want. For the sake of reducing confusions, though, do note that there is a difference between the terms "tree" and "commit", though:</p> <ul> <li>A tree is a Git object representing a direct... | 58, 119 | git, linux | <h1>I cannot clone git tree</h1>
<p>I have a question about git, I tried to clone a tree but without success.</p>
<pre><code>git clone https://github.com/cer/event-sourcing-examples/tree/d2077e21aa677a00095f90250470ff011c132ab8/java-spring
</code></pre>
<p>I cloned the project </p>
<pre><code>git clone https://githu... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,925 | git | # I cannot clone git tree
I have a question about git, I tried to clone a tree but without success.
```
git clone https://github.com/cer/event-sourcing-examples/tree/d2077e21aa677a00095f90250470ff011c132ab8/java-spring
```
I cloned the project
```
git clone https://github.com/cer/event-sourcing-examples
```
and I ... | Git cannot clone a tree directly. You need to clone the entire repository, and then check out a commit that uses the tree you want. For the sake of reducing confusions, though, do note that there is a difference between the terms "tree" and "commit", though:
- A tree is a Git object representing a directory, and conta... |
14350930 | Merging diff between two git branches and applying it to working copy | 7 | 2013-01-16 03:29:53 | <p>I have a development repository and a deploy repository. When deploying code, a codebase is checked out of dev, rsync'd to the deploy working copy, and committed to the deploy repository. These repositories are therefore separate, but similar.</p>
<p>On dev, I have a branch. I would like to "apply" that branch to t... | 13,878 | 1,951,514 | 2013-12-02 07:52:30 | 14,351,025 | 19 | 2013-01-16 03:42:54 | 1,278,288 | 2013-12-02 07:52:30 | https://stackoverflow.com/q/14350930 | https://stackoverflow.com/a/14351025 | <p>One way is to fetch the branch from the other repo:</p>
<pre><code>cd <deploy-path>
git remote add devel <devel-path>
git fetch devel
git cherry-pick devel/master...devel/branch # Assuming your branch is based on master
</code></pre>
<p>Another way is to create a patch and then apply it:</p>
<pre><c... | <p>One way is to fetch the branch from the other repo:</p> <pre><code>cd <deploy-path> git remote add devel <devel-path> git fetch devel git cherry-pick devel/master...devel/branch # Assuming your branch is based on master </code></pre> <p>Another way is to create a patch and then apply it:</p> <pre><c... | 119, 717, 1879 | branch, git, merge | <h1>Merging diff between two git branches and applying it to working copy</h1>
<p>I have a development repository and a deploy repository. When deploying code, a codebase is checked out of dev, rsync'd to the deploy working copy, and committed to the deploy repository. These repositories are therefore separate, but sim... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,926 | git | # Merging diff between two git branches and applying it to working copy
I have a development repository and a deploy repository. When deploying code, a codebase is checked out of dev, rsync'd to the deploy working copy, and committed to the deploy repository. These repositories are therefore separate, but similar.
On... | One way is to fetch the branch from the other repo:
```
cd <deploy-path>
git remote add devel <devel-path>
git fetch devel
git cherry-pick devel/master...devel/branch # Assuming your branch is based on master
```
Another way is to create a patch and then apply it:
```
git diff commitid1 commitid2 > something.patch... |
11322532 | Rolling back to an old revision in Mercurial (like git reset) | 7 | 2012-07-04 04:44:14 | <p>Using git, I can throw away a mistaken or accidental commit using a command like</p>
<pre><code>git reset --soft HEAD^
</code></pre>
<p>which resets the current branch (such as <code>master</code>) to the current revision's parent commit <code>HEAD^</code> without touching the working tree – you can replace <code>... | 12,353 | 49,485 | 2018-02-22 10:52:56 | 11,322,533 | 19 | 2012-07-04 04:44:15 | 49,485 | 2018-02-22 10:52:56 | https://stackoverflow.com/q/11322532 | https://stackoverflow.com/a/11322533 | <p>Though Mercurial doesn’t provide an easy alternative and shies away from the idea of mutable history, there are a few ways to achieve something close. In this post, I’ll outline a few of them.</p>
<h1>hg rollback</h1>
<p>If you specifically want to undo your last commit, you can use:</p>
<pre><code>hg rollback
</... | <p>Though Mercurial doesn’t provide an easy alternative and shies away from the idea of mutable history, there are a few ways to achieve something close. In this post, I’ll outline a few of them.</p> <h1>hg rollback</h1> <p>If you specifically want to undo your last commit, you can use:</p> <pre><code>hg rollback </... | 119, 456, 802 | git, mercurial, version-control | <h1>Rolling back to an old revision in Mercurial (like git reset)</h1>
<p>Using git, I can throw away a mistaken or accidental commit using a command like</p>
<pre><code>git reset --soft HEAD^
</code></pre>
<p>which resets the current branch (such as <code>master</code>) to the current revision's parent commit <code>... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,928 | git | # Rolling back to an old revision in Mercurial (like git reset)
Using git, I can throw away a mistaken or accidental commit using a command like
```
git reset --soft HEAD^
```
which resets the current branch (such as `master`) to the current revision's parent commit `HEAD^` without touching the working tree – you ca... | Though Mercurial doesn’t provide an easy alternative and shies away from the idea of mutable history, there are a few ways to achieve something close. In this post, I’ll outline a few of them.
# hg rollback
If you specifically want to undo your last commit, you can use:
```
hg rollback
```
which will undo the commi... |
34053435 | find highest tag with version number | 6 | 2015-12-02 21:33:16 | <p>I would like to checkout the highest version number and checkout that branch. </p>
<p>Currently I am doing:</p>
<pre><code>git checkout $(git describe --tags $(git rev-list --tags --max-count=1))
</code></pre>
<p>But when the latest tag was 3.7.1 I will checkout this instead of another version which have the vers... | 3,341 | 3,205,343 | 2015-12-02 22:30:56 | 34,054,376 | 19 | 2015-12-02 22:30:56 | 428,260 | 2015-12-02 22:30:56 | https://stackoverflow.com/q/34053435 | https://stackoverflow.com/a/34054376 | <p>You are able to sort tags by semantic version names:</p>
<pre><code>$ git checkout $(git tag -l --sort -version:refname | head -n 1)
</code></pre>
| <p>You are able to sort tags by semantic version names:</p> <pre><code>$ git checkout $(git tag -l --sort -version:refname | head -n 1) </code></pre> | 119 | git | <h1>find highest tag with version number</h1>
<p>I would like to checkout the highest version number and checkout that branch. </p>
<p>Currently I am doing:</p>
<pre><code>git checkout $(git describe --tags $(git rev-list --tags --max-count=1))
</code></pre>
<p>But when the latest tag was 3.7.1 I will checkout this ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,931 | git | # find highest tag with version number
I would like to checkout the highest version number and checkout that branch.
Currently I am doing:
```
git checkout $(git describe --tags $(git rev-list --tags --max-count=1))
```
But when the latest tag was 3.7.1 I will checkout this instead of another version which have the... | You are able to sort tags by semantic version names:
```
$ git checkout $(git tag -l --sort -version:refname | head -n 1)
``` |
25748978 | Personal vs central repositories | 6 | 2014-09-09 15:50:01 | <p>I am trying to set up version control software, currently I work alone (but I expect that to change), and I want to store the code on a network drive which is regularly backed up but work off the same code on my laptop's hard drive.</p>
<p>But GIT is confusing me greatly!</p>
<p>So from what I can understand, I sh... | 2,929 | 1,011,724 | 2014-09-20 13:35:25 | 25,749,388 | 19 | 2014-09-09 16:10:56 | 2,541,573 | 2014-09-20 13:35:25 | https://stackoverflow.com/q/25748978 | https://stackoverflow.com/a/25749388 | <blockquote>
<p>GIT is confusing me greatly!</p>
</blockquote>
<p>You seem to come from a centralized-VCS background, and you show symptoms of the <strong>curse of knowledge</strong> described by Joel <a href="http://hginit.com/00.html" rel="nofollow noreferrer">here</a>. You just need to come to terms with Git's di... | <blockquote> <p>GIT is confusing me greatly!</p> </blockquote> <p>You seem to come from a centralized-VCS background, and you show symptoms of the <strong>curse of knowledge</strong> described by Joel <a href="http://hginit.com/00.html" rel="nofollow noreferrer">here</a>. You just need to come to terms with Git's di... | 119, 39597 | git, git-extensions | <h1>Personal vs central repositories</h1>
<p>I am trying to set up version control software, currently I work alone (but I expect that to change), and I want to store the code on a network drive which is regularly backed up but work off the same code on my laptop's hard drive.</p>
<p>But GIT is confusing me greatly!</... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,932 | git | # Personal vs central repositories
I am trying to set up version control software, currently I work alone (but I expect that to change), and I want to store the code on a network drive which is regularly backed up but work off the same code on my laptop's hard drive.
But GIT is confusing me greatly!
So from what I c... | > GIT is confusing me greatly!
You seem to come from a centralized-VCS background, and you show symptoms of the **curse of knowledge** described by Joel [here](http://hginit.com/00.html). You just need to come to terms with Git's distributed nature. Everything will soon make sense. `:)`
A good starting point is the f... |
9457753 | How to stage all changes in git from with a repo subdirectory | 6 | 2012-02-26 22:19:37 | <p>So the command to stage all changes for git is <code>git add -A</code>.</p>
<p>Is there a way to execute this from within a repository subdirectory, and capture all changes anywhere in the repo, without having change the directory back to the repo root?</p>
<p>Example:</p>
<pre><code>$pwd
/reporoot/
</code></pre>... | 51,056 | 853,013 | 2014-05-28 08:44:16 | 9,457,806 | 19 | 2012-02-26 22:25:14 | 211,563 | 2012-02-26 22:25:14 | https://stackoverflow.com/q/9457753 | https://stackoverflow.com/a/9457806 | <p>Use the following (only works in newer versions of Git):</p>
<pre><code>git add $(git rev-parse --show-toplevel)
</code></pre>
<p>You may wish to <a href="https://git.wiki.kernel.org/articles/a/l/i/Aliases.html">create a Git alias</a> for this to make running it easier.</p>
<p>Note that, if you plan on committing... | <p>Use the following (only works in newer versions of Git):</p> <pre><code>git add $(git rev-parse --show-toplevel) </code></pre> <p>You may wish to <a href="https://git.wiki.kernel.org/articles/a/l/i/Aliases.html">create a Git alias</a> for this to make running it easier.</p> <p>Note that, if you plan on committing... | 119 | git | <h1>How to stage all changes in git from with a repo subdirectory</h1>
<p>So the command to stage all changes for git is <code>git add -A</code>.</p>
<p>Is there a way to execute this from within a repository subdirectory, and capture all changes anywhere in the repo, without having change the directory back to the re... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,934 | git | # How to stage all changes in git from with a repo subdirectory
So the command to stage all changes for git is `git add -A`.
Is there a way to execute this from within a repository subdirectory, and capture all changes anywhere in the repo, without having change the directory back to the repo root?
Example:
```
$pw... | Use the following (only works in newer versions of Git):
```
git add $(git rev-parse --show-toplevel)
```
You may wish to [create a Git alias](https://git.wiki.kernel.org/articles/a/l/i/Aliases.html) for this to make running it easier.
Note that, if you plan on committing, doing the following will stage all changed ... |
636013 | Unable to remove fast many files in Git | 6 | 2009-03-11 19:34:55 | <p>I removed 777 files which were in Git's branch <em>newFeature</em> by</p>
<pre><code>rm !(example)
</code></pre>
<p>I would like to commit.
Git ask me to manually remove each of the removed files by </p>
<pre><code>git rm file
</code></pre>
<p>It would take a lot of time to write the above command for all 777 fi... | 1,124 | 54,964 | 2011-04-05 15:03:00 | 636,082 | 19 | 2009-03-11 19:52:40 | 6,309 | 2009-03-11 20:11:52 | https://stackoverflow.com/q/636013 | https://stackoverflow.com/a/636082 | <pre><code>git add -u
</code></pre>
<p>It will "git delete" all files you removed.</p>
<p>From <a href="http://www.kernel.org/pub/software/scm/git/docs/git-add.html" rel="noreferrer"><strong>Git add</strong></a>:</p>
<p>u<br>
--update</p>
<p>Update only files that git already knows about, staging modified content f... | <pre><code>git add -u </code></pre> <p>It will "git delete" all files you removed.</p> <p>From <a href="http://www.kernel.org/pub/software/scm/git/docs/git-add.html" rel="noreferrer"><strong>Git add</strong></a>:</p> <p>u<br> --update</p> <p>Update only files that git already knows about, staging modified content f... | 119 | git | <h1>Unable to remove fast many files in Git</h1>
<p>I removed 777 files which were in Git's branch <em>newFeature</em> by</p>
<pre><code>rm !(example)
</code></pre>
<p>I would like to commit.
Git ask me to manually remove each of the removed files by </p>
<pre><code>git rm file
</code></pre>
<p>It would take a lot ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,935 | git | # Unable to remove fast many files in Git
I removed 777 files which were in Git's branch *newFeature* by
```
rm !(example)
```
I would like to commit.
Git ask me to manually remove each of the removed files by
```
git rm file
```
It would take a lot of time to write the above command for all 777 files which names ... | ```
git add -u
```
It will "git delete" all files you removed.
From [**Git add**](http://www.kernel.org/pub/software/scm/git/docs/git-add.html):
u
--update
Update only files that git already knows about, staging modified content for commit and marking deleted files for removal.
This is similar to what "`git com... |
7066325 | List Git aliases | 670 | 2011-08-15 14:45:50 | <p>How do I print a list of my git aliases, i.e., something analogous to the bash <code>alias</code> command?</p>
| 270,597 | 242,933 | 2024-10-27 08:02:16 | 73,580,826 | 18 | 2022-09-02 09:56:53 | 5,362,795 | 2022-10-20 16:56:46 | https://stackoverflow.com/q/7066325 | https://stackoverflow.com/a/73580826 | <p>Just adding this because it's so simple and I didn't see it in previous answers (sorry if I missed it).</p>
<pre><code>git help -a
</code></pre>
<p>You'll have to scroll to the bottom (use <code>></code> as <em>ma11hew28</em> pointed out) to see the list, e.g.:</p>
<pre><code>Command aliases
restore-deleted ... | <p>Just adding this because it's so simple and I didn't see it in previous answers (sorry if I missed it).</p> <pre><code>git help -a </code></pre> <p>You'll have to scroll to the bottom (use <code>></code> as <em>ma11hew28</em> pointed out) to see the list, e.g.:</p> <pre><code>Command aliases restore-deleted ... | 119, 391, 1448 | alias, git, terminal | <h1>List Git aliases</h1>
<p>How do I print a list of my git aliases, i.e., something analogous to the bash <code>alias</code> command?</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,936 | git | # List Git aliases
How do I print a list of my git aliases, i.e., something analogous to the bash `alias` command? | Just adding this because it's so simple and I didn't see it in previous answers (sorry if I missed it).
```
git help -a
```
You'll have to scroll to the bottom (use `>` as *ma11hew28* pointed out) to see the list, e.g.:
```
Command aliases
restore-deleted !git restore $(git ls-files -d)
```
If you forget ev... |
3148863 | how can I customize git's merge commit message? | 87 | 2010-06-30 11:42:30 | <p>Every time I do a merge I need for a merge commit to be generated and I would like it to have more than just the summary of all the commits.</p>
<p><strong>My question is how can I format git-fmt-merge-msg or what determines this automated message</strong> (I can do this manually after a commit by amending it and u... | 99,486 | 302,485 | 2023-10-12 13:40:31 | 51,937,574 | 18 | 2018-08-20 19:45:44 | 3,425,022 | 2018-08-20 19:45:44 | https://stackoverflow.com/q/3148863 | https://stackoverflow.com/a/51937574 | <p>I wanted to do something just like this. I didn't find any reasonable way to get <code>git fmt-merge-msg</code> to work. I think it doesn't work the way I was hoping (passing in a completely custom text to use for the message). So instead I figured out another way using the <code>-no-commit</code> and <code>commit -... | <p>I wanted to do something just like this. I didn't find any reasonable way to get <code>git fmt-merge-msg</code> to work. I think it doesn't work the way I was hoping (passing in a completely custom text to use for the message). So instead I figured out another way using the <code>-no-commit</code> and <code>commit -... | 119, 28897 | git, git-merge | <h1>how can I customize git's merge commit message?</h1>
<p>Every time I do a merge I need for a merge commit to be generated and I would like it to have more than just the summary of all the commits.</p>
<p><strong>My question is how can I format git-fmt-merge-msg or what determines this automated message</strong> (I... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,937 | git | # how can I customize git's merge commit message?
Every time I do a merge I need for a merge commit to be generated and I would like it to have more than just the summary of all the commits.
**My question is how can I format git-fmt-merge-msg or what determines this automated message** (I can do this manually after a... | I wanted to do something just like this. I didn't find any reasonable way to get `git fmt-merge-msg` to work. I think it doesn't work the way I was hoping (passing in a completely custom text to use for the message). So instead I figured out another way using the `-no-commit` and `commit -F` commands. The output is of ... |
8788975 | BitBucket Git Error: did not send all necessary objects | 64 | 2012-01-09 13:15:00 | <p>I am using bitbucket and git to revision a project I am currently working on. Today I tried to pull down the latest working copy of the project but was met with an error that I cant seem to find any solution to.</p>
<pre><code>$ git pull
Password for 'bitbucket.org':
remote: Counting objects: 65, done.
remote: Comp... | 121,450 | 959,664 | 2024-11-21 22:18:12 | 8,817,602 | 18 | 2012-01-11 10:17:55 | 6,309 | 2013-07-20 06:50:34 | https://stackoverflow.com/q/8788975 | https://stackoverflow.com/a/8817602 | <p>"did not send all necessary objects" is the manifestation of the error, not the error itself.<br>
For information, this message comes from <code>builtin/fetch.c</code> method
<a href="http://github.com/git/git/blob/master/builtin/fetch.c#L370" rel="noreferrer"><code>store_updated_refs()</code></a>, which calls
<code... | <p>"did not send all necessary objects" is the manifestation of the error, not the error itself.<br> For information, this message comes from <code>builtin/fetch.c</code> method <a href="http://github.com/git/git/blob/master/builtin/fetch.c#L370" rel="noreferrer"><code>store_updated_refs()</code></a>, which calls <code... | 119, 4860, 6981, 8337 | bitbucket, git, object, pull | <h1>BitBucket Git Error: did not send all necessary objects</h1>
<p>I am using bitbucket and git to revision a project I am currently working on. Today I tried to pull down the latest working copy of the project but was met with an error that I cant seem to find any solution to.</p>
<pre><code>$ git pull
Password for ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,938 | git | # BitBucket Git Error: did not send all necessary objects
I am using bitbucket and git to revision a project I am currently working on. Today I tried to pull down the latest working copy of the project but was met with an error that I cant seem to find any solution to.
```
$ git pull
Password for 'bitbucket.org':
rem... | "did not send all necessary objects" is the manifestation of the error, not the error itself.
For information, this message comes from `builtin/fetch.c` method
[`store_updated_refs()`](http://github.com/git/git/blob/master/builtin/fetch.c#L370), which calls
`connected.c` method [`check_everything_connected()`](http:/... |
32401387 | git add adding ignored files | 61 | 2015-09-04 15:14:02 | <p>I'm trying to remove a previously tracked directory from git, which works, but it's being added back with each subsequent <code>git add .</code>, <code>git add -A</code>, etc. Here's what I've done:</p>
<p>Add to .gitignore in root of project:</p>
<pre><code>node_modules
</code></pre>
<p>Run the following:</p>
<... | 63,757 | 2,124,351 | 2018-03-08 16:25:34 | 32,545,286 | 18 | 2015-09-13 00:54:51 | 5,032,339 | 2015-09-16 15:02:57 | https://stackoverflow.com/q/32401387 | https://stackoverflow.com/a/32545286 | <p>You probably have a negative rule (include-again rule, the one that starts with an <code>!</code>) in your <code>.gitignore</code> file somewhere after the <code>node_modules</code> line.</p>
<p><code>git check-ignore</code> has a bug/ambiguity in the docs. You expect that if <code>git check-ignore node_modules/</c... | <p>You probably have a negative rule (include-again rule, the one that starts with an <code>!</code>) in your <code>.gitignore</code> file somewhere after the <code>node_modules</code> line.</p> <p><code>git check-ignore</code> has a bug/ambiguity in the docs. You expect that if <code>git check-ignore node_modules/</c... | 119, 25056 | git, gitignore | <h1>git add adding ignored files</h1>
<p>I'm trying to remove a previously tracked directory from git, which works, but it's being added back with each subsequent <code>git add .</code>, <code>git add -A</code>, etc. Here's what I've done:</p>
<p>Add to .gitignore in root of project:</p>
<pre><code>node_modules
</cod... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,939 | git | # git add adding ignored files
I'm trying to remove a previously tracked directory from git, which works, but it's being added back with each subsequent `git add .`, `git add -A`, etc. Here's what I've done:
Add to .gitignore in root of project:
```
node_modules
```
Run the following:
```
git rm -r --cached node_m... | You probably have a negative rule (include-again rule, the one that starts with an `!`) in your `.gitignore` file somewhere after the `node_modules` line.
`git check-ignore` has a bug/ambiguity in the docs. You expect that if `git check-ignore node_modules/` prints `node_modules/`, then `node_modules/` is ignored. But... |
1286183 | git find fat commit | 61 | 2009-08-17 04:41:14 | <p>Is it possible to get info about how much space is wasted by changes in every commit — so I can find commits which added big files or a lot of files. This is all to try to reduce git repo size (rebasing and maybe filtering commits)</p>
| 24,296 | 96,823 | 2017-09-06 23:27:03 | 1,557,398 | 18 | 2009-10-12 22:59:06 | 96,823 | 2010-08-26 09:05:14 | https://stackoverflow.com/q/1286183 | https://stackoverflow.com/a/1557398 | <p>Forgot to reply, my answer is:</p>
<pre><code>git rev-list --all --pretty=format:'%H%n%an%n%s' # get all commits
git diff-tree -r -c -M -C --no-commit-id #{sha} # get new blobs for each commit
git cat-file --batch-check << blob ids # get size of each blob
</code></pre>
| <p>Forgot to reply, my answer is:</p> <pre><code>git rev-list --all --pretty=format:'%H%n%an%n%s' # get all commits git diff-tree -r -c -M -C --no-commit-id #{sha} # get new blobs for each commit git cat-file --batch-check << blob ids # get size of each blob </code></pre> | 119, 402, 5597, 10193 | commit, find, git, statistics | <h1>git find fat commit</h1>
<p>Is it possible to get info about how much space is wasted by changes in every commit — so I can find commits which added big files or a lot of files. This is all to try to reduce git repo size (rebasing and maybe filtering commits)</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,940 | git | # git find fat commit
Is it possible to get info about how much space is wasted by changes in every commit — so I can find commits which added big files or a lot of files. This is all to try to reduce git repo size (rebasing and maybe filtering commits) | Forgot to reply, my answer is:
```
git rev-list --all --pretty=format:'%H%n%an%n%s' # get all commits
git diff-tree -r -c -M -C --no-commit-id #{sha} # get new blobs for each commit
git cat-file --batch-check << blob ids # get size of each blob
``` |
4633681 | Git: Ignoring Version-Controlled Files | 59 | 2011-01-08 11:41:19 | <p>The .gitignore file is very useful in ignoring some of the files that we don't want to control. Unfortunately, it cannot be used when the file is already under version control. For example, my .gitignore (which is already added to git) file might be different than what my coworker wants it to be (e.g. I want to igno... | 21,214 | 196,697 | 2021-09-12 03:16:03 | 4,633,860 | 18 | 2011-01-08 12:30:56 | 893 | 2011-01-08 12:30:56 | https://stackoverflow.com/q/4633681 | https://stackoverflow.com/a/4633860 | <p>If you want to exclude files that are specific to your process (such as Vim temporary files), edit the (local) file <code>.git/info/exclude</code> and add your exclusion patterns there. This file is designed for developer-specific exclusions rather than <code>.gitignore</code>, which is designed for project-wide exc... | <p>If you want to exclude files that are specific to your process (such as Vim temporary files), edit the (local) file <code>.git/info/exclude</code> and add your exclusion patterns there. This file is designed for developer-specific exclusions rather than <code>.gitignore</code>, which is designed for project-wide exc... | 119, 25056 | git, gitignore | <h1>Git: Ignoring Version-Controlled Files</h1>
<p>The .gitignore file is very useful in ignoring some of the files that we don't want to control. Unfortunately, it cannot be used when the file is already under version control. For example, my .gitignore (which is already added to git) file might be different than what... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,942 | git | # Git: Ignoring Version-Controlled Files
The .gitignore file is very useful in ignoring some of the files that we don't want to control. Unfortunately, it cannot be used when the file is already under version control. For example, my .gitignore (which is already added to git) file might be different than what my cowor... | If you want to exclude files that are specific to your process (such as Vim temporary files), edit the (local) file `.git/info/exclude` and add your exclusion patterns there. This file is designed for developer-specific exclusions rather than `.gitignore`, which is designed for project-wide exclusions.
The short summa... |
53012504 | What does the warning "redirecting to" actually mean? | 58 | 2018-10-26 16:04:12 | <p>I have noticed that sometimes when I <code>git pull</code> a project, there is a message saying:</p>
<pre><code>"warning: redirecting to <url>"
</code></pre>
<p>I tried searching what it means but I find nothing useful. What is it?</p>
| 53,529 | 6,202,327 | 2024-12-02 13:35:48 | 53,019,421 | 18 | 2018-10-27 06:46:07 | 6,309 | 2018-10-27 16:02:29 | https://stackoverflow.com/q/53012504 | https://stackoverflow.com/a/53019421 | <blockquote>
<pre><code>warning: redirecting to
</code></pre>
</blockquote>
<p>This is typical of a Git repo URL starting with <code>git://</code> or <code>http://</code>, but which is redirected at the server level to <code>https://</code> (which is more secure, and allows for authentication)</p>
<p>This is set at t... | <blockquote> <pre><code>warning: redirecting to </code></pre> </blockquote> <p>This is typical of a Git repo URL starting with <code>git://</code> or <code>http://</code>, but which is redirected at the server level to <code>https://</code> (which is more secure, and allows for authentication)</p> <p>This is set at t... | 119, 365, 1716, 4860 | git, pull, url, warnings | <h1>What does the warning "redirecting to" actually mean?</h1>
<p>I have noticed that sometimes when I <code>git pull</code> a project, there is a message saying:</p>
<pre><code>"warning: redirecting to <url>"
</code></pre>
<p>I tried searching what it means but I find nothing useful. What is it?</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,943 | git | # What does the warning "redirecting to" actually mean?
I have noticed that sometimes when I `git pull` a project, there is a message saying:
```
"warning: redirecting to <url>"
```
I tried searching what it means but I find nothing useful. What is it? | > ```
> warning: redirecting to
> ```
This is typical of a Git repo URL starting with `git://` or `http://`, but which is redirected at the server level to `https://` (which is more secure, and allows for authentication)
This is set at the server level (as [in this one](https://stackoverflow.com/q/49925732/6309)) wit... |
6388283 | Git: How can I find a commit that most closely matches a directory? | 53 | 2011-06-17 15:44:15 | <p>Someone took a version (unknown to me) of Moodle, applied many changes within a directory, and released it (<a href="https://github.com/mrclay/moodle-rubric-1.9/tree/5ed4c9409f76a250fb56d74a527fe7894a676c5c/mod/assignment" rel="noreferrer">tree here</a>).</p>
<p><strong>How can I determine which commit of the origi... | 5,007 | 3,779 | 2020-04-09 13:59:21 | 6,388,694 | 18 | 2011-06-17 16:19:14 | 112,968 | 2011-06-17 16:19:14 | https://stackoverflow.com/q/6388283 | https://stackoverflow.com/a/6388694 | <p>you could write a script, which diffs the given tree against a revision range in your repository.</p>
<p>assume we first fetch the changed tree (without history) into our own repository:</p>
<pre><code>git remote add foreign git://…
git fetch foreign
</code></pre>
<p>we then output the diffstat (in short form) fo... | <p>you could write a script, which diffs the given tree against a revision range in your repository.</p> <p>assume we first fetch the changed tree (without history) into our own repository:</p> <pre><code>git remote add foreign git://… git fetch foreign </code></pre> <p>we then output the diffstat (in short form) fo... | 119, 606, 2132, 5597 | commit, diff, git, patch | <h1>Git: How can I find a commit that most closely matches a directory?</h1>
<p>Someone took a version (unknown to me) of Moodle, applied many changes within a directory, and released it (<a href="https://github.com/mrclay/moodle-rubric-1.9/tree/5ed4c9409f76a250fb56d74a527fe7894a676c5c/mod/assignment" rel="noreferrer">... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,945 | git | # Git: How can I find a commit that most closely matches a directory?
Someone took a version (unknown to me) of Moodle, applied many changes within a directory, and released it ([tree here](https://github.com/mrclay/moodle-rubric-1.9/tree/5ed4c9409f76a250fb56d74a527fe7894a676c5c/mod/assignment)).
**How can I determin... | you could write a script, which diffs the given tree against a revision range in your repository.
assume we first fetch the changed tree (without history) into our own repository:
```
git remote add foreign git://…
git fetch foreign
```
we then output the diffstat (in short form) for each revision we want to match a... |
1761825 | Referencing the child of a commit in Git | 52 | 2009-11-19 08:51:02 | <p>If you want to move the <code>HEAD</code> to the parent of the current <code>HEAD</code>, that's easy:</p>
<pre><code>git reset --hard HEAD^
</code></pre>
<p>But is there any simple way to do the exact opposite of this operation, that is, set the head to the current head's first child commit?</p>
<p>Right now, I ... | 17,162 | 206,784 | 2024-08-06 07:04:27 | 1,762,012 | 18 | 2009-11-19 09:31:49 | 206,784 | 2022-10-04 18:49:18 | https://stackoverflow.com/q/1761825 | https://stackoverflow.com/a/1762012 | <p>Very probably not the fastest possible solution, but it does what I need:</p>
<pre class="lang-bash prettyprint-override"><code>#!/bin/bash
REV=$1
if [[ -z "$REV" ]]; then
echo "Usage: git-get-child <refspec> [<child-number>]"
exit
fi
HASH=$(git rev-parse $REV)
NUM=$2
if ... | <p>Very probably not the fastest possible solution, but it does what I need:</p> <pre class="lang-bash prettyprint-override"><code>#!/bin/bash REV=$1 if [[ -z "$REV" ]]; then echo "Usage: git-get-child <refspec> [<child-number>]" exit fi HASH=$(git rev-parse $REV) NUM=$2 if ... | 119 | git | <h1>Referencing the child of a commit in Git</h1>
<p>If you want to move the <code>HEAD</code> to the parent of the current <code>HEAD</code>, that's easy:</p>
<pre><code>git reset --hard HEAD^
</code></pre>
<p>But is there any simple way to do the exact opposite of this operation, that is, set the head to the curren... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,946 | git | # Referencing the child of a commit in Git
If you want to move the `HEAD` to the parent of the current `HEAD`, that's easy:
```
git reset --hard HEAD^
```
But is there any simple way to do the exact opposite of this operation, that is, set the head to the current head's first child commit?
Right now, I use gitk as ... | Very probably not the fastest possible solution, but it does what I need:
```
#!/bin/bash
REV=$1
if [[ -z "$REV" ]]; then
echo "Usage: git-get-child <refspec> [<child-number>]"
exit
fi
HASH=$(git rev-parse $REV)
NUM=$2
if [[ -z "$NUM" ]]; then
NUM=1
fi
git rev-list --all --parents | grep " $HASH" | s... |
3873872 | Best Practices for using Git with Intellij Idea | 43 | 2010-10-06 15:00:19 | <p>In a nutshell: what are best practices for using Intellij Idea (9) and Git?</p>
<p><strong>Context</strong></p>
<p>We recently upgraded to Intellij idea version 9 and have started to use Git for a new feature on existing project. </p>
<p>We largely use git command line to learn the tool better. But we thought we... | 52,577 | 331,465 | 2018-06-28 15:48:17 | 4,000,115 | 18 | 2010-10-22 19:08:33 | 331,465 | 2015-04-05 13:47:29 | https://stackoverflow.com/q/3873872 | https://stackoverflow.com/a/4000115 | <p>Here's what we've found after several weeks of Git/Idea. I've made this a community wiki. Please throw in your 2 kronor/centimos/pfennings/cents. </p>
<p>Note: I'm answering my own question because I sought those easy-use bullet points.</p>
<p><strong>Presupposition</strong></p>
<p>Idea is great tool. No one here... | <p>Here's what we've found after several weeks of Git/Idea. I've made this a community wiki. Please throw in your 2 kronor/centimos/pfennings/cents. </p> <p>Note: I'm answering my own question because I sought those easy-use bullet points.</p> <p><strong>Presupposition</strong></p> <p>Idea is great tool. No one here... | 119, 8945 | git, intellij-idea | <h1>Best Practices for using Git with Intellij Idea</h1>
<p>In a nutshell: what are best practices for using Intellij Idea (9) and Git?</p>
<p><strong>Context</strong></p>
<p>We recently upgraded to Intellij idea version 9 and have started to use Git for a new feature on existing project. </p>
<p>We largely use git... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,947 | git | # Best Practices for using Git with Intellij Idea
In a nutshell: what are best practices for using Intellij Idea (9) and Git?
**Context**
We recently upgraded to Intellij idea version 9 and have started to use Git for a new feature on existing project.
We largely use git command line to learn the tool better. But w... | Here's what we've found after several weeks of Git/Idea. I've made this a community wiki. Please throw in your 2 kronor/centimos/pfennings/cents.
Note: I'm answering my own question because I sought those easy-use bullet points.
**Presupposition**
Idea is great tool. No one here is complaining. Just observing.
**Be... |
11724666 | Flatten commits on a branch | 39 | 2012-07-30 15:33:28 | <p>Is it possible to condense the commits on a branch into a single commit prior to merging with the main? I thought this would be a fairly common scenario, but maybe I am not using the right search terms.</p>
<p>I'll explain the scenario in more detail. Often I would want to make many local commits while working on a... | 38,862 | 1,034,349 | 2020-05-22 18:20:40 | 11,724,704 | 18 | 2012-07-30 15:35:46 | 166,749 | 2012-07-30 15:41:40 | https://stackoverflow.com/q/11724666 | https://stackoverflow.com/a/11724704 | <p>Use interactive rebasing. Find the commit where your branch diverged from master (may using <code>git merge-base</code>; let's call the commit <code><diverge></code>), then</p>
<pre><code>git rebase -i <diverge>
</code></pre>
<p>and an editor will pop up, allowing you to rewrite history interactively. ... | <p>Use interactive rebasing. Find the commit where your branch diverged from master (may using <code>git merge-base</code>; let's call the commit <code><diverge></code>), then</p> <pre><code>git rebase -i <diverge> </code></pre> <p>and an editor will pop up, allowing you to rewrite history interactively. ... | 119 | git | <h1>Flatten commits on a branch</h1>
<p>Is it possible to condense the commits on a branch into a single commit prior to merging with the main? I thought this would be a fairly common scenario, but maybe I am not using the right search terms.</p>
<p>I'll explain the scenario in more detail. Often I would want to make ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,948 | git | # Flatten commits on a branch
Is it possible to condense the commits on a branch into a single commit prior to merging with the main? I thought this would be a fairly common scenario, but maybe I am not using the right search terms.
I'll explain the scenario in more detail. Often I would want to make many local commi... | Use interactive rebasing. Find the commit where your branch diverged from master (may using `git merge-base`; let's call the commit `<diverge>`), then
```
git rebase -i <diverge>
```
and an editor will pop up, allowing you to rewrite history interactively. You'll want to squash commits. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.