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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4549157 | Show non-merge differences for two commits in git | 23 | 2010-12-28 20:15:22 | <p>I have two commits, once of which is the ancestor of another. (They happen to be the start and end points of a branch. I don't think that matters, but I'll include it if it does).</p>
<p>I want to see the diff between the two commits, but <em>excluding</em> changes made during merge commits (that is, all commits wi... | 14,975 | 3,488 | 2022-12-14 08:37:26 | 4,549,206 | 20 | 2010-12-28 20:21:04 | 19,563 | 2010-12-28 20:21:04 | https://stackoverflow.com/q/4549157 | https://stackoverflow.com/a/4549206 | <p>Your question is slightly ambiguous but I think you want this.</p>
<pre><code>git log --no-merges -p branch-start..branch-end
</code></pre>
| <p>Your question is slightly ambiguous but I think you want this.</p> <pre><code>git log --no-merges -p branch-start..branch-end </code></pre> | 119, 606 | diff, git | <h1>Show non-merge differences for two commits in git</h1>
<p>I have two commits, once of which is the ancestor of another. (They happen to be the start and end points of a branch. I don't think that matters, but I'll include it if it does).</p>
<p>I want to see the diff between the two commits, but <em>excluding</em>... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,509 | git | # Show non-merge differences for two commits in git
I have two commits, once of which is the ancestor of another. (They happen to be the start and end points of a branch. I don't think that matters, but I'll include it if it does).
I want to see the diff between the two commits, but *excluding* changes made during me... | Your question is slightly ambiguous but I think you want this.
```
git log --no-merges -p branch-start..branch-end
``` |
50091802 | VS Code Commit Undo | 22 | 2018-04-29 22:12:55 | <p>I have quite a few changes that I would like to commit to new a branch but I've accidentally been working on the master in VS Code. This wouldn't have been an issue until I have accidentally clicked "Undo Last Commit" (twice, not once) because I almost published to master.</p>
<p>I am now especially worried that my... | 62,009 | 7,556,011 | 2024-11-14 12:16:24 | 50,092,222 | 20 | 2018-04-29 23:23:22 | 7,556,011 | 2018-04-29 23:23:22 | https://stackoverflow.com/q/50091802 | https://stackoverflow.com/a/50092222 | <p>The answer is really quite simple after looking into what "undo" actually does.</p>
<p>VS Code "Undo Last Commit" simply runs <code>git reset HEAD~</code>. These actions are in the output if you open up the "GIT" tab. The solution however can be found by looking at what was recorded by running <code>git reflog</cod... | <p>The answer is really quite simple after looking into what "undo" actually does.</p> <p>VS Code "Undo Last Commit" simply runs <code>git reset HEAD~</code>. These actions are in the output if you open up the "GIT" tab. The solution however can be found by looking at what was recorded by running <code>git reflog</cod... | 119, 111608 | git, visual-studio-code | <h1>VS Code Commit Undo</h1>
<p>I have quite a few changes that I would like to commit to new a branch but I've accidentally been working on the master in VS Code. This wouldn't have been an issue until I have accidentally clicked "Undo Last Commit" (twice, not once) because I almost published to master.</p>
<p>I am n... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,510 | git | # VS Code Commit Undo
I have quite a few changes that I would like to commit to new a branch but I've accidentally been working on the master in VS Code. This wouldn't have been an issue until I have accidentally clicked "Undo Last Commit" (twice, not once) because I almost published to master.
I am now especially wo... | The answer is really quite simple after looking into what "undo" actually does.
VS Code "Undo Last Commit" simply runs `git reset HEAD~`. These actions are in the output if you open up the "GIT" tab. The solution however can be found by looking at what was recorded by running `git reflog` and then manually running the... |
45232039 | Is it possible to compare two directories in Git | 22 | 2017-07-21 07:50:42 | <p>I have installed <a href="http://meldmerge.org/" rel="noreferrer">Meld</a> as diff tool in Git. Is it possible to compare two folders using Git or any other way? I tried the following command but nothing happened.</p>
<pre><code>git diff /c/sample/folder1/ /c/sample/folder2/
</code></pre>
| 53,485 | 4,318,982 | 2024-03-21 17:27:24 | 45,232,557 | 20 | 2017-07-21 08:17:11 | 86,072 | 2024-03-21 17:27:24 | https://stackoverflow.com/q/45232039 | https://stackoverflow.com/a/45232557 | <p>If you want to compare two directories on your disk, no need for <code>git</code> :</p>
<pre><code># use any suitable diff viewer : meld, kdiff3 ...
meld /c/sample/folder1/ /c/sample/folder2/
</code></pre>
<p>If you want to have a directory view for the diff between two commits in git :</p>
<pre><code>git difftool -... | <p>If you want to compare two directories on your disk, no need for <code>git</code> :</p> <pre><code># use any suitable diff viewer : meld, kdiff3 ... meld /c/sample/folder1/ /c/sample/folder2/ </code></pre> <p>If you want to have a directory view for the diff between two commits in git :</p> <pre><code>git difftool -... | 119, 606, 13630 | diff, git, meld | <h1>Is it possible to compare two directories in Git</h1>
<p>I have installed <a href="http://meldmerge.org/" rel="noreferrer">Meld</a> as diff tool in Git. Is it possible to compare two folders using Git or any other way? I tried the following command but nothing happened.</p>
<pre><code>git diff /c/sample/folder1/ /... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,511 | git | # Is it possible to compare two directories in Git
I have installed [Meld](http://meldmerge.org/) as diff tool in Git. Is it possible to compare two folders using Git or any other way? I tried the following command but nothing happened.
```
git diff /c/sample/folder1/ /c/sample/folder2/
``` | If you want to compare two directories on your disk, no need for `git` :
```
# use any suitable diff viewer : meld, kdiff3 ...
meld /c/sample/folder1/ /c/sample/folder2/
```
If you want to have a directory view for the diff between two commits in git :
```
git difftool -d <commit1> <commit2>
# you can also restrict... |
12873533 | How to detect pending changes in libgit2sharp? | 22 | 2012-10-13 13:25:16 | <p>In libgit2sharp <a href="https://github.com/libgit2/libgit2sharp/" rel="noreferrer">https://github.com/libgit2/libgit2sharp/</a> how do you check for pending/uncommitted changes?</p>
| 7,534 | 53,158 | 2020-05-14 17:00:19 | 30,311,693 | 20 | 2015-05-18 19:51:13 | 3,902,302 | 2020-05-14 17:00:19 | https://stackoverflow.com/q/12873533 | https://stackoverflow.com/a/30311693 | <p>The following works for me:</p>
<pre><code>///DEPRECATED - see comment from @derptastic
public bool HasUncommittedChanges
{
get
{
using (var repo = new Repository(repositoryRoot))
{
RepositoryStatus status = repo.RetrieveStatus();
return status.IsDirty;
}
... | <p>The following works for me:</p> <pre><code>///DEPRECATED - see comment from @derptastic public bool HasUncommittedChanges { get { using (var repo = new Repository(repositoryRoot)) { RepositoryStatus status = repo.RetrieveStatus(); return status.IsDirty; } ... | 1, 9, 74777 | .net, c#, libgit2sharp | <h1>How to detect pending changes in libgit2sharp?</h1>
<p>In libgit2sharp <a href="https://github.com/libgit2/libgit2sharp/" rel="noreferrer">https://github.com/libgit2/libgit2sharp/</a> how do you check for pending/uncommitted changes?</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,512 | git | # How to detect pending changes in libgit2sharp?
In libgit2sharp <https://github.com/libgit2/libgit2sharp/> how do you check for pending/uncommitted changes? | The following works for me:
```
///DEPRECATED - see comment from @derptastic
public bool HasUncommittedChanges
{
get
{
using (var repo = new Repository(repositoryRoot))
{
RepositoryStatus status = repo.RetrieveStatus();
return status.IsDirty;
}
}
}
```
Thank... |
25661952 | Does git de-duplicate between files? | 22 | 2014-09-04 09:32:39 | <p>If my repository contains several copies of the same files with only small changes (don't ask why), will git save space by only storing the differences between the files?</p>
| 4,361 | 746,346 | 2023-07-14 05:45:16 | 25,662,708 | 20 | 2014-09-04 10:07:39 | 1,256,452 | 2014-09-04 10:07:39 | https://stackoverflow.com/q/25661952 | https://stackoverflow.com/a/25662708 | <p>It <em>could</em>, but it is very hard to say whether it <em>will</em>. There are situations where it is guaranteed that it <em>won't</em>.</p>
<p>To understand this answer (and its limitations) we must look at the way git stores objects. There's a good description of the format of "git objects" (as stored in <co... | <p>It <em>could</em>, but it is very hard to say whether it <em>will</em>. There are situations where it is guaranteed that it <em>won't</em>.</p> <p>To understand this answer (and its limitations) we must look at the way git stores objects. There's a good description of the format of "git objects" (as stored in <co... | 119 | git | <h1>Does git de-duplicate between files?</h1>
<p>If my repository contains several copies of the same files with only small changes (don't ask why), will git save space by only storing the differences between the files?</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,513 | git | # Does git de-duplicate between files?
If my repository contains several copies of the same files with only small changes (don't ask why), will git save space by only storing the differences between the files? | It *could*, but it is very hard to say whether it *will*. There are situations where it is guaranteed that it *won't*.
To understand this answer (and its limitations) we must look at the way git stores objects. There's a good description of the format of "git objects" (as stored in `.git/objects/`) in [this stackoverf... |
17562439 | Git repo keeps showing modified files even in a fresh clone | 22 | 2013-07-10 04:27:37 | <p>I am having a strange issue I have never had before with a Git repo. I have not edited any files however when I run <code>git status</code> I get the result in the image below that shows a whole folder of <code>modified</code> files. The strange thing is, I cannot even <code>git add FILENAME</code> or similar comm... | 4,399 | 143,030 | 2014-06-06 05:43:41 | 17,564,275 | 20 | 2013-07-10 06:59:13 | null | 2014-06-06 05:42:23 | https://stackoverflow.com/q/17562439 | https://stackoverflow.com/a/17564275 | <h2>Update</h2>
<p>I figured out why only Windows users are having problems:</p>
<pre class="lang-bash prettyprint-override"><code>$ git ls-files | grep -i class.bat
etc/apps/phpsysinfo/plugins/BAT/class.BAT.inc.php
etc/apps/phpsysinfo/plugins/bat/class.bat.inc.php
</code></pre>
<p>In the Git index file, both the up... | <h2>Update</h2> <p>I figured out why only Windows users are having problems:</p> <pre class="lang-bash prettyprint-override"><code>$ git ls-files | grep -i class.bat etc/apps/phpsysinfo/plugins/BAT/class.BAT.inc.php etc/apps/phpsysinfo/plugins/bat/class.bat.inc.php </code></pre> <p>In the Git index file, both the up... | 119 | git | <h1>Git repo keeps showing modified files even in a fresh clone</h1>
<p>I am having a strange issue I have never had before with a Git repo. I have not edited any files however when I run <code>git status</code> I get the result in the image below that shows a whole folder of <code>modified</code> files. The strange ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,514 | git | # Git repo keeps showing modified files even in a fresh clone
I am having a strange issue I have never had before with a Git repo. I have not edited any files however when I run `git status` I get the result in the image below that shows a whole folder of `modified` files. The strange thing is, I cannot even `git add ... | ## Update
I figured out why only Windows users are having problems:
```
$ git ls-files | grep -i class.bat
etc/apps/phpsysinfo/plugins/BAT/class.BAT.inc.php
etc/apps/phpsysinfo/plugins/bat/class.bat.inc.php
```
In the Git index file, both the upper case and lower case versions exist. Linux users must be getting both... |
11844581 | git delete and recreate branch | 22 | 2012-08-07 11:05:07 | <p>Abstract: To reproduce the error</p>
<ul>
<li>create a branch and check it out</li>
<li>let someone else delete it and create a new branch with the same name</li>
<li>now do <code>git branch -D <branch></code> and <code>git checkout -b <branch> --track origin/<branch></code></li>
<li>on a <code>gi... | 57,526 | 727,300 | 2018-12-17 16:31:59 | 12,146,705 | 20 | 2012-08-27 17:34:09 | 727,300 | 2012-08-30 10:27:53 | https://stackoverflow.com/q/11844581 | https://stackoverflow.com/a/12146705 | <p>i had to delete the tracking branch as well</p>
<pre><code>git branch -d -r origin/develop
</code></pre>
| <p>i had to delete the tracking branch as well</p> <pre><code>git branch -d -r origin/develop </code></pre> | 119 | git | <h1>git delete and recreate branch</h1>
<p>Abstract: To reproduce the error</p>
<ul>
<li>create a branch and check it out</li>
<li>let someone else delete it and create a new branch with the same name</li>
<li>now do <code>git branch -D <branch></code> and <code>git checkout -b <branch> --track origin/<... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,515 | git | # git delete and recreate branch
Abstract: To reproduce the error
- create a branch and check it out
- let someone else delete it and create a new branch with the same name
- now do `git branch -D <branch>` and `git checkout -b <branch> --track origin/<branch>`
- on a `git pull` you get `! [rejected] <branch> -> orig... | i had to delete the tracking branch as well
```
git branch -d -r origin/develop
``` |
4890772 | How to remove remote origin/refs/heads/master | 22 | 2011-02-03 19:34:31 | <p>Don't ask me how but I managed to get accidentally the following remote branches in a git repository:</p>
<pre><code>$ git branch -r
origin/HEAD -> origin/master
origin/master
origin/refs/heads/master
</code></pre>
<p>All are pointing to the same commit. How can I remove the unnecessary listing for <code... | 37,888 | 85,514 | 2012-05-12 00:06:29 | 4,920,344 | 20 | 2011-02-07 10:45:07 | 85,514 | 2011-02-07 10:45:07 | https://stackoverflow.com/q/4890772 | https://stackoverflow.com/a/4920344 | <p>The solution was to delete the branch <code>refs/heads/refs/heads/master</code></p>
<pre><code>git push origin :refs/heads/refs/heads/master
</code></pre>
| <p>The solution was to delete the branch <code>refs/heads/refs/heads/master</code></p> <pre><code>git push origin :refs/heads/refs/heads/master </code></pre> | 119, 31678 | git, remote-branch | <h1>How to remove remote origin/refs/heads/master</h1>
<p>Don't ask me how but I managed to get accidentally the following remote branches in a git repository:</p>
<pre><code>$ git branch -r
origin/HEAD -> origin/master
origin/master
origin/refs/heads/master
</code></pre>
<p>All are pointing to the same comm... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,516 | git | # How to remove remote origin/refs/heads/master
Don't ask me how but I managed to get accidentally the following remote branches in a git repository:
```
$ git branch -r
origin/HEAD -> origin/master
origin/master
origin/refs/heads/master
```
All are pointing to the same commit. How can I remove the unnecessary... | The solution was to delete the branch `refs/heads/refs/heads/master`
```
git push origin :refs/heads/refs/heads/master
``` |
43721726 | Merging branches with Git in IntelliJ IDE | 21 | 2017-05-01 15:31:47 | <p>I know there are dozens of questions on this, but I'm having trouble. First off, I'm using Webstorm (IntelliJ) not the command line. Second, this seems to vary by perspective.</p>
<p>I have my master branch, obviously. I created a new branch called "InlineEditing". I've been working in this branch for a couple d... | 59,313 | null | 2020-11-18 14:36:09 | 43,721,877 | 20 | 2017-05-01 15:41:54 | 1,863,229 | 2017-05-01 15:41:54 | https://stackoverflow.com/q/43721726 | https://stackoverflow.com/a/43721877 | <p>The standard workflow you are following goes something like this:</p>
<pre><code>git checkout InlineEditing
# work work work
git commit -m 'finished my work'
# now switch to master and merge the feature branch into it
git checkout master
git merge InlineEditing
# resolve any merge conflicts; IntelliJ is great for ... | <p>The standard workflow you are following goes something like this:</p> <pre><code>git checkout InlineEditing # work work work git commit -m 'finished my work' # now switch to master and merge the feature branch into it git checkout master git merge InlineEditing # resolve any merge conflicts; IntelliJ is great for ... | 119, 717, 8945 | git, intellij-idea, merge | <h1>Merging branches with Git in IntelliJ IDE</h1>
<p>I know there are dozens of questions on this, but I'm having trouble. First off, I'm using Webstorm (IntelliJ) not the command line. Second, this seems to vary by perspective.</p>
<p>I have my master branch, obviously. I created a new branch called "InlineEditin... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,517 | git | # Merging branches with Git in IntelliJ IDE
I know there are dozens of questions on this, but I'm having trouble. First off, I'm using Webstorm (IntelliJ) not the command line. Second, this seems to vary by perspective.
I have my master branch, obviously. I created a new branch called "InlineEditing". I've been worki... | The standard workflow you are following goes something like this:
```
git checkout InlineEditing
# work work work
git commit -m 'finished my work'
# now switch to master and merge the feature branch into it
git checkout master
git merge InlineEditing
# resolve any merge conflicts; IntelliJ is great for this step
```
... |
21115596 | Remove a merge commit, keeping current changes | 21 | 2014-01-14 14:08:09 | <p>We have had a small problem in our team. One dev had to include some changes in our development branch. Before doing so, he accidentally merged a feature branch (which shouldn't be merged then) and kept on working over those changes, generating a couple of commits after the merge.</p>
<p>Now we want to keep those c... | 29,945 | 1,658,749 | 2017-02-24 23:00:13 | 21,115,936 | 20 | 2014-01-14 14:23:32 | 10,556 | 2014-01-14 14:23:32 | https://stackoverflow.com/q/21115596 | https://stackoverflow.com/a/21115936 | <p>This is a job for <code>git rebase -i</code>. Run:</p>
<pre><code>git rebase -i F
</code></pre>
<p>You'll be presented with a list of commits in <code>${EDITOR}</code>, like so:</p>
<pre><code>pick 334ad92 D
pick fb54c42 E
pick 6901e51 B
pick 6c61a52 A
# Rebase eea2847..6c61a52 onto eea2847
#
# (more instruction... | <p>This is a job for <code>git rebase -i</code>. Run:</p> <pre><code>git rebase -i F </code></pre> <p>You'll be presented with a list of commits in <code>${EDITOR}</code>, like so:</p> <pre><code>pick 334ad92 D pick fb54c42 E pick 6901e51 B pick 6c61a52 A # Rebase eea2847..6c61a52 onto eea2847 # # (more instruction... | 119, 717, 5597 | commit, git, merge | <h1>Remove a merge commit, keeping current changes</h1>
<p>We have had a small problem in our team. One dev had to include some changes in our development branch. Before doing so, he accidentally merged a feature branch (which shouldn't be merged then) and kept on working over those changes, generating a couple of comm... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,519 | git | # Remove a merge commit, keeping current changes
We have had a small problem in our team. One dev had to include some changes in our development branch. Before doing so, he accidentally merged a feature branch (which shouldn't be merged then) and kept on working over those changes, generating a couple of commits after... | This is a job for `git rebase -i`. Run:
```
git rebase -i F
```
You'll be presented with a list of commits in `${EDITOR}`, like so:
```
pick 334ad92 D
pick fb54c42 E
pick 6901e51 B
pick 6c61a52 A
# Rebase eea2847..6c61a52 onto eea2847
#
# (more instructions here)
```
Delete the `pick fb54c42 E` line to remove that... |
8895915 | git rebase and deleted rebasing branches causing "Interactive rebase already started" error message | 21 | 2012-01-17 14:03:55 | <p>I was trying something out with a couple of branches so I rebased on a temporary branch and was in the middle of resolving some conflicts when I decided to not to complete the rebase it out another way. I then deleted the temporary branch involved and went on my merry way. A couple of hours later I wanted to rebase ... | 21,192 | 378,887 | 2013-01-30 02:00:03 | 8,897,035 | 20 | 2012-01-17 15:15:03 | 119,963 | 2012-01-17 15:15:03 | https://stackoverflow.com/q/8895915 | https://stackoverflow.com/a/8897035 | <p>Hm, that's awkward. Recreating the branch would've been my first try too. Failing that, you should be able to remove the <code>.git/rebase-merge</code> directory, which contains the rebase state. (Move it to the side instead to be safe, if you want.) Once that's gone, Git shouldn't have any way to know there was a r... | <p>Hm, that's awkward. Recreating the branch would've been my first try too. Failing that, you should be able to remove the <code>.git/rebase-merge</code> directory, which contains the rebase state. (Move it to the side instead to be safe, if you want.) Once that's gone, Git shouldn't have any way to know there was a r... | 119, 8974 | git, rebase | <h1>git rebase and deleted rebasing branches causing "Interactive rebase already started" error message</h1>
<p>I was trying something out with a couple of branches so I rebased on a temporary branch and was in the middle of resolving some conflicts when I decided to not to complete the rebase it out another way. I the... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,520 | git | # git rebase and deleted rebasing branches causing "Interactive rebase already started" error message
I was trying something out with a couple of branches so I rebased on a temporary branch and was in the middle of resolving some conflicts when I decided to not to complete the rebase it out another way. I then deleted... | Hm, that's awkward. Recreating the branch would've been my first try too. Failing that, you should be able to remove the `.git/rebase-merge` directory, which contains the rebase state. (Move it to the side instead to be safe, if you want.) Once that's gone, Git shouldn't have any way to know there was a rebase in progr... |
65630304 | git revert --continue stuck never finishes | 20 | 2021-01-08 13:54:31 | <p>I did a git revert {commithash} in my project to go to a previous feature deployed.
The merge was resolved, all the changes were added and I got into the status:</p>
<blockquote>
<p>On branch develop</p>
<p>You are currently reverting commit {commithash}.<br />
(all conflicts fixed: run "git revert --continue&q... | 8,156 | 5,365,730 | 2021-01-09 01:31:48 | 65,638,479 | 20 | 2021-01-09 01:31:48 | 1,256,452 | 2021-01-09 01:31:48 | https://stackoverflow.com/q/65630304 | https://stackoverflow.com/a/65638479 | <p>When you get that "nothing to commit" message, it means that while resolving the conflicts, you chose the code that was already in the latest commit. The end result is that your revert <em>makes no changes to the state of the code</em>. The <code>git revert --continue</code> you're trying to issue can't ... | <p>When you get that "nothing to commit" message, it means that while resolving the conflicts, you chose the code that was already in the latest commit. The end result is that your revert <em>makes no changes to the state of the code</em>. The <code>git revert --continue</code> you're trying to issue can't ... | 119, 12309 | git, revert | <h1>git revert --continue stuck never finishes</h1>
<p>I did a git revert {commithash} in my project to go to a previous feature deployed.
The merge was resolved, all the changes were added and I got into the status:</p>
<blockquote>
<p>On branch develop</p>
<p>You are currently reverting commit {commithash}.<br />
(al... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,523 | git | # git revert --continue stuck never finishes
I did a git revert {commithash} in my project to go to a previous feature deployed.
The merge was resolved, all the changes were added and I got into the status:
> On branch develop
>
> You are currently reverting commit {commithash}.
> (all conflicts fixed: run "git rev... | When you get that "nothing to commit" message, it means that while resolving the conflicts, you chose the code that was already in the latest commit. The end result is that your revert *makes no changes to the state of the code*. The `git revert --continue` you're trying to issue can't finish the revert.
You can, if y... |
29383444 | How to create git patch from two files? | 20 | 2015-04-01 05:28:39 | <p>I am a newbie to git and I was just wondering, if it's possible to create a git patch from two different file. There is no git repo, the scenario is that I have a file and I modified it, now I want to create a patch with the difference between these two files. Any pointers? Or should I just go ahead with creating a ... | 13,692 | 773,079 | 2024-05-24 13:58:24 | 29,383,641 | 20 | 2015-04-01 05:44:46 | 6,309 | 2023-09-03 18:36:55 | https://stackoverflow.com/q/29383444 | https://stackoverflow.com/a/29383641 | <p>Looking at the <a href="http://git-scm.com/docs/git-diff" rel="noreferrer"><code>git diff</code> man page</a>, you can try with:</p>
<pre><code>git diff --no-index --patch
</code></pre>
<p>With:</p>
<pre><code>git diff --no-index [--options] [--] [<path>…]
</code></pre>
<blockquote>
<p>This form is to compare... | <p>Looking at the <a href="http://git-scm.com/docs/git-diff" rel="noreferrer"><code>git diff</code> man page</a>, you can try with:</p> <pre><code>git diff --no-index --patch </code></pre> <p>With:</p> <pre><code>git diff --no-index [--options] [--] [<path>…] </code></pre> <blockquote> <p>This form is to compare... | 119, 53850, 62078 | git, git-commit, git-patch | <h1>How to create git patch from two files?</h1>
<p>I am a newbie to git and I was just wondering, if it's possible to create a git patch from two different file. There is no git repo, the scenario is that I have a file and I modified it, now I want to create a patch with the difference between these two files. Any poi... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,524 | git | # How to create git patch from two files?
I am a newbie to git and I was just wondering, if it's possible to create a git patch from two different file. There is no git repo, the scenario is that I have a file and I modified it, now I want to create a patch with the difference between these two files. Any pointers? Or... | Looking at the [`git diff` man page](http://git-scm.com/docs/git-diff), you can try with:
```
git diff --no-index --patch
```
With:
```
git diff --no-index [--options] [--] [<path>…]
```
> This form is to compare the given two paths on the filesystem.
> You can omit the `--no-index` option when running the comman... |
9751928 | Git: best way to remove all changes from a given file for one branch | 20 | 2012-03-17 17:03:58 | <p>I have a bit of a messy branch with 20 or so commits, and I'm preparing for a merge back to master. I've rebased it off master, and looking closer, I realise that there are files being modified in ways that are totally irrelevant to this branch, and not ready to be committed. The changes to those files aren't confin... | 6,219 | 263,268 | 2018-06-04 14:40:45 | 9,752,553 | 20 | 2012-03-17 18:19:00 | 123,109 | 2012-03-17 18:19:00 | https://stackoverflow.com/q/9751928 | https://stackoverflow.com/a/9752553 | <p>Say your history is</p>
<pre>$ git lola
* 6473d7f (master) Update
| * 9bcfa7e (HEAD, topic) Munge a, b, and c
| * 99af942 Munge b and c
| * 8383e2c Munge a and b
|/
* d1363f4 Baseline</pre>
<p>Note: <a href="http://blog.kfish.org/2010/04/git-lola.html" rel="noreferrer"><code>lola</code></a> is a non-standard but h... | <p>Say your history is</p> <pre>$ git lola * 6473d7f (master) Update | * 9bcfa7e (HEAD, topic) Munge a, b, and c | * 99af942 Munge b and c | * 8383e2c Munge a and b |/ * d1363f4 Baseline</pre> <p>Note: <a href="http://blog.kfish.org/2010/04/git-lola.html" rel="noreferrer"><code>lola</code></a> is a non-standard but h... | 119, 28897, 29934, 76220 | git, git-branch, git-merge, git-rebase | <h1>Git: best way to remove all changes from a given file for one branch</h1>
<p>I have a bit of a messy branch with 20 or so commits, and I'm preparing for a merge back to master. I've rebased it off master, and looking closer, I realise that there are files being modified in ways that are totally irrelevant to this b... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,526 | git | # Git: best way to remove all changes from a given file for one branch
I have a bit of a messy branch with 20 or so commits, and I'm preparing for a merge back to master. I've rebased it off master, and looking closer, I realise that there are files being modified in ways that are totally irrelevant to this branch, an... | Say your history is
```
$ git lola
* 6473d7f (master) Update
| * 9bcfa7e (HEAD, topic) Munge a, b, and c
| * 99af942 Munge b and c
| * 8383e2c Munge a and b
|/
* d1363f4 Baseline
```
Note: [`lola`](http://blog.kfish.org/2010/04/git-lola.html) is a non-standard but helpful alias.
The commits have modified three diffe... |
3722672 | What is the origin of the name 'dcommit' in git svn dcommit? | 20 | 2010-09-15 23:42:59 | <p>Does <code>dcommit</code> stand for Distributed Commit? Something else?</p>
| 1,804 | 53,529 | 2015-02-23 13:35:38 | 3,722,706 | 20 | 2010-09-15 23:48:11 | 334,849 | 2015-02-23 13:35:38 | https://stackoverflow.com/q/3722672 | https://stackoverflow.com/a/3722706 | <p>According to <a href="http://samv.github.io/blog/2007/02/10-An_introduction_to_gits.html" rel="noreferrer">this link</a>, it stands for <code>Delta Commit</code>. More specifically:</p>
<ul>
<li>The command to use is git svn
dcommit. The d stands for delta
(there used to be a git svn commit
command that has since ... | <p>According to <a href="http://samv.github.io/blog/2007/02/10-An_introduction_to_gits.html" rel="noreferrer">this link</a>, it stands for <code>Delta Commit</code>. More specifically:</p> <ul> <li>The command to use is git svn dcommit. The d stands for delta (there used to be a git svn commit command that has since ... | 119, 6452, 38432 | dcommit, git, git-svn | <h1>What is the origin of the name 'dcommit' in git svn dcommit?</h1>
<p>Does <code>dcommit</code> stand for Distributed Commit? Something else?</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,528 | git | # What is the origin of the name 'dcommit' in git svn dcommit?
Does `dcommit` stand for Distributed Commit? Something else? | According to [this link](http://samv.github.io/blog/2007/02/10-An_introduction_to_gits.html), it stands for `Delta Commit`. More specifically:
- The command to use is git svn
dcommit. The d stands for delta
(there used to be a git svn commit
command that has since been renamed
to git svn set-tree because its
... |
1655116 | Search git history for a change in a merge commit | 20 | 2009-10-31 18:08:50 | <p>To search for a string that has been added/removed in git history I can do</p>
<pre><code>git log -S'some text'
</code></pre>
<p>This works great except that it doesn't search through merge commits. How do I get the command to include merge commits in the search?</p>
| 5,530 | 162,337 | 2009-10-31 19:32:40 | 1,655,154 | 20 | 2009-10-31 18:19:07 | 162,337 | 2009-10-31 18:19:07 | https://stackoverflow.com/q/1655116 | https://stackoverflow.com/a/1655154 | <p>it appears that the -m flag gives me the desired result</p>
<pre><code>git log -m -S'some text'
</code></pre>
<p>I found this on another site, if someone could point me in the direction of a man page that includes this flag that would be great. This one doesn't include it <a href="http://ftp.kernel.org/pub/softwar... | <p>it appears that the -m flag gives me the desired result</p> <pre><code>git log -m -S'some text' </code></pre> <p>I found this on another site, if someone could point me in the direction of a man page that includes this flag that would be great. This one doesn't include it <a href="http://ftp.kernel.org/pub/softwar... | 119, 816, 1318 | git, history, search | <h1>Search git history for a change in a merge commit</h1>
<p>To search for a string that has been added/removed in git history I can do</p>
<pre><code>git log -S'some text'
</code></pre>
<p>This works great except that it doesn't search through merge commits. How do I get the command to include merge commits in the ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,529 | git | # Search git history for a change in a merge commit
To search for a string that has been added/removed in git history I can do
```
git log -S'some text'
```
This works great except that it doesn't search through merge commits. How do I get the command to include merge commits in the search? | it appears that the -m flag gives me the desired result
```
git log -m -S'some text'
```
I found this on another site, if someone could point me in the direction of a man page that includes this flag that would be great. This one doesn't include it <http://ftp.kernel.org/pub/software/scm/git/docs/git-log.html> |
1306595 | Git confused when merging an update into my subtree | 20 | 2009-08-20 14:31:00 | <p>We previously used many submodules in our main repositories, but to increase the maintainability of our projects we started an experimental branch where we replaced them all with subtrees.</p>
<p>This worked good - but now when I'm trying to update one of the subtrees it erroneously merges the update into a complet... | 3,503 | 20,667 | 2013-10-14 11:54:48 | 1,307,817 | 20 | 2009-08-20 17:53:40 | 42,219 | 2009-08-20 17:53:40 | https://stackoverflow.com/q/1306595 | https://stackoverflow.com/a/1307817 | <p>Unfortunately this is a bug (or missing feature) in the "git merge -s subtree" code. It actually <em>guesses</em> the subtrees that you want to merge. Usually, this magically turns out to be correct, but if your subtree contains a lot of changes (or was originally empty, or whatever), then it can fail spectacularl... | <p>Unfortunately this is a bug (or missing feature) in the "git merge -s subtree" code. It actually <em>guesses</em> the subtrees that you want to merge. Usually, this magically turns out to be correct, but if your subtree contains a lot of changes (or was originally empty, or whatever), then it can fail spectacularl... | 119, 717, 9844, 68200 | git, git-subtree, merge, subtree | <h1>Git confused when merging an update into my subtree</h1>
<p>We previously used many submodules in our main repositories, but to increase the maintainability of our projects we started an experimental branch where we replaced them all with subtrees.</p>
<p>This worked good - but now when I'm trying to update one of... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,530 | git | # Git confused when merging an update into my subtree
We previously used many submodules in our main repositories, but to increase the maintainability of our projects we started an experimental branch where we replaced them all with subtrees.
This worked good - but now when I'm trying to update one of the subtrees it... | Unfortunately this is a bug (or missing feature) in the "git merge -s subtree" code. It actually *guesses* the subtrees that you want to merge. Usually, this magically turns out to be correct, but if your subtree contains a lot of changes (or was originally empty, or whatever), then it can fail spectacularly.
The best... |
907004 | Gitosis requires password even though the public key is given | 20 | 2009-05-25 14:45:58 | <p>I'm confronted with some problems when trying to configure gitosis on my Archlinux</p>
<p><a href="http://wiki.archlinux.org/index.php/Setting_Up_Git_ACL_Using_gitosis" rel="noreferrer">http://wiki.archlinux.org/index.php/Setting_Up_Git_ACL_Using_gitosis</a></p>
<p>I referred to this wiki article and successfully ... | 18,899 | 111,896 | 2018-01-10 14:47:52 | 907,047 | 20 | 2009-05-25 14:57:45 | 40,511 | 2009-05-25 14:57:45 | https://stackoverflow.com/q/907004 | https://stackoverflow.com/a/907047 | <p>An empty repository was created because that's just how git works: it has to init a repo before it can start pulling remote objects into it. Unfortunately this means you'll have to manually delete the empty repo before you try cloning again.</p>
<p>As for why the clone failed, it looks like you're using the wrong ... | <p>An empty repository was created because that's just how git works: it has to init a repo before it can start pulling remote objects into it. Unfortunately this means you'll have to manually delete the empty repo before you try cloning again.</p> <p>As for why the clone failed, it looks like you're using the wrong ... | 119, 529, 24526 | git, gitosis, installation | <h1>Gitosis requires password even though the public key is given</h1>
<p>I'm confronted with some problems when trying to configure gitosis on my Archlinux</p>
<p><a href="http://wiki.archlinux.org/index.php/Setting_Up_Git_ACL_Using_gitosis" rel="noreferrer">http://wiki.archlinux.org/index.php/Setting_Up_Git_ACL_Usin... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,531 | git | # Gitosis requires password even though the public key is given
I'm confronted with some problems when trying to configure gitosis on my Archlinux
<http://wiki.archlinux.org/index.php/Setting_Up_Git_ACL_Using_gitosis>
I referred to this wiki article and successfully installed gitosis.
> $ sudo pacman -U gitosis-git... | An empty repository was created because that's just how git works: it has to init a repo before it can start pulling remote objects into it. Unfortunately this means you'll have to manually delete the empty repo before you try cloning again.
As for why the clone failed, it looks like you're using the wrong syntax for ... |
59309402 | Is git push --force-with-lease always safe? | 19 | 2019-12-12 16:55:59 | <p>I've always followed the rule not to modify the git history once it has been pushed to a remote repository. </p>
<p>But I am wondering if interactive rebasing into a push --force-with-lease bypasses this rule?</p>
<p>Is it perfectly safe for other users if the force-with-lease succeeds or are there any caveats to ... | 12,073 | 11,017,745 | 2025-04-03 21:08:52 | 59,413,159 | 20 | 2019-12-19 15:58:55 | 4,457,885 | 2019-12-19 15:58:55 | https://stackoverflow.com/q/59309402 | https://stackoverflow.com/a/59413159 | <p>I would like to describe a plausible case where the <code>--force-with-lease</code> does not save you from overwriting your colleagues work.</p>
<h2>It all begins with Bob</h2>
<p>doing the following while having an up-to-date master branch checked out:</p>
<pre><code># Creating a new branch called feature/one
$ ... | <p>I would like to describe a plausible case where the <code>--force-with-lease</code> does not save you from overwriting your colleagues work.</p> <h2>It all begins with Bob</h2> <p>doing the following while having an up-to-date master branch checked out:</p> <pre><code># Creating a new branch called feature/one $ ... | 119 | git | <h1>Is git push --force-with-lease always safe?</h1>
<p>I've always followed the rule not to modify the git history once it has been pushed to a remote repository. </p>
<p>But I am wondering if interactive rebasing into a push --force-with-lease bypasses this rule?</p>
<p>Is it perfectly safe for other users if the f... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,533 | git | # Is git push --force-with-lease always safe?
I've always followed the rule not to modify the git history once it has been pushed to a remote repository.
But I am wondering if interactive rebasing into a push --force-with-lease bypasses this rule?
Is it perfectly safe for other users if the force-with-lease succeeds... | I would like to describe a plausible case where the `--force-with-lease` does not save you from overwriting your colleagues work.
## It all begins with Bob
doing the following while having an up-to-date master branch checked out:
```
# Creating a new branch called feature/one
$ git checkout -b feature/one
# Do some... |
5014554 | git svn - error under cygwin | 19 | 2011-02-16 09:16:21 | <p>I have cygwin and git. I'm trying to commit with git to svn - <code>git svn dcommit</code>. But it fails with strange error:</p>
<pre>
$ git svn dcommit
4 [main] perl 5536 C:\cygwin\bin\perl.exe: *** fatal error - unable to remap \\?\C:\cygwin\lib\perl5\5.10\i686-cygwin\auto\List\Util\Util.dll to same address... | 9,276 | 496,825 | 2019-07-01 13:56:03 | 5,014,721 | 20 | 2011-02-16 09:35:22 | 6,309 | 2019-07-01 13:56:03 | https://stackoverflow.com/q/5014554 | https://stackoverflow.com/a/5014721 | <p>Did you try a <strong><a href="https://superuser.com/questions/231590/running-rebaseall-on-cygwin"><code>rebaseall</code></a></strong> like <a href="http://yosanai.com/cygwin-unable-remap-dll-same-address-parent" rel="nofollow noreferrer">described here</a>?</p>
<blockquote>
<p>When you are working with Cygwin, s... | <p>Did you try a <strong><a href="https://superuser.com/questions/231590/running-rebaseall-on-cygwin"><code>rebaseall</code></a></strong> like <a href="http://yosanai.com/cygwin-unable-remap-dll-same-address-parent" rel="nofollow noreferrer">described here</a>?</p> <blockquote> <p>When you are working with Cygwin, s... | 119, 1731 | cygwin, git | <h1>git svn - error under cygwin</h1>
<p>I have cygwin and git. I'm trying to commit with git to svn - <code>git svn dcommit</code>. But it fails with strange error:</p>
<pre>
$ git svn dcommit
4 [main] perl 5536 C:\cygwin\bin\perl.exe: *** fatal error - unable to remap \\?\C:\cygwin\lib\perl5\5.10\i686-cygwin\a... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,536 | git | # git svn - error under cygwin
I have cygwin and git. I'm trying to commit with git to svn - `git svn dcommit`. But it fails with strange error:
```
$ git svn dcommit
4 [main] perl 5536 C:\cygwin\bin\perl.exe: *** fatal error - unable to remap \\?\C:\cygwin\lib\perl5\5.10\i686-cygwin\auto\List\Util\Util.dll to ... | Did you try a **[`rebaseall`](https://superuser.com/questions/231590/running-rebaseall-on-cygwin)** like [described here](http://yosanai.com/cygwin-unable-remap-dll-same-address-parent)?
> When you are working with Cygwin, sometimes you will get an error like this
```
unable to remap some.dll to same address as paren... |
4981052 | How to reparent in Git | 19 | 2011-02-12 22:32:03 | <p>What non-interactive Git command(s) achieve the change from <em>Before</em> to <em>After</em> in each case?</p>
<p><strong>1a. Reparenting I</strong></p>
<p>Before:</p>
<pre><code>A---B---C---D
</code></pre>
<p>After:</p>
<pre><code> C'---D'
/
A---B
</code></pre>
<p><strong>1b. Reparenting II</strong></p>
<p>Befor... | 11,949 | 112,855 | 2023-04-24 16:03:58 | 4,982,356 | 20 | 2011-02-13 03:59:02 | 55,284 | 2021-06-15 18:24:40 | https://stackoverflow.com/q/4981052 | https://stackoverflow.com/a/4982356 | <p>These all look like applications of <code>git rebase --onto</code>.</p>
<h3>1a. Reparenting I</h3>
<p>Before:</p>
<pre><code>A---B---C---D
</code></pre>
<p>After:</p>
<pre><code> C'---D'
/
A---B
</code></pre>
<p>Set up branches to label the particular commits and then rebase onto.</p>
<ol>
<li><code>git checkout -... | <p>These all look like applications of <code>git rebase --onto</code>.</p> <h3>1a. Reparenting I</h3> <p>Before:</p> <pre><code>A---B---C---D </code></pre> <p>After:</p> <pre><code> C'---D' / A---B </code></pre> <p>Set up branches to label the particular commits and then rebase onto.</p> <ol> <li><code>git checkout -... | 119 | git | <h1>How to reparent in Git</h1>
<p>What non-interactive Git command(s) achieve the change from <em>Before</em> to <em>After</em> in each case?</p>
<p><strong>1a. Reparenting I</strong></p>
<p>Before:</p>
<pre><code>A---B---C---D
</code></pre>
<p>After:</p>
<pre><code> C'---D'
/
A---B
</code></pre>
<p><strong>1b. Repa... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,537 | git | # How to reparent in Git
What non-interactive Git command(s) achieve the change from *Before* to *After* in each case?
**1a. Reparenting I**
Before:
```
A---B---C---D
```
After:
```
C'---D'
/
A---B
```
**1b. Reparenting II**
Before:
```
C---D
/
A---B
```
After:
```
C
/
A---B---D'
```
**1c. Reparent... | These all look like applications of `git rebase --onto`.
### 1a. Reparenting I
Before:
```
A---B---C---D
```
After:
```
C'---D'
/
A---B
```
Set up branches to label the particular commits and then rebase onto.
1. `git checkout -b ex1a-b B`
2. `git checkout -b ex1a-d D`
3. `git checkout -b ex1a-a A`
4. `git re... |
1546666 | Rebasing dependent topic branches | 19 | 2009-10-10 00:27:48 | <p>I use a lot of local topic branches in git, and sometimes end up with dependencies between topic branches causing rebase problems. For example, with a structure like:</p>
<pre><code>master ---> featureA ---> featureB
\--> featureC
</code></pre>
<p>If <code>master</code> changes and I ... | 3,379 | 2,963 | 2023-01-12 14:12:41 | 1,546,680 | 20 | 2009-10-10 00:33:32 | 144,699 | 2009-10-10 07:14:42 | https://stackoverflow.com/q/1546666 | https://stackoverflow.com/a/1546680 | <p>After rebasing <code>featureA</code>, you can do</p>
<pre><code>git rebase --onto featureA oldFeatureA featureB
</code></pre>
<p>assuming <code>oldFeatureA</code> represents the commit at the tip of <code>featureA</code> before you rebased it (you can either keep another branch there or just remember the commit ha... | <p>After rebasing <code>featureA</code>, you can do</p> <pre><code>git rebase --onto featureA oldFeatureA featureB </code></pre> <p>assuming <code>oldFeatureA</code> represents the commit at the tip of <code>featureA</code> before you rebased it (you can either keep another branch there or just remember the commit ha... | 119, 8974 | git, rebase | <h1>Rebasing dependent topic branches</h1>
<p>I use a lot of local topic branches in git, and sometimes end up with dependencies between topic branches causing rebase problems. For example, with a structure like:</p>
<pre><code>master ---> featureA ---> featureB
\--> featureC
</code></pre... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,538 | git | # Rebasing dependent topic branches
I use a lot of local topic branches in git, and sometimes end up with dependencies between topic branches causing rebase problems. For example, with a structure like:
```
master ---> featureA ---> featureB
\--> featureC
```
If `master` changes and I get (and r... | After rebasing `featureA`, you can do
```
git rebase --onto featureA oldFeatureA featureB
```
assuming `oldFeatureA` represents the commit at the tip of `featureA` before you rebased it (you can either keep another branch there or just remember the commit hash).
This should basically be the same as cherry-picking ea... |
36214756 | What does `git fetch origin master:master` mean? | 18 | 2016-03-25 05:50:43 | <p>What does <code>git fetch origin master:master</code> mean?</p>
<p>I mean the <code>master:master</code> part: I know what <code>git fetch origin</code> means, but what about the <code>master:master</code> part?</p>
| 9,984 | 2,535,843 | 2024-08-22 14:50:55 | 36,214,802 | 20 | 2016-03-25 05:55:36 | 1,256,452 | 2016-03-25 05:55:36 | https://stackoverflow.com/q/36214756 | https://stackoverflow.com/a/36214802 | <p>The arguments after the <em>remote</em> (<code>origin</code>) are <em>refspecs</em>.</p>
<p>Using <code>master:master</code> will overwrite your <code>master</code> branch; see <a href="https://stackoverflow.com/a/26355802/1256452">this answer</a>.</p>
<p>See <a href="https://stackoverflow.com/a/21544585/1256452">... | <p>The arguments after the <em>remote</em> (<code>origin</code>) are <em>refspecs</em>.</p> <p>Using <code>master:master</code> will overwrite your <code>master</code> branch; see <a href="https://stackoverflow.com/a/26355802/1256452">this answer</a>.</p> <p>See <a href="https://stackoverflow.com/a/21544585/1256452">... | 119, 456 | git, version-control | <h1>What does `git fetch origin master:master` mean?</h1>
<p>What does <code>git fetch origin master:master</code> mean?</p>
<p>I mean the <code>master:master</code> part: I know what <code>git fetch origin</code> means, but what about the <code>master:master</code> part?</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,541 | git | # What does `git fetch origin master:master` mean?
What does `git fetch origin master:master` mean?
I mean the `master:master` part: I know what `git fetch origin` means, but what about the `master:master` part? | The arguments after the *remote* (`origin`) are *refspecs*.
Using `master:master` will overwrite your `master` branch; see [this answer](https://stackoverflow.com/a/26355802/1256452).
See [this answer](https://stackoverflow.com/a/21544585/1256452) for even more about `git fetch`'s behavior with and without refspec ar... |
34111522 | Why Git config list (total) is not the same as system + global + local | 18 | 2015-12-05 22:12:01 | <p>On Git 2.6.3 on Windows, why this command result:</p>
<pre><code>git config --list
</code></pre>
<p>Is not the same as this others:</p>
<pre><code>git config --list --system
git config --list --global
git config --list --local
</code></pre>
<p>The first one has a few more options listed than the sum of the other... | 3,929 | 357,618 | 2016-02-27 14:36:06 | 34,112,678 | 20 | 2015-12-06 00:43:15 | 6,309 | 2016-02-27 14:36:06 | https://stackoverflow.com/q/34111522 | https://stackoverflow.com/a/34112678 | <p><strong>TL;DR</strong>: <code>C:\Users\All Users\Git\config</code>.<br>
See <a href="https://github.com/git-for-windows/git/pull/470/files" rel="noreferrer">git-for-windows PR 470</a></p>
<blockquote>
<p>On Windows, as there is no central <code>/etc/</code> directory, there is yet another config file (located at ... | <p><strong>TL;DR</strong>: <code>C:\Users\All Users\Git\config</code>.<br> See <a href="https://github.com/git-for-windows/git/pull/470/files" rel="noreferrer">git-for-windows PR 470</a></p> <blockquote> <p>On Windows, as there is no central <code>/etc/</code> directory, there is yet another config file (located at ... | 119 | git | <h1>Why Git config list (total) is not the same as system + global + local</h1>
<p>On Git 2.6.3 on Windows, why this command result:</p>
<pre><code>git config --list
</code></pre>
<p>Is not the same as this others:</p>
<pre><code>git config --list --system
git config --list --global
git config --list --local
</code>... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,542 | git | # Why Git config list (total) is not the same as system + global + local
On Git 2.6.3 on Windows, why this command result:
```
git config --list
```
Is not the same as this others:
```
git config --list --system
git config --list --global
git config --list --local
```
The first one has a few more options listed th... | **TL;DR**: `C:\Users\All Users\Git\config`.
See [git-for-windows PR 470](https://github.com/git-for-windows/git/pull/470/files)
> On Windows, as there is no central `/etc/` directory, there is yet another config file (located at `%PROGRAMDATA%\Git\config`), intended to contain
> settings for *all* Git-related softwa... |
29544660 | Your branch and 'origin/master' have diverged, All conflicts fixed but you are still merging | 18 | 2015-04-09 17:01:46 | <p>i am new to GitHub. and using it via Eclipse
we are two people working on a application.
i am getting following status when i check git status in Git shell.</p>
<pre><code>On branch master
Your branch and 'origin/master' have diverged,
and have 2 and 1 different commit each, respectively.
(use "git pull" to merge... | 58,309 | 4,089,983 | 2020-04-02 11:59:29 | 29,545,453 | 20 | 2015-04-09 17:46:32 | 2,234,619 | 2020-04-02 11:59:29 | https://stackoverflow.com/q/29544660 | https://stackoverflow.com/a/29545453 | <p>Git is informing you that you are doing a merge and that your branch and the <code>origin</code> branch have diverged.</p>
<ul>
<li><strong>A merge conflict</strong> - someone has updated code that you have updated</li>
<li><strong>Divergence</strong> - the tip of your branch is different than the tip of the remote... | <p>Git is informing you that you are doing a merge and that your branch and the <code>origin</code> branch have diverged.</p> <ul> <li><strong>A merge conflict</strong> - someone has updated code that you have updated</li> <li><strong>Divergence</strong> - the tip of your branch is different than the tip of the remote... | 119 | git | <h1>Your branch and 'origin/master' have diverged, All conflicts fixed but you are still merging</h1>
<p>i am new to GitHub. and using it via Eclipse
we are two people working on a application.
i am getting following status when i check git status in Git shell.</p>
<pre><code>On branch master
Your branch and 'origin/m... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,544 | git | # Your branch and 'origin/master' have diverged, All conflicts fixed but you are still merging
i am new to GitHub. and using it via Eclipse
we are two people working on a application.
i am getting following status when i check git status in Git shell.
```
On branch master
Your branch and 'origin/master' have diverged... | Git is informing you that you are doing a merge and that your branch and the `origin` branch have diverged.
- **A merge conflict** - someone has updated code that you have updated
- **Divergence** - the tip of your branch is different than the tip of the remote branch
You want to talk to the developer who committed t... |
22654763 | Use BeyondCompare to see difference between files in GIT | 18 | 2014-03-26 08:00:56 | <p>Before I commit my changes, I want to see the difference using BeyondCompare in GIT. How can I configure BeyondCompare to see difference in my files.</p>
<p>I looked at <a href="http://www.scootersoftware.com/support.php?zz=kb_vcs#gitwindows" rel="noreferrer">this link</a> but it did not help.</p>
<p>BeyondCompare... | 28,372 | 1,350,476 | 2024-05-14 05:33:14 | 22,658,305 | 20 | 2014-03-26 10:36:31 | 1,350,476 | 2015-02-20 19:05:24 | https://stackoverflow.com/q/22654763 | https://stackoverflow.com/a/22658305 | <p>This <a href="http://www.scootersoftware.com/support.php?zz=kb_vcs#gitwindows">link</a> tells the way to set up BeyondComapre as the diff tool in git</p>
<pre><code>git config --global diff.tool bc3
git config --global difftool.bc3.path "c:/program files/beyond compare 3/bcomp.exe"
</code></pre>
<p>To launch a dif... | <p>This <a href="http://www.scootersoftware.com/support.php?zz=kb_vcs#gitwindows">link</a> tells the way to set up BeyondComapre as the diff tool in git</p> <pre><code>git config --global diff.tool bc3 git config --global difftool.bc3.path "c:/program files/beyond compare 3/bcomp.exe" </code></pre> <p>To launch a dif... | 119, 9033, 15129, 33007 | beyondcompare, beyondcompare3, git, git-diff | <h1>Use BeyondCompare to see difference between files in GIT</h1>
<p>Before I commit my changes, I want to see the difference using BeyondCompare in GIT. How can I configure BeyondCompare to see difference in my files.</p>
<p>I looked at <a href="http://www.scootersoftware.com/support.php?zz=kb_vcs#gitwindows" rel="no... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,545 | git | # Use BeyondCompare to see difference between files in GIT
Before I commit my changes, I want to see the difference using BeyondCompare in GIT. How can I configure BeyondCompare to see difference in my files.
I looked at [this link](http://www.scootersoftware.com/support.php?zz=kb_vcs#gitwindows) but it did not help.... | This [link](http://www.scootersoftware.com/support.php?zz=kb_vcs#gitwindows) tells the way to set up BeyondComapre as the diff tool in git
```
git config --global diff.tool bc3
git config --global difftool.bc3.path "c:/program files/beyond compare 3/bcomp.exe"
```
To launch a diff using Beyond Compare, use the comman... |
9478496 | Add a Git alias containing a semicolon | 18 | 2012-02-28 08:20:31 | <p>When I try to create an alias</p>
<pre><code>[alias]
my-alias = submodule foreach 'git foo ; git bar'
</code></pre>
<p>Git (version 1.7.1) spews the error</p>
<pre><code>user@host:/path/repo.git$ git my-alias
error: unclosed quote
fatal: Bad alias.my-alias string
</code></pre>
<p>It appears that <code>.gitco... | 6,226 | 319,931 | 2016-04-22 17:32:40 | 9,478,636 | 20 | 2012-02-28 08:31:05 | 319,931 | 2012-02-28 08:37:15 | https://stackoverflow.com/q/9478496 | https://stackoverflow.com/a/9478636 | <p>Wrap the entire alias command in double quotes:</p>
<pre><code>my-alias = "submodule foreach 'git foo ; git bar'"
</code></pre>
<p>The double quotes cause the <code>.gitconfig</code> parser to pass the semicolon. The single quotes are still needed to delimit the argument to <code>submodule foreach</code>; without ... | <p>Wrap the entire alias command in double quotes:</p> <pre><code>my-alias = "submodule foreach 'git foo ; git bar'" </code></pre> <p>The double quotes cause the <code>.gitconfig</code> parser to pass the semicolon. The single quotes are still needed to delimit the argument to <code>submodule foreach</code>; without ... | 119, 1357, 32868 | git, git-config, parsing | <h1>Add a Git alias containing a semicolon</h1>
<p>When I try to create an alias</p>
<pre><code>[alias]
my-alias = submodule foreach 'git foo ; git bar'
</code></pre>
<p>Git (version 1.7.1) spews the error</p>
<pre><code>user@host:/path/repo.git$ git my-alias
error: unclosed quote
fatal: Bad alias.my-alias strin... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,548 | git | # Add a Git alias containing a semicolon
When I try to create an alias
```
[alias]
my-alias = submodule foreach 'git foo ; git bar'
```
Git (version 1.7.1) spews the error
```
user@host:/path/repo.git$ git my-alias
error: unclosed quote
fatal: Bad alias.my-alias string
```
It appears that `.gitconfig` uses wei... | Wrap the entire alias command in double quotes:
```
my-alias = "submodule foreach 'git foo ; git bar'"
```
The double quotes cause the `.gitconfig` parser to pass the semicolon. The single quotes are still needed to delimit the argument to `submodule foreach`; without them, it gets parsed as
```
submodule foreach 'g... |
7902144 | How the working directory is updated on "git checkout"? | 18 | 2011-10-26 11:47:00 | <p>Consider the following "story":</p>
<pre><code>$ mkdir my_project
$ cd my_project
$ git init
Initialized empty Git repository in /home/misha/misha/my_project/.git/
$ echo "first line" > hello.txt
$ git add hello.txt
$ git commit -m "first commit"
[master (root-commit) 9c913a1] first commit
1 files changed, 1 i... | 19,813 | 247,243 | 2021-01-21 11:29:36 | 7,902,600 | 20 | 2011-10-26 12:32:47 | 335,213 | 2011-10-26 12:43:18 | https://stackoverflow.com/q/7902144 | https://stackoverflow.com/a/7902600 | <p>Your git checkout to master prevents you from losing uncommitted changes. Thats why you still have your second line in your <code>hello.txt</code> file. If you really want to lose your uncommitted changes you have to use the <code>-f</code> parameter.</p>
<p>Finally your checkout would look like this:</p>
<pre><co... | <p>Your git checkout to master prevents you from losing uncommitted changes. Thats why you still have your second line in your <code>hello.txt</code> file. If you really want to lose your uncommitted changes you have to use the <code>-f</code> parameter.</p> <p>Finally your checkout would look like this:</p> <pre><co... | 119, 37230, 76220 | git, git-branch, git-checkout | <h1>How the working directory is updated on "git checkout"?</h1>
<p>Consider the following "story":</p>
<pre><code>$ mkdir my_project
$ cd my_project
$ git init
Initialized empty Git repository in /home/misha/misha/my_project/.git/
$ echo "first line" > hello.txt
$ git add hello.txt
$ git commit -m "first commit"
... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,549 | git | # How the working directory is updated on "git checkout"?
Consider the following "story":
```
$ mkdir my_project
$ cd my_project
$ git init
Initialized empty Git repository in /home/misha/misha/my_project/.git/
$ echo "first line" > hello.txt
$ git add hello.txt
$ git commit -m "first commit"
[master (root-commit) 9... | Your git checkout to master prevents you from losing uncommitted changes. Thats why you still have your second line in your `hello.txt` file. If you really want to lose your uncommitted changes you have to use the `-f` parameter.
Finally your checkout would look like this:
```
git checkout -f master
``` |
15375454 | Why does git fail on push/fetch with "Too many open files" | 17 | 2013-03-13 01:29:38 | <p>I'm encountering an issue with Git where I'm receiving the following message:</p>
<pre><code>> git fetch
error: cannot create pipe for ssh: Too many open files
fatal: unable to fork
</code></pre>
<p>The System Administrators have increased my file limit, but it has not corrected the issue. Additionally, I don't... | 21,394 | 644,035 | 2022-07-27 06:49:49 | 15,375,556 | 20 | 2013-03-13 01:40:15 | 82,294 | 2013-03-17 02:02:48 | https://stackoverflow.com/q/15375454 | https://stackoverflow.com/a/15375556 | <p>There are two similar error messages:</p>
<pre>
EMFILE: Too many open files
ENFILE: Too many open files in system
</pre>
<p>It looks like you're getting <code>EMFILE</code>, which means that the number of files for an individual process is being exceeded. So, checking whether <code>vi</code> can open files is irr... | <p>There are two similar error messages:</p> <pre> EMFILE: Too many open files ENFILE: Too many open files in system </pre> <p>It looks like you're getting <code>EMFILE</code>, which means that the number of files for an individual process is being exceeded. So, checking whether <code>vi</code> can open files is irr... | 58, 119, 3574 | config, git, linux | <h1>Why does git fail on push/fetch with "Too many open files"</h1>
<p>I'm encountering an issue with Git where I'm receiving the following message:</p>
<pre><code>> git fetch
error: cannot create pipe for ssh: Too many open files
fatal: unable to fork
</code></pre>
<p>The System Administrators have increased my f... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,554 | git | # Why does git fail on push/fetch with "Too many open files"
I'm encountering an issue with Git where I'm receiving the following message:
```
> git fetch
error: cannot create pipe for ssh: Too many open files
fatal: unable to fork
```
The System Administrators have increased my file limit, but it has not corrected ... | There are two similar error messages:
```
EMFILE: Too many open files
ENFILE: Too many open files in system
```
It looks like you're getting `EMFILE`, which means that the number of files for an individual process is being exceeded. So, checking whether `vi` can open files is irrelevant—`vi` will use its own, separat... |
10662056 | How does git-receive-pack work? | 17 | 2012-05-19 03:24:12 | <p>I would like to know how <a href="https://git-scm.com/docs/git-receive-pack" rel="noreferrer">git-receive-pack</a> works, because I have quite literally no idea what happens with it. Can anyone shed some light on this mystery?</p>
| 15,203 | 1,015,722 | 2025-08-15 23:28:34 | 10,662,097 | 20 | 2012-05-19 03:36:09 | 267,025 | 2022-12-08 21:20:43 | https://stackoverflow.com/q/10662056 | https://stackoverflow.com/a/10662097 | <p><a href="http://schacon.github.io/git/git-receive-pack.html" rel="nofollow noreferrer">According to the man page</a>:</p>
<pre><code>http://schacon.github.io/git/git-receive-pack.html
</code></pre>
<blockquote>
<p>This command is usually not invoked directly by the end user. The UI for the protocol is on the git sen... | <p><a href="http://schacon.github.io/git/git-receive-pack.html" rel="nofollow noreferrer">According to the man page</a>:</p> <pre><code>http://schacon.github.io/git/git-receive-pack.html </code></pre> <blockquote> <p>This command is usually not invoked directly by the end user. The UI for the protocol is on the git sen... | 119 | git | <h1>How does git-receive-pack work?</h1>
<p>I would like to know how <a href="https://git-scm.com/docs/git-receive-pack" rel="noreferrer">git-receive-pack</a> works, because I have quite literally no idea what happens with it. Can anyone shed some light on this mystery?</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,555 | git | # How does git-receive-pack work?
I would like to know how [git-receive-pack](https://git-scm.com/docs/git-receive-pack) works, because I have quite literally no idea what happens with it. Can anyone shed some light on this mystery? | [According to the man page](http://schacon.github.io/git/git-receive-pack.html):
```
http://schacon.github.io/git/git-receive-pack.html
```
> This command is usually not invoked directly by the end user. The UI for the protocol is on the git send-pack side, and the program pair is meant to be used to push updates to ... |
50796326 | Should compiled JavaScript files be committed to Git repo? | 16 | 2018-06-11 11:05:58 | <p>New to TypeScript here and just wondering what the community views as best practice.</p>
<p>When I compile for production, I use the webpack loader. However, when I run my tests, I need to run <code>tsc && ava</code>. This generates a <code>.js</code> equivalent file in the same location as their <code>.ts<... | 5,417 | 5,561,773 | 2018-06-11 11:16:44 | 50,796,373 | 20 | 2018-06-11 11:09:14 | 384,693 | 2018-06-11 11:09:14 | https://stackoverflow.com/q/50796326 | https://stackoverflow.com/a/50796373 | <p>Your assumption is absolutely correct - build artefacts and outputs shouldn't be added to your repository. The main reason for this is that it's easy to end up in a situation where the source <code>.ts</code> file has changed but the compiled <code>.js</code> file differs because it's not been committed at the same ... | <p>Your assumption is absolutely correct - build artefacts and outputs shouldn't be added to your repository. The main reason for this is that it's easy to end up in a situation where the source <code>.ts</code> file has changed but the compiled <code>.js</code> file differs because it's not been committed at the same ... | 3, 119, 84518 | git, javascript, typescript | <h1>Should compiled JavaScript files be committed to Git repo?</h1>
<p>New to TypeScript here and just wondering what the community views as best practice.</p>
<p>When I compile for production, I use the webpack loader. However, when I run my tests, I need to run <code>tsc && ava</code>. This generates a <code... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,557 | git | # Should compiled JavaScript files be committed to Git repo?
New to TypeScript here and just wondering what the community views as best practice.
When I compile for production, I use the webpack loader. However, when I run my tests, I need to run `tsc && ava`. This generates a `.js` equivalent file in the same locati... | Your assumption is absolutely correct - build artefacts and outputs shouldn't be added to your repository. The main reason for this is that it's easy to end up in a situation where the source `.ts` file has changed but the compiled `.js` file differs because it's not been committed at the same time.
You also add compl... |
40004915 | How do I check which merge tool I use? | 16 | 2016-10-12 17:34:52 | <p>I want to check which merge tool my git is set to - I just don't remember the name. I know I can wait till the next merge opportunity to run it via <code>git merge tool</code> and see what was it, but I'd like to type something like <code>git mergetool status</code> to see what is the tool (and what is the version, ... | 16,106 | 3,886,961 | 2024-05-23 22:17:06 | 40,006,861 | 20 | 2016-10-12 19:30:37 | 6,317,147 | 2024-05-23 22:17:06 | https://stackoverflow.com/q/40004915 | https://stackoverflow.com/a/40006861 | <p>to see what git resolves as the difftool, over the different config files:</p>
<pre><code>git config --get merge.tool
</code></pre>
<p>If the result is not a builtin, then to see how it is configured:</p>
<pre><code>git config --get mergetool.THE_MERGE_TOOL.cmd
git config --get mergetool.THE_MERGE_TOOL.trustexitcode... | <p>to see what git resolves as the difftool, over the different config files:</p> <pre><code>git config --get merge.tool </code></pre> <p>If the result is not a builtin, then to see how it is configured:</p> <pre><code>git config --get mergetool.THE_MERGE_TOOL.cmd git config --get mergetool.THE_MERGE_TOOL.trustexitcode... | 119, 25165 | git, mergetool | <h1>How do I check which merge tool I use?</h1>
<p>I want to check which merge tool my git is set to - I just don't remember the name. I know I can wait till the next merge opportunity to run it via <code>git merge tool</code> and see what was it, but I'd like to type something like <code>git mergetool status</code> to... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,558 | git | # How do I check which merge tool I use?
I want to check which merge tool my git is set to - I just don't remember the name. I know I can wait till the next merge opportunity to run it via `git merge tool` and see what was it, but I'd like to type something like `git mergetool status` to see what is the tool (and what... | to see what git resolves as the difftool, over the different config files:
```
git config --get merge.tool
```
If the result is not a builtin, then to see how it is configured:
```
git config --get mergetool.THE_MERGE_TOOL.cmd
git config --get mergetool.THE_MERGE_TOOL.trustexitcode
```
see git help config |
30017072 | git fetch upstream doesn't work | 16 | 2015-05-03 17:32:05 | <p>I'm trying to use <code>git fetch upstream master</code> to get the latest commit from another user's repository. But unfortunately that doesn't work. I have also tried <code>git fetch upstream</code>.</p>
<p>What does work is <code>git pull upstream master</code>, but I don't want to use that all the time, because... | 19,510 | 3,299,347 | 2015-05-03 19:10:18 | 30,017,119 | 20 | 2015-05-03 17:36:32 | 6,309 | 2015-05-03 18:41:42 | https://stackoverflow.com/q/30017072 | https://stackoverflow.com/a/30017119 | <p>The fetch did work, but to see the result, you should do a:</p>
<pre><code>git log --oneline --all --graph --decorate --branches
</code></pre>
<p>You would see the upstream branches (including the upstream/master)</p>
<p>You can also check the latest SHA1 fetched with:</p>
<pre><code>git branch -avv
</code></pre... | <p>The fetch did work, but to see the result, you should do a:</p> <pre><code>git log --oneline --all --graph --decorate --branches </code></pre> <p>You would see the upstream branches (including the upstream/master)</p> <p>You can also check the latest SHA1 fetched with:</p> <pre><code>git branch -avv </code></pre... | 119 | git | <h1>git fetch upstream doesn't work</h1>
<p>I'm trying to use <code>git fetch upstream master</code> to get the latest commit from another user's repository. But unfortunately that doesn't work. I have also tried <code>git fetch upstream</code>.</p>
<p>What does work is <code>git pull upstream master</code>, but I don... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,561 | git | # git fetch upstream doesn't work
I'm trying to use `git fetch upstream master` to get the latest commit from another user's repository. But unfortunately that doesn't work. I have also tried `git fetch upstream`.
What does work is `git pull upstream master`, but I don't want to use that all the time, because that wi... | The fetch did work, but to see the result, you should do a:
```
git log --oneline --all --graph --decorate --branches
```
You would see the upstream branches (including the upstream/master)
You can also check the latest SHA1 fetched with:
```
git branch -avv
```
The `git pull upstream master` didn't repeat the fet... |
5055791 | How to give a git repo a name? | 16 | 2011-02-20 07:21:33 | <p>I am making a remote repo by using these command</p>
<pre class="lang-sh prettyprint-override"><code>mkdir NewRepo
cd NewRepo
git init
</code></pre>
<p>Then I clone this repo to local</p>
<pre class="lang-sh prettyprint-override"><code>git clone user@server:/path/to/app/.git
</code></pre>
<p>This worked for me, ... | 43,134 | 456,218 | 2020-05-08 22:56:24 | 5,057,603 | 20 | 2011-02-20 14:31:06 | null | 2017-05-22 18:40:31 | https://stackoverflow.com/q/5055791 | https://stackoverflow.com/a/5057603 | <p>It is possible to create a git repository directly in a folder, without the subdirectory <code>.git</code>. To do this, you do this:</p>
<pre><code>mkdir myrepo.git
cd myrepo.git
git init --bare
</code></pre>
<p>This is called a bare repository - it contains the contents of what would normally be in a <code>.git</... | <p>It is possible to create a git repository directly in a folder, without the subdirectory <code>.git</code>. To do this, you do this:</p> <pre><code>mkdir myrepo.git cd myrepo.git git init --bare </code></pre> <p>This is called a bare repository - it contains the contents of what would normally be in a <code>.git</... | 119 | git | <h1>How to give a git repo a name?</h1>
<p>I am making a remote repo by using these command</p>
<pre class="lang-sh prettyprint-override"><code>mkdir NewRepo
cd NewRepo
git init
</code></pre>
<p>Then I clone this repo to local</p>
<pre class="lang-sh prettyprint-override"><code>git clone user@server:/path/to/app/.gi... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,563 | git | # How to give a git repo a name?
I am making a remote repo by using these command
```
mkdir NewRepo
cd NewRepo
git init
```
Then I clone this repo to local
```
git clone user@server:/path/to/app/.git
```
This worked for me, But I want give the repo a name, do something like everybody else does:
```
git clone user... | It is possible to create a git repository directly in a folder, without the subdirectory `.git`. To do this, you do this:
```
mkdir myrepo.git
cd myrepo.git
git init --bare
```
This is called a bare repository - it contains the contents of what would normally be in a `.git` folder. It has no working copy. These sorts... |
4407232 | Git - rollback to a previous commit | 16 | 2010-12-10 09:14:45 | <p>I committed my work (note <em>not</em> pushed) in a known good state. I have since made unwanted local changes (without committing or pushing them). What is the command to undo these changes and revert to my previous commit state?</p>
<p>Please accept my apologies for the beginner question but the suggestions turne... | 12,570 | 38,522 | 2017-06-16 10:29:03 | 4,407,253 | 20 | 2010-12-10 09:16:36 | 280,598 | 2017-06-16 10:29:03 | https://stackoverflow.com/q/4407232 | https://stackoverflow.com/a/4407253 | <p>From <a href="https://book.git-scm.com/docs/user-manual#fixing-mistakes" rel="nofollow noreferrer">Pro Git Commnuity book</a>:</p>
<blockquote>
<p><strong>Fixing mistakes</strong></p>
<p>If you've messed up the working tree,
but haven't yet committed your
mistake, you can return the entire
working tree... | <p>From <a href="https://book.git-scm.com/docs/user-manual#fixing-mistakes" rel="nofollow noreferrer">Pro Git Commnuity book</a>:</p> <blockquote> <p><strong>Fixing mistakes</strong></p> <p>If you've messed up the working tree, but haven't yet committed your mistake, you can return the entire working tree... | 119 | git | <h1>Git - rollback to a previous commit</h1>
<p>I committed my work (note <em>not</em> pushed) in a known good state. I have since made unwanted local changes (without committing or pushing them). What is the command to undo these changes and revert to my previous commit state?</p>
<p>Please accept my apologies for th... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,564 | git | # Git - rollback to a previous commit
I committed my work (note *not* pushed) in a known good state. I have since made unwanted local changes (without committing or pushing them). What is the command to undo these changes and revert to my previous commit state?
Please accept my apologies for the beginner question but... | From [Pro Git Commnuity book](https://book.git-scm.com/docs/user-manual#fixing-mistakes):
> **Fixing mistakes**
>
> If you've messed up the working tree,
> but haven't yet committed your
> mistake, you can return the entire
> working tree to the last committed
> state with
>
> `$ git reset --hard HEAD` |
2695119 | Is git svn rebase required before git svn dcommit? | 16 | 2010-04-22 23:01:37 | <p>I'm reading about using git as an svn client here:</p>
<p><a href="http://web.archive.org/web/20130605141626/http://learn.github.com/p/git-svn.html" rel="nofollow noreferrer">http://learn.github.com/p/git-svn.html</a></p>
<p>That page suggests that you do git svn rebase before git svn dcommit, which makes perfect ... | 3,941 | 62,163 | 2016-12-08 15:29:55 | 2,698,613 | 20 | 2010-04-23 12:53:47 | 149,170 | 2010-04-24 21:20:59 | https://stackoverflow.com/q/2695119 | https://stackoverflow.com/a/2698613 | <p><em>Disclaimer:</em> I generally <em>do</em> tend to run <code>git svn rebase</code> before doing a <code>git svn dcommit</code>. I usually keep my changes in another git branch, so that the rebase doesn't have any chance of failing. I use <code>git rebase master</code> in my topic branch to bring it up to date. The... | <p><em>Disclaimer:</em> I generally <em>do</em> tend to run <code>git svn rebase</code> before doing a <code>git svn dcommit</code>. I usually keep my changes in another git branch, so that the rebase doesn't have any chance of failing. I use <code>git rebase master</code> in my topic branch to bring it up to date. The... | 119, 6452 | git, git-svn | <h1>Is git svn rebase required before git svn dcommit?</h1>
<p>I'm reading about using git as an svn client here:</p>
<p><a href="http://web.archive.org/web/20130605141626/http://learn.github.com/p/git-svn.html" rel="nofollow noreferrer">http://learn.github.com/p/git-svn.html</a></p>
<p>That page suggests that you do... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,565 | git | # Is git svn rebase required before git svn dcommit?
I'm reading about using git as an svn client here:
[http://learn.github.com/p/git-svn.html](http://web.archive.org/web/20130605141626/http://learn.github.com/p/git-svn.html)
That page suggests that you do git svn rebase before git svn dcommit, which makes perfect ... | *Disclaimer:* I generally *do* tend to run `git svn rebase` before doing a `git svn dcommit`. I usually keep my changes in another git branch, so that the rebase doesn't have any chance of failing. I use `git rebase master` in my topic branch to bring it up to date. Then I switch to the `master` branch and use `git mer... |
48200429 | Not able to clone large repo code on git | 15 | 2018-01-11 05:41:04 | <p>I'm getting an error like :-</p>
<pre><code>Cloning into 'large-repository'...
remote: Counting objects: 20248, done.
remote: Compressing objects: 100% (10204/10204), done.
error: RPC failed; curl 18 transfer closed with outstanding read data remaining
fatal: The remote end hung up unexpectedly
fatal: early EOF
fa... | 28,461 | 7,831,494 | 2025-01-05 18:50:15 | 48,201,354 | 20 | 2018-01-11 06:56:17 | 7,831,494 | 2018-01-13 15:19:18 | https://stackoverflow.com/q/48200429 | https://stackoverflow.com/a/48201354 | <pre><code>git config --global http.postBuffer 524288000
git clone repo_url --depth 1
</code></pre>
<p>I have followed above steps and finally I have successfully cloned my code.</p>
| <pre><code>git config --global http.postBuffer 524288000 git clone repo_url --depth 1 </code></pre> <p>I have followed above steps and finally I have successfully cloned my code.</p> | 119 | git | <h1>Not able to clone large repo code on git</h1>
<p>I'm getting an error like :-</p>
<pre><code>Cloning into 'large-repository'...
remote: Counting objects: 20248, done.
remote: Compressing objects: 100% (10204/10204), done.
error: RPC failed; curl 18 transfer closed with outstanding read data remaining
fatal: The r... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,570 | git | # Not able to clone large repo code on git
I'm getting an error like :-
```
Cloning into 'large-repository'...
remote: Counting objects: 20248, done.
remote: Compressing objects: 100% (10204/10204), done.
error: RPC failed; curl 18 transfer closed with outstanding read data remaining
fatal: The remote end hung up un... | ```
git config --global http.postBuffer 524288000
git clone repo_url --depth 1
```
I have followed above steps and finally I have successfully cloned my code. |
17712711 | Push on gerrit with windows | 15 | 2013-07-18 00:48:49 | <p>I am struggling to push some of my data to a gerrit with TortoiseGit. I created a new repo and committed it to the master. I added one remote, with my private key and I also uploaded the public key.</p>
<p>Pulling from the gerrit is no problem, but when I try to push the following error occurs:</p>
<pre><code>remo... | 14,549 | 1,979,703 | 2014-02-04 09:15:15 | 17,714,256 | 20 | 2013-07-18 03:56:53 | 2,259,878 | 2014-02-04 09:15:15 | https://stackoverflow.com/q/17712711 | https://stackoverflow.com/a/17714256 | <p>Just download it from : <code><a href="http://www.example.com/r/tools/hooks/commit-msg">http://www.example.com/r/tools/hooks/commit-msg</a></code> and then copy it to your .git/hooks folder.</p>
<p>Or you can download it from <a href="https://gerrit-review.googlesource.com/tools/hooks/commit-msg">gerrit review</a><... | <p>Just download it from : <code><a href="http://www.example.com/r/tools/hooks/commit-msg">http://www.example.com/r/tools/hooks/commit-msg</a></code> and then copy it to your .git/hooks folder.</p> <p>Or you can download it from <a href="https://gerrit-review.googlesource.com/tools/hooks/commit-msg">gerrit review</a><... | 64, 119, 7330, 52272 | gerrit, git, repository, windows | <h1>Push on gerrit with windows</h1>
<p>I am struggling to push some of my data to a gerrit with TortoiseGit. I created a new repo and committed it to the master. I added one remote, with my private key and I also uploaded the public key.</p>
<p>Pulling from the gerrit is no problem, but when I try to push the followi... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,574 | git | # Push on gerrit with windows
I am struggling to push some of my data to a gerrit with TortoiseGit. I created a new repo and committed it to the master. I added one remote, with my private key and I also uploaded the public key.
Pulling from the gerrit is no problem, but when I try to push the following error occurs:... | Just download it from : `http://www.example.com/r/tools/hooks/commit-msg` and then copy it to your .git/hooks folder.
Or you can download it from [gerrit review](https://gerrit-review.googlesource.com/tools/hooks/commit-msg)
-- Update --
If you add the commit hook after making the commit locally, which is probably t... |
14991916 | Garbage collect commits in git | 15 | 2013-02-20 23:32:22 | <p>I have some commits created by <code>git subtree</code> that I want to have garbage collect (more that any practical purpose just to understand what and why can get collected).</p>
<p>I have already checked that these commits are not referenced the following ways:</p>
<pre><code># In any reflog
> git reflog --a... | 6,406 | 214,373 | 2013-02-21 05:33:01 | 14,995,269 | 20 | 2013-02-21 05:33:01 | 1,965,396 | 2013-02-21 05:33:01 | https://stackoverflow.com/q/14991916 | https://stackoverflow.com/a/14995269 | <p>Every time I want to delete loose objects, I use the following commands:</p>
<pre><code>rm -rf .git/refs/original/*
git reflog expire --all --expire-unreachable=0
git repack -A -d
git prune
</code></pre>
| <p>Every time I want to delete loose objects, I use the following commands:</p> <pre><code>rm -rf .git/refs/original/* git reflog expire --all --expire-unreachable=0 git repack -A -d git prune </code></pre> | 119 | git | <h1>Garbage collect commits in git</h1>
<p>I have some commits created by <code>git subtree</code> that I want to have garbage collect (more that any practical purpose just to understand what and why can get collected).</p>
<p>I have already checked that these commits are not referenced the following ways:</p>
<pre><... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,575 | git | # Garbage collect commits in git
I have some commits created by `git subtree` that I want to have garbage collect (more that any practical purpose just to understand what and why can get collected).
I have already checked that these commits are not referenced the following ways:
```
# In any reflog
> git reflog --al... | Every time I want to delete loose objects, I use the following commands:
```
rm -rf .git/refs/original/*
git reflog expire --all --expire-unreachable=0
git repack -A -d
git prune
``` |
14032695 | Git ignore remaining merge conflicts | 15 | 2012-12-25 17:32:34 | <p>After I solved all merge conflicts I care about, I want to merge regardless of all remaining conflicts. I'd like git to keep the files from the branch I want to merge into (<code>--ours</code> strategy).</p>
<p>How can I do that?</p>
| 47,479 | 1,079,110 | 2017-05-17 13:11:03 | 14,038,734 | 20 | 2012-12-26 09:47:44 | 530,424 | 2017-05-17 13:11:03 | https://stackoverflow.com/q/14032695 | https://stackoverflow.com/a/14038734 | <p>It is a bad idea to commit binaries, but i'll explain to you how to make what you need</p>
<p>you are in branch special and you have done a merge, you have fixed some conflicts and you want to let others like in branch master so you should make this</p>
<pre><code>git reset --mixed (reset the index but not the wor... | <p>It is a bad idea to commit binaries, but i'll explain to you how to make what you need</p> <p>you are in branch special and you have done a merge, you have fixed some conflicts and you want to let others like in branch master so you should make this</p> <pre><code>git reset --mixed (reset the index but not the wor... | 119, 28897 | git, git-merge | <h1>Git ignore remaining merge conflicts</h1>
<p>After I solved all merge conflicts I care about, I want to merge regardless of all remaining conflicts. I'd like git to keep the files from the branch I want to merge into (<code>--ours</code> strategy).</p>
<p>How can I do that?</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,576 | git | # Git ignore remaining merge conflicts
After I solved all merge conflicts I care about, I want to merge regardless of all remaining conflicts. I'd like git to keep the files from the branch I want to merge into (`--ours` strategy).
How can I do that? | It is a bad idea to commit binaries, but i'll explain to you how to make what you need
you are in branch special and you have done a merge, you have fixed some conflicts and you want to let others like in branch master so you should make this
```
git reset --mixed (reset the index but not the working tree; changes re... |
13929526 | Git revert failed | 15 | 2012-12-18 09:06:35 | <p>I made several commits (commit1/2/3), I changed my working directory without stashing. Then I wanted to go back several commits ago. So I git revert commit1 commit2 commit3, but I was told to commit my changes (commit4), so I did it, and then I made again git revert commit1 commit2 commit3 commit4, but I had a messa... | 63,888 | 1,275,959 | 2020-09-15 16:27:14 | 13,947,603 | 20 | 2012-12-19 07:39:18 | 6,309 | 2013-06-27 11:09:32 | https://stackoverflow.com/q/13929526 | https://stackoverflow.com/a/13947603 | <p>It is best to initiate a revert with a clean index and working tree.<br>
Otherwise, doing a second revert (on top of a new commit) while a previous revert was in progress leads to that error message.</p>
<p>Since you are still at <code>commit 3</code>, you could:</p>
<ul>
<li><code>git cherry-pick --quit</code> (w... | <p>It is best to initiate a revert with a clean index and working tree.<br> Otherwise, doing a second revert (on top of a new commit) while a previous revert was in progress leads to that error message.</p> <p>Since you are still at <code>commit 3</code>, you could:</p> <ul> <li><code>git cherry-pick --quit</code> (w... | 119, 34403, 53850 | git, git-commit, git-revert | <h1>Git revert failed</h1>
<p>I made several commits (commit1/2/3), I changed my working directory without stashing. Then I wanted to go back several commits ago. So I git revert commit1 commit2 commit3, but I was told to commit my changes (commit4), so I did it, and then I made again git revert commit1 commit2 commit3... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,577 | git | # Git revert failed
I made several commits (commit1/2/3), I changed my working directory without stashing. Then I wanted to go back several commits ago. So I git revert commit1 commit2 commit3, but I was told to commit my changes (commit4), so I did it, and then I made again git revert commit1 commit2 commit3 commit4,... | It is best to initiate a revert with a clean index and working tree.
Otherwise, doing a second revert (on top of a new commit) while a previous revert was in progress leads to that error message.
Since you are still at `commit 3`, you could:
- `git cherry-pick --quit` (which, from [this thread](http://comments.gman... |
13479294 | Why are my .csproj files getting messed up after a git rebase? | 15 | 2012-11-20 18:01:26 | <p>In a .NET C# project which uses GIT for source control, I keep getting malformed csproj files after rebasing to get the most recently commited code. This is my process:</p>
<ol>
<li>commit my code</li>
<li>build and run tests</li>
<li>rebase to "get latest"</li>
<li>curse the heavens, as the csproj file is screwed ... | 8,122 | 43,392 | 2012-11-20 22:52:35 | 13,483,596 | 20 | 2012-11-20 22:52:35 | 543,743 | 2012-11-20 22:52:35 | https://stackoverflow.com/q/13479294 | https://stackoverflow.com/a/13483596 | <p>You may want to use a .gitattributes file to use a slightly different merge driver. I have found that this has helped with mine:</p>
<pre><code>*.csproj -text merge=union
*.sln -text merge=union
</code></pre>
<p>You can read more about it <a href="http://www.kernel.org/pub/software/scm/git/docs/gitattributes.html... | <p>You may want to use a .gitattributes file to use a slightly different merge driver. I have found that this has helped with mine:</p> <pre><code>*.csproj -text merge=union *.sln -text merge=union </code></pre> <p>You can read more about it <a href="http://www.kernel.org/pub/software/scm/git/docs/gitattributes.html... | 1, 119, 10101, 29934 | .net, csproj, git, git-rebase | <h1>Why are my .csproj files getting messed up after a git rebase?</h1>
<p>In a .NET C# project which uses GIT for source control, I keep getting malformed csproj files after rebasing to get the most recently commited code. This is my process:</p>
<ol>
<li>commit my code</li>
<li>build and run tests</li>
<li>rebase to... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,578 | git | # Why are my .csproj files getting messed up after a git rebase?
In a .NET C# project which uses GIT for source control, I keep getting malformed csproj files after rebasing to get the most recently commited code. This is my process:
1. commit my code
2. build and run tests
3. rebase to "get latest"
4. curse the heav... | You may want to use a .gitattributes file to use a slightly different merge driver. I have found that this has helped with mine:
```
*.csproj -text merge=union
*.sln -text merge=union
```
You can read more about it [here](http://www.kernel.org/pub/software/scm/git/docs/gitattributes.html) to see if there are options ... |
11483288 | How to disable compression in git server side? | 15 | 2012-07-14 11:12:49 | <p>I have a repo from which pull takes forever because the server has little free RAM and it is swapping a lot while </p>
<pre><code>remote: Compressing objects: 24%
</code></pre>
<p>is happening (even if I clone locally on the server). The network is not that constrained, so it would be fine to send all data uncompr... | 15,103 | 140,367 | 2014-07-15 08:16:37 | 11,484,285 | 20 | 2012-07-14 13:46:30 | 337,297 | 2014-07-15 08:16:37 | https://stackoverflow.com/q/11483288 | https://stackoverflow.com/a/11484285 | <p>From the git documentation:</p>
<blockquote>
<pre><code> core.bigFileThreshold
Files larger than this size are stored deflated, without
attempting delta compression. Storing large files without
delta compression avoids excessive memory usage, at the
slight expense of increased disk usage.
Defau... | <p>From the git documentation:</p> <blockquote> <pre><code> core.bigFileThreshold Files larger than this size are stored deflated, without attempting delta compression. Storing large files without delta compression avoids excessive memory usage, at the slight expense of increased disk usage. Defau... | 119 | git | <h1>How to disable compression in git server side?</h1>
<p>I have a repo from which pull takes forever because the server has little free RAM and it is swapping a lot while </p>
<pre><code>remote: Compressing objects: 24%
</code></pre>
<p>is happening (even if I clone locally on the server). The network is not that c... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,579 | git | # How to disable compression in git server side?
I have a repo from which pull takes forever because the server has little free RAM and it is swapping a lot while
```
remote: Compressing objects: 24%
```
is happening (even if I clone locally on the server). The network is not that constrained, so it would be fine to... | From the git documentation:
> ```
> core.bigFileThreshold
>
> Files larger than this size are stored deflated, without
> attempting delta compression. Storing large files without
> delta compression avoids excessive memory usage, at the
> slight expense of increased disk usage.
>
> Default is 512 M... |
5956300 | Merging two very divergent branches using git? | 15 | 2011-05-10 20:49:36 | <p>I have my <code>master</code> branch and my <code>verydifferentbranch</code> these had the same ancestor ... about 300 commits ago. Now that <code>verydifferentbranch</code> is feature complete I'd like to put it under the master <code>branch</code>. Doing a rebase results in every single patch having a lot of merge... | 25,197 | 500,038 | 2019-09-05 16:25:50 | 5,959,510 | 20 | 2011-05-11 05:05:38 | 193,688 | 2011-05-11 05:10:40 | https://stackoverflow.com/q/5956300 | https://stackoverflow.com/a/5959510 | <p>It sounds like your history looks like this:</p>
<pre><code>...---o---A---o---...---o---o---B master
\
o---o---...---o---C verydifferentbranch
</code></pre>
<p>You say that you are worried about losing history if you force push <code>verydifferentbranch</code> to <code>master</code>. S... | <p>It sounds like your history looks like this:</p> <pre><code>...---o---A---o---...---o---o---B master \ o---o---...---o---C verydifferentbranch </code></pre> <p>You say that you are worried about losing history if you force push <code>verydifferentbranch</code> to <code>master</code>. S... | 119 | git | <h1>Merging two very divergent branches using git?</h1>
<p>I have my <code>master</code> branch and my <code>verydifferentbranch</code> these had the same ancestor ... about 300 commits ago. Now that <code>verydifferentbranch</code> is feature complete I'd like to put it under the master <code>branch</code>. Doing a re... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,580 | git | # Merging two very divergent branches using git?
I have my `master` branch and my `verydifferentbranch` these had the same ancestor ... about 300 commits ago. Now that `verydifferentbranch` is feature complete I'd like to put it under the master `branch`. Doing a rebase results in every single patch having a lot of me... | It sounds like your history looks like this:
```
...---o---A---o---...---o---o---B master
\
o---o---...---o---C verydifferentbranch
```
You say that you are worried about losing history if you force push `verydifferentbranch` to `master`. Such an operation would effectively be throwing aw... |
4190584 | Remove all files for git commit? | 15 | 2010-11-16 02:05:20 | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="https://stackoverflow.com/questions/348170/undo-git-add">Undo “git add”?</a> </p>
</blockquote>
<p>I made the mistake of running:</p>
<pre><code>git add .
</code></pre>
<p>Which added important things such as .bashrc. Even though I ... | 32,289 | 200,477 | 2010-11-16 02:42:43 | 4,190,626 | 20 | 2010-11-16 02:15:30 | 108,590 | 2010-11-16 02:15:30 | https://stackoverflow.com/q/4190584 | https://stackoverflow.com/a/4190626 | <p>You can use <code>git reset</code> to unstage changes, or even <code>git reset --hard HEAD~</code> to blow away the most recent commit (careful with that one, it will not even keep your changes around.)</p>
<p>See <a href="http://git-scm.com/docs/git-reset">http://git-scm.com/docs/git-reset</a></p>
| <p>You can use <code>git reset</code> to unstage changes, or even <code>git reset --hard HEAD~</code> to blow away the most recent commit (careful with that one, it will not even keep your changes around.)</p> <p>See <a href="http://git-scm.com/docs/git-reset">http://git-scm.com/docs/git-reset</a></p> | 119 | git | <h1>Remove all files for git commit?</h1>
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="https://stackoverflow.com/questions/348170/undo-git-add">Undo “git add”?</a> </p>
</blockquote>
<p>I made the mistake of running:</p>
<pre><code>git add .
</code></pre>
<p>Which added import... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,581 | git | # Remove all files for git commit?
> **Possible Duplicate:**
> [Undo “git add”?](https://stackoverflow.com/questions/348170/undo-git-add)
I made the mistake of running:
```
git add .
```
Which added important things such as .bashrc. Even though I run:
```
git rm .
```
When I run:
```
git push project master
``... | You can use `git reset` to unstage changes, or even `git reset --hard HEAD~` to blow away the most recent commit (careful with that one, it will not even keep your changes around.)
See <http://git-scm.com/docs/git-reset> |
24469527 | How to pull specific commit code from bitbucket-git | 14 | 2014-06-28 17:56:58 | <p>I am using BitBucket-Git for my android application for version control. I have commited code five times.</p>
<p>Suppose I have done five commits v1, v2, v3, v4, v5. Now I want to get the complete source code till I have v3 commit only. Is there any way to get that?</p>
<p>I just simply want to pull complete code ... | 31,370 | 2,455,259 | 2019-02-04 06:20:44 | 24,469,865 | 20 | 2014-06-28 18:44:09 | 24,545 | 2014-06-28 18:44:09 | https://stackoverflow.com/q/24469527 | https://stackoverflow.com/a/24469865 | <p>You can't pull a single commit. Rather, clone the repository and checkout the commit you are interested in:</p>
<pre><code>$ git clone <repo>
$ git checkout v1
</code></pre>
<p>This will create a detached <code>HEAD</code> state in your working copy, mirroring the state in commit <code>v1</code>.</p>
<p>If ... | <p>You can't pull a single commit. Rather, clone the repository and checkout the commit you are interested in:</p> <pre><code>$ git clone <repo> $ git checkout v1 </code></pre> <p>This will create a detached <code>HEAD</code> state in your working copy, mirroring the state in commit <code>v1</code>.</p> <p>If ... | 119, 8337, 90056 | atlassian-sourcetree, bitbucket, git | <h1>How to pull specific commit code from bitbucket-git</h1>
<p>I am using BitBucket-Git for my android application for version control. I have commited code five times.</p>
<p>Suppose I have done five commits v1, v2, v3, v4, v5. Now I want to get the complete source code till I have v3 commit only. Is there any way t... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,586 | git | # How to pull specific commit code from bitbucket-git
I am using BitBucket-Git for my android application for version control. I have commited code five times.
Suppose I have done five commits v1, v2, v3, v4, v5. Now I want to get the complete source code till I have v3 commit only. Is there any way to get that?
I j... | You can't pull a single commit. Rather, clone the repository and checkout the commit you are interested in:
```
$ git clone <repo>
$ git checkout v1
```
This will create a detached `HEAD` state in your working copy, mirroring the state in commit `v1`.
If you want to continue committing from where `v1` ended, use a h... |
14782906 | How do I get a list of old->new rewritten commit SHAs from 'git filter-branch'? | 14 | 2013-02-08 23:15:50 | <p>After running <code>git filter-branch</code>, how do I get a list of old commit SHAs as rewritten by filter-branch to their new corresponding commit SHAs?</p>
<p>For example, something similar to:</p>
<pre><code>b19fd985746c1f060f761d42d353e387bec243fb -> c8ab40ef9bae3b58642a8d1e5b90720d093a60b5
c5ebba1eeb92ca7... | 1,807 | 44,003 | 2013-02-09 00:09:26 | 14,783,391 | 20 | 2013-02-09 00:09:26 | 2,012,737 | 2013-02-09 00:09:26 | https://stackoverflow.com/q/14782906 | https://stackoverflow.com/a/14783391 | <p>I had to go poking around the source for <code>git-filter-branch</code> to work this one out. It's not documented (as far as I can tell), but the old commit ID is explicitly exported as <code>$GIT_COMMIT</code>. This worked for me:</p>
<pre><code>$ git filter-branch --your-filters-here --commit-filter 'echo -n "${G... | <p>I had to go poking around the source for <code>git-filter-branch</code> to work this one out. It's not documented (as far as I can tell), but the old commit ID is explicitly exported as <code>$GIT_COMMIT</code>. This worked for me:</p> <pre><code>$ git filter-branch --your-filters-here --commit-filter 'echo -n "${G... | 119, 46509 | git, git-filter-branch | <h1>How do I get a list of old->new rewritten commit SHAs from 'git filter-branch'?</h1>
<p>After running <code>git filter-branch</code>, how do I get a list of old commit SHAs as rewritten by filter-branch to their new corresponding commit SHAs?</p>
<p>For example, something similar to:</p>
<pre><code>b19fd985746c1f... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,588 | git | # How do I get a list of old->new rewritten commit SHAs from 'git filter-branch'?
After running `git filter-branch`, how do I get a list of old commit SHAs as rewritten by filter-branch to their new corresponding commit SHAs?
For example, something similar to:
```
b19fd985746c1f060f761d42d353e387bec243fb -> c8ab40ef... | I had to go poking around the source for `git-filter-branch` to work this one out. It's not documented (as far as I can tell), but the old commit ID is explicitly exported as `$GIT_COMMIT`. This worked for me:
```
$ git filter-branch --your-filters-here --commit-filter 'echo -n "${GIT_COMMIT}," >>/tmp/log; git commit-... |
3111515 | How do I setup a git driver to ignore a folder on merge? | 14 | 2010-06-24 15:39:45 | <p>I have the master branch, where all the main code resides, and the design branch, where the layout of the rails application is built by the design team. They have added a folder called "photoshop" to the public folder to keep their sources for the images also under version control. But I don't want this fo... | 7,424 | 375,428 | 2023-11-18 03:32:39 | 10,220,276 | 20 | 2012-04-19 01:04:47 | 624,066 | 2023-11-18 03:31:20 | https://stackoverflow.com/q/3111515 | https://stackoverflow.com/a/10220276 | <p>As suggested by my other answer, here goes the extended, generalized, industrial-strength version of the solution.</p>
<p><em>(yes, I was bored at home and had nothing else better to do :P)</em></p>
<p>This script will add a new, <em>detached</em> commit based on your <em>local</em> design branch, so it won't affect... | <p>As suggested by my other answer, here goes the extended, generalized, industrial-strength version of the solution.</p> <p><em>(yes, I was bored at home and had nothing else better to do :P)</em></p> <p>This script will add a new, <em>detached</em> commit based on your <em>local</em> design branch, so it won't affect... | 119, 28897 | git, git-merge | <h1>How do I setup a git driver to ignore a folder on merge?</h1>
<p>I have the master branch, where all the main code resides, and the design branch, where the layout of the rails application is built by the design team. They have added a folder called "photoshop" to the public folder to keep their sources f... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,589 | git | # How do I setup a git driver to ignore a folder on merge?
I have the master branch, where all the main code resides, and the design branch, where the layout of the rails application is built by the design team. They have added a folder called "photoshop" to the public folder to keep their sources for the images also ... | As suggested by my other answer, here goes the extended, generalized, industrial-strength version of the solution.
*(yes, I was bored at home and had nothing else better to do :P)*
This script will add a new, *detached* commit based on your *local* design branch, so it won't affect neither the design repository or yo... |
5242846 | What is the difference between a tree and commit type in Git? | 14 | 2011-03-09 07:54:50 | <p>I checked in one file into a simple git repo.
From my investigations; there are three types of objects placed in <code>.git/objects</code></p>
<ol>
<li>commit</li>
<li>tree</li>
<li>blob</li>
</ol>
<p>As an example:</p>
<pre><code>$ git cat-file -t 8b4e834eba22e60c284c7b77e43d3c29e619f92f
commit
$ git cat-file -... | 2,634 | 450,278 | 2011-03-09 08:02:58 | 5,242,859 | 20 | 2011-03-09 07:56:19 | 148,870 | 2011-03-09 08:02:58 | https://stackoverflow.com/q/5242846 | https://stackoverflow.com/a/5242859 | <p>A commit object is an object that references a tree and associates other metadata (author, committer, timestamps, etc) with it.</p>
<pre><code> Commit
/ \
/ \
(parent SHA) Tree
(author) / \
(committer) Blob Blob
(timestamps)
(etc)
</code></pre>
<p>Multiple com... | <p>A commit object is an object that references a tree and associates other metadata (author, committer, timestamps, etc) with it.</p> <pre><code> Commit / \ / \ (parent SHA) Tree (author) / \ (committer) Blob Blob (timestamps) (etc) </code></pre> <p>Multiple com... | 119 | git | <h1>What is the difference between a tree and commit type in Git?</h1>
<p>I checked in one file into a simple git repo.
From my investigations; there are three types of objects placed in <code>.git/objects</code></p>
<ol>
<li>commit</li>
<li>tree</li>
<li>blob</li>
</ol>
<p>As an example:</p>
<pre><code>$ git cat-fi... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,590 | git | # What is the difference between a tree and commit type in Git?
I checked in one file into a simple git repo.
From my investigations; there are three types of objects placed in `.git/objects`
1. commit
2. tree
3. blob
As an example:
```
$ git cat-file -t 8b4e834eba22e60c284c7b77e43d3c29e619f92f
commit
$ git cat-fi... | A commit object is an object that references a tree and associates other metadata (author, committer, timestamps, etc) with it.
```
Commit
/ \
/ \
(parent SHA) Tree
(author) / \
(committer) Blob Blob
(timestamps)
(etc)
```
Multiple commit objects can reference t... |
48745559 | git push is stuck when pushing to remote | 13 | 2018-02-12 11:35:42 | <p>When I try to push to a remote repository,</p>
<p><code>git push origin xyz</code></p>
<p>it gets stuck. I try <code>ssh -T git@github.com</code> and I get a success:</p>
<blockquote>
<p>You've successfully authenticated, but GitHub does not
provide shell access.</p>
</blockquote>
<p>When I use the verbose o... | 15,441 | 3,104,465 | 2018-02-12 14:16:16 | 48,748,525 | 20 | 2018-02-12 14:16:16 | 3,104,465 | 2018-02-12 14:16:16 | https://stackoverflow.com/q/48745559 | https://stackoverflow.com/a/48748525 | <p>It turned out it was stuck due to a pre-push commit hook which was placed there (at <code><repository-root>/.git/hooks/pre-push</code>) by a third-party tool.</p>
<p>To debug, I ran the command with <code>GIT_TRACE</code> on:</p>
<pre><code>$ GIT_TRACE=1 git push -v origin xyz
11:47:11.950226 git.c:340 ... | <p>It turned out it was stuck due to a pre-push commit hook which was placed there (at <code><repository-root>/.git/hooks/pre-push</code>) by a third-party tool.</p> <p>To debug, I ran the command with <code>GIT_TRACE</code> on:</p> <pre><code>$ GIT_TRACE=1 git push -v origin xyz 11:47:11.950226 git.c:340 ... | 119 | git | <h1>git push is stuck when pushing to remote</h1>
<p>When I try to push to a remote repository,</p>
<p><code>git push origin xyz</code></p>
<p>it gets stuck. I try <code>ssh -T git@github.com</code> and I get a success:</p>
<blockquote>
<p>You've successfully authenticated, but GitHub does not
provide shell acce... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,593 | git | # git push is stuck when pushing to remote
When I try to push to a remote repository,
`git push origin xyz`
it gets stuck. I try `ssh -T git@github.com` and I get a success:
> You've successfully authenticated, but GitHub does not
> provide shell access.
When I use the verbose option, I get a message that it is pu... | It turned out it was stuck due to a pre-push commit hook which was placed there (at `<repository-root>/.git/hooks/pre-push`) by a third-party tool.
To debug, I ran the command with `GIT_TRACE` on:
```
$ GIT_TRACE=1 git push -v origin xyz
11:47:11.950226 git.c:340 trace: built-in: git 'push' '-v' 'origin... |
43974371 | Run git-clang-format on series of git commits | 13 | 2017-05-15 08:11:02 | <p>I have written a series of git commits, with awful code formatting.<br>
Before I push them to github, I want to run <code>git-clang-format</code> on each commit, to get a nicely formatted code in my history. </p>
<p>Is there some combination of <code>rebase</code> and <code>git-clang-format</code> which will accomp... | 24,845 | 27,074 | 2023-09-30 21:54:59 | 45,115,656 | 20 | 2017-07-15 07:25:58 | 6,309 | 2023-09-30 21:54:59 | https://stackoverflow.com/q/43974371 | https://stackoverflow.com/a/45115656 | <p>That looks like a job for <a href="https://git-scm.com/docs/git-filter-branch" rel="nofollow noreferrer"><code>git filter-branch</code></a>, which can rewrite the commits you want. Since those commits are not yet pushed, changing their content (and, consequently their SHA1) is not a big deal.<br />
And the effect is... | <p>That looks like a job for <a href="https://git-scm.com/docs/git-filter-branch" rel="nofollow noreferrer"><code>git filter-branch</code></a>, which can rewrite the commits you want. Since those commits are not yet pushed, changing their content (and, consequently their SHA1) is not a big deal.<br /> And the effect is... | 119, 555, 10851, 102210 | clang, clang-format, formatting, git | <h1>Run git-clang-format on series of git commits</h1>
<p>I have written a series of git commits, with awful code formatting.<br>
Before I push them to github, I want to run <code>git-clang-format</code> on each commit, to get a nicely formatted code in my history. </p>
<p>Is there some combination of <code>rebase</co... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,594 | git | # Run git-clang-format on series of git commits
I have written a series of git commits, with awful code formatting.
Before I push them to github, I want to run `git-clang-format` on each commit, to get a nicely formatted code in my history.
Is there some combination of `rebase` and `git-clang-format` which will acc... | That looks like a job for [`git filter-branch`](https://git-scm.com/docs/git-filter-branch), which can rewrite the commits you want. Since those commits are not yet pushed, changing their content (and, consequently their SHA1) is not a big deal.
And the effect is similar to what a rebase or cherry-picking would do, e... |
42201438 | How to set nano up for git commit messages with line length limits | 13 | 2017-02-13 10:08:34 | <p>I use nano for git commit messages. Short summary (<=50 chars) plus a new line before the description is relatively straightforward to stick to. However, when it comes to wrapping at 72 chars in the description body I just go off what seems to look right, making for inconsistent logs.</p>
<p>In Vagrantfiles I've... | 7,364 | 149,998 | 2025-12-02 09:32:16 | 42,202,178 | 20 | 2017-02-13 10:46:29 | 149,998 | 2025-12-02 09:32:16 | https://stackoverflow.com/q/42201438 | https://stackoverflow.com/a/42202178 | <p>Nano supports the passing of command line arguments when starting it.</p>
<p>This can be leveraged as part of the git editor config setting.</p>
<p><code>git config --global core.editor "nano -tr 72"</code></p>
<p>Or:</p>
<p><code>export GIT_EDITOR='nano -tr 72'</code></p>
| <p>Nano supports the passing of command line arguments when starting it.</p> <p>This can be leveraged as part of the git editor config setting.</p> <p><code>git config --global core.editor "nano -tr 72"</code></p> <p>Or:</p> <p><code>export GIT_EDITOR='nano -tr 72'</code></p> | 119, 18209 | git, nano | <h1>How to set nano up for git commit messages with line length limits</h1>
<p>I use nano for git commit messages. Short summary (<=50 chars) plus a new line before the description is relatively straightforward to stick to. However, when it comes to wrapping at 72 chars in the description body I just go off what see... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,595 | git | # How to set nano up for git commit messages with line length limits
I use nano for git commit messages. Short summary (<=50 chars) plus a new line before the description is relatively straightforward to stick to. However, when it comes to wrapping at 72 chars in the description body I just go off what seems to look r... | Nano supports the passing of command line arguments when starting it.
This can be leveraged as part of the git editor config setting.
`git config --global core.editor "nano -tr 72"`
Or:
`export GIT_EDITOR='nano -tr 72'` |
36171413 | setting git insteadof in command line | 13 | 2016-03-23 06:43:33 | <p>Because of the poor network connection. I built some git repository mirrors to open source software.</p>
<pre><code>$ cat ~/.gitconfig
[url "git://127.0.0.1/chromiumos"]
insteadOf = "https://chromium.googlesource.com"
[url "git://127.0.0.1/chromiumos"]
insteadOf = "https://boringssl.googlesource.com"
[url ... | 8,718 | 1,520,246 | 2023-08-09 00:52:42 | 36,171,611 | 20 | 2016-03-23 06:56:43 | 1,256,452 | 2016-03-23 06:56:43 | https://stackoverflow.com/q/36171413 | https://stackoverflow.com/a/36171611 | <p>As noted in <a href="https://www.kernel.org/pub/software/scm/git/docs/git-config.html" rel="noreferrer">the <code>git config</code> documentation</a>:</p>
<blockquote>
<p>Multiple lines can be added to an option by using the --add option.</p>
</blockquote>
<p>That is, after setting the first one, you need <code>... | <p>As noted in <a href="https://www.kernel.org/pub/software/scm/git/docs/git-config.html" rel="noreferrer">the <code>git config</code> documentation</a>:</p> <blockquote> <p>Multiple lines can be added to an option by using the --add option.</p> </blockquote> <p>That is, after setting the first one, you need <code>... | 119 | git | <h1>setting git insteadof in command line</h1>
<p>Because of the poor network connection. I built some git repository mirrors to open source software.</p>
<pre><code>$ cat ~/.gitconfig
[url "git://127.0.0.1/chromiumos"]
insteadOf = "https://chromium.googlesource.com"
[url "git://127.0.0.1/chromiumos"]
instead... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,597 | git | # setting git insteadof in command line
Because of the poor network connection. I built some git repository mirrors to open source software.
```
$ cat ~/.gitconfig
[url "git://127.0.0.1/chromiumos"]
insteadOf = "https://chromium.googlesource.com"
[url "git://127.0.0.1/chromiumos"]
insteadOf = "https://boring... | As noted in [the `git config` documentation](https://www.kernel.org/pub/software/scm/git/docs/git-config.html):
> Multiple lines can be added to an option by using the --add option.
That is, after setting the first one, you need `--add` for the remainder so that they do not simply replace the first. (You can use `--a... |
30411901 | How to add specific files in git by their number in git status? | 13 | 2015-05-23 11:00:58 | <p>I often encounter the following scenario:</p>
<pre><code>modified: assembly/main.debug.s
modified: ../src/cd/Config.java
modified: ../src/cd/memoization/cfg/SubgraphFinder.java
modified: ../src/cd/memoization/cfg/SubgraphMap.java
modified: ../src/cd/profiler/Profile.java
modified: ../test/cd/test/TestSa... | 3,589 | 2,820,379 | 2021-12-15 17:29:10 | 30,412,128 | 20 | 2015-05-23 11:30:34 | 2,790,048 | 2015-06-17 08:54:12 | https://stackoverflow.com/q/30411901 | https://stackoverflow.com/a/30412128 | <h1>Example repo:</h1>
<p>I'm using an example repo with four files: a, b, c, d.<br>
Here <code>a</code> is tracked, changed and staged; <code>b</code> is tracked, changed and not staged; <code>c</code> in untracked and staged; <code>d</code> is just untracked.</p>
<p><img src="https://i.sstatic.net/XmH5P.png" alt="e... | <h1>Example repo:</h1> <p>I'm using an example repo with four files: a, b, c, d.<br> Here <code>a</code> is tracked, changed and staged; <code>b</code> is tracked, changed and not staged; <code>c</code> in untracked and staged; <code>d</code> is just untracked.</p> <p><img src="https://i.sstatic.net/XmH5P.png" alt="e... | 119, 34792 | git, git-add | <h1>How to add specific files in git by their number in git status?</h1>
<p>I often encounter the following scenario:</p>
<pre><code>modified: assembly/main.debug.s
modified: ../src/cd/Config.java
modified: ../src/cd/memoization/cfg/SubgraphFinder.java
modified: ../src/cd/memoization/cfg/SubgraphMap.java
modif... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,598 | git | # How to add specific files in git by their number in git status?
I often encounter the following scenario:
```
modified: assembly/main.debug.s
modified: ../src/cd/Config.java
modified: ../src/cd/memoization/cfg/SubgraphFinder.java
modified: ../src/cd/memoization/cfg/SubgraphMap.java
modified: ../src/cd/pro... | # Example repo:
I'm using an example repo with four files: a, b, c, d.
Here `a` is tracked, changed and staged; `b` is tracked, changed and not staged; `c` in untracked and staged; `d` is just untracked.

# External tool: [git-number](https://github.c... |
28311341 | Jenkins and Git - how to grab a committer's name? | 13 | 2015-02-04 00:22:10 | <p>I am trying to get more GIT commit information into a HipChat room. </p>
<p>I see there are a number of GIT variables that can be used in jenkins. I am working in the Execute Shell step of a job.</p>
<p>These work:</p>
<pre><code>echo "${GIT_BRANCH}"
echo "${GIT_URL}"
echo "${GIT_COMMIT}"
</code></pre>
<p>The... | 30,115 | 2,195,411 | 2019-11-18 10:18:48 | 28,352,950 | 20 | 2015-02-05 20:00:08 | 414,355 | 2015-02-05 20:00:08 | https://stackoverflow.com/q/28311341 | https://stackoverflow.com/a/28352950 | <p>I don't know why some of the variables are available and some aren't but it seems you're not the only one with that problem (see e.g. <a href="https://stackoverflow.com/questions/25066567/git-plugin-for-jenkins-how-do-i-set-env-variables-git-author-email-and-git-comm">Git plugin for Jenkins: How do I set env variabl... | <p>I don't know why some of the variables are available and some aren't but it seems you're not the only one with that problem (see e.g. <a href="https://stackoverflow.com/questions/25066567/git-plugin-for-jenkins-how-do-i-set-env-variables-git-author-email-and-git-comm">Git plugin for Jenkins: How do I set env variabl... | 119, 64999 | git, jenkins | <h1>Jenkins and Git - how to grab a committer's name?</h1>
<p>I am trying to get more GIT commit information into a HipChat room. </p>
<p>I see there are a number of GIT variables that can be used in jenkins. I am working in the Execute Shell step of a job.</p>
<p>These work:</p>
<pre><code>echo "${GIT_BRANCH}"
ec... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,599 | git | # Jenkins and Git - how to grab a committer's name?
I am trying to get more GIT commit information into a HipChat room.
I see there are a number of GIT variables that can be used in jenkins. I am working in the Execute Shell step of a job.
These work:
```
echo "${GIT_BRANCH}"
echo "${GIT_URL}"
echo "${GIT_COMMIT}... | I don't know why some of the variables are available and some aren't but it seems you're not the only one with that problem (see e.g. [Git plugin for Jenkins: How do I set env variables GIT_AUTHOR_EMAIL and GIT_COMMITTER_EMAIL?](https://stackoverflow.com/questions/25066567/git-plugin-for-jenkins-how-do-i-set-env-variab... |
28152210 | your branch is behind by 2 commits | 13 | 2015-01-26 14:37:13 | <p>I have a branch of my master branch called 218. </p>
<p>I am the only one using this branch. </p>
<p>I commit my changes 3 weeks ago looking to do a pull request, but it was rejected as I needed to make changes. </p>
<p>Now I have made those changes and I wanted to commit the latest changes to my branch. </p>
<p... | 66,138 | 383,691 | 2019-07-25 21:55:32 | 28,152,827 | 20 | 2015-01-26 15:08:23 | 498,699 | 2015-01-26 15:08:23 | https://stackoverflow.com/q/28152210 | https://stackoverflow.com/a/28152827 | <p>Since you are the only one working on the branch, you can overwrite the state of the remote branch by doing <code>git push --force</code>.</p>
<p>Though are you sure that you are the only one that is on the branch? If you were the only one working on the branch, only your commits would have been on the remote and ... | <p>Since you are the only one working on the branch, you can overwrite the state of the remote branch by doing <code>git push --force</code>.</p> <p>Though are you sure that you are the only one that is on the branch? If you were the only one working on the branch, only your commits would have been on the remote and ... | 119, 456, 28897, 53850 | git, git-commit, git-merge, version-control | <h1>your branch is behind by 2 commits</h1>
<p>I have a branch of my master branch called 218. </p>
<p>I am the only one using this branch. </p>
<p>I commit my changes 3 weeks ago looking to do a pull request, but it was rejected as I needed to make changes. </p>
<p>Now I have made those changes and I wanted to comm... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,600 | git | # your branch is behind by 2 commits
I have a branch of my master branch called 218.
I am the only one using this branch.
I commit my changes 3 weeks ago looking to do a pull request, but it was rejected as I needed to make changes.
Now I have made those changes and I wanted to commit the latest changes to my branc... | Since you are the only one working on the branch, you can overwrite the state of the remote branch by doing `git push --force`.
Though are you sure that you are the only one that is on the branch? If you were the only one working on the branch, only your commits would have been on the remote and you would have had no ... |
18784159 | Finding all files touched by a particular author in git history? | 13 | 2013-09-13 10:32:19 | <p>Is there a way I can use standard git commands to find all the files that were touched by a particular author in a git repository, ideally between two specified dates? I know I can use <code>git log --author="Name"</code>, but ideally I'd just like a list of filenames, and nothing else.</p>
| 4,136 | 27,641 | 2013-09-13 10:44:13 | 18,784,316 | 20 | 2013-09-13 10:40:34 | 959,041 | 2013-09-13 10:40:34 | https://stackoverflow.com/q/18784159 | https://stackoverflow.com/a/18784316 | <p>See this answer <a href="https://stackoverflow.com/questions/6349139/can-i-get-git-to-tell-me-all-the-files-one-user-has-modified">Can I get git to tell me all the files one user has modified?</a></p>
<pre><code>git log --pretty="%H" --author="authorname" | while read commit_hash; do git show --oneline --name-only ... | <p>See this answer <a href="https://stackoverflow.com/questions/6349139/can-i-get-git-to-tell-me-all-the-files-one-user-has-modified">Can I get git to tell me all the files one user has modified?</a></p> <pre><code>git log --pretty="%H" --author="authorname" | while read commit_hash; do git show --oneline --name-only ... | 119 | git | <h1>Finding all files touched by a particular author in git history?</h1>
<p>Is there a way I can use standard git commands to find all the files that were touched by a particular author in a git repository, ideally between two specified dates? I know I can use <code>git log --author="Name"</code>, but ideally I'd just... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,602 | git | # Finding all files touched by a particular author in git history?
Is there a way I can use standard git commands to find all the files that were touched by a particular author in a git repository, ideally between two specified dates? I know I can use `git log --author="Name"`, but ideally I'd just like a list of file... | See this answer [Can I get git to tell me all the files one user has modified?](https://stackoverflow.com/questions/6349139/can-i-get-git-to-tell-me-all-the-files-one-user-has-modified)
```
git log --pretty="%H" --author="authorname" | while read commit_hash; do git show --oneline --name-only $commit_hash | tail -n+2;... |
15650184 | How to remove all remote tracking branches that still exist on remote but no longer in my fetch refspec | 13 | 2013-03-27 00:55:56 | <p>I recently reorganized my refspec of <code>remote.origin.fetch</code> and now only fetch a small subset of branches from remote. However, <code>git branch -a</code> shows me a lot of remote branches that I fetched previously, although they are no longer fetched now. Using <code>git prune</code> does NOT help because... | 5,114 | 716,468 | 2013-03-28 01:08:30 | 15,672,505 | 20 | 2013-03-28 01:08:30 | 716,468 | 2013-03-28 01:08:30 | https://stackoverflow.com/q/15650184 | https://stackoverflow.com/a/15672505 | <p>The answer from <strong>robrich</strong> has a good hint: You can just remove every remote-tracking branch (or even the remote), and then use <code>git fetch</code> to grab only those you want now from scratch.</p>
<p>If you do try to remove the remote all together, you may want to backup your .git/config file, so ... | <p>The answer from <strong>robrich</strong> has a good hint: You can just remove every remote-tracking branch (or even the remote), and then use <code>git fetch</code> to grab only those you want now from scratch.</p> <p>If you do try to remove the remote all together, you may want to backup your .git/config file, so ... | 119 | git | <h1>How to remove all remote tracking branches that still exist on remote but no longer in my fetch refspec</h1>
<p>I recently reorganized my refspec of <code>remote.origin.fetch</code> and now only fetch a small subset of branches from remote. However, <code>git branch -a</code> shows me a lot of remote branches that ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,603 | git | # How to remove all remote tracking branches that still exist on remote but no longer in my fetch refspec
I recently reorganized my refspec of `remote.origin.fetch` and now only fetch a small subset of branches from remote. However, `git branch -a` shows me a lot of remote branches that I fetched previously, although ... | The answer from **robrich** has a good hint: You can just remove every remote-tracking branch (or even the remote), and then use `git fetch` to grab only those you want now from scratch.
If you do try to remove the remote all together, you may want to backup your .git/config file, so that when you add the remote back ... |
11902446 | How can I add pattern that start with hash to gitignore | 13 | 2012-08-10 13:14:52 | <p>When I work with Emacs it create temporary files like <code>#foo.txt#</code> how can I add pattern to <code>.gitignore</code> that will ignore those files (# is interpreted by git as comment in .gitignore)</p>
| 3,136 | 387,194 | 2015-06-27 05:24:09 | 11,902,490 | 20 | 2012-08-10 13:17:40 | 421,089 | 2015-06-27 05:24:09 | https://stackoverflow.com/q/11902446 | https://stackoverflow.com/a/11902490 | <p>Try escaping the <code>#</code> character:</p>
<pre><code>$ cat .gitignore
\#*.txt\#
</code></pre>
<p>I hope this helps.</p>
| <p>Try escaping the <code>#</code> character:</p> <pre><code>$ cat .gitignore \#*.txt\# </code></pre> <p>I hope this helps.</p> | 119, 371, 17512, 25056 | emacs, git, gitignore, temporary-files | <h1>How can I add pattern that start with hash to gitignore</h1>
<p>When I work with Emacs it create temporary files like <code>#foo.txt#</code> how can I add pattern to <code>.gitignore</code> that will ignore those files (# is interpreted by git as comment in .gitignore)</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,604 | git | # How can I add pattern that start with hash to gitignore
When I work with Emacs it create temporary files like `#foo.txt#` how can I add pattern to `.gitignore` that will ignore those files (# is interpreted by git as comment in .gitignore) | Try escaping the `#` character:
```
$ cat .gitignore
\#*.txt\#
```
I hope this helps. |
8505289 | How to do git merge/pull correctly: You have not concluded your merge (MERGE_HEAD exists) | 13 | 2011-12-14 13:28:34 | <p>I am a newbie to Git and having trouble understanding how to use Git. I have been using CVS so going through some learning curve for Git. Here is what all I tried </p>
<p>Now I had changed only two files PromoServiceImpl.java and build.sql. However having trouble merging changed from "product" branch. </p>
<p>Rema... | 40,682 | 850,868 | 2012-12-07 12:56:11 | 8,505,895 | 20 | 2011-12-14 14:13:58 | 51,782 | 2011-12-14 14:39:17 | https://stackoverflow.com/q/8505289 | https://stackoverflow.com/a/8505895 | <p>There are a couple of things going on here. It helps to understand what happens when you issue various Git commands.</p>
<p>The <code>pull</code> command (as in <code>git pull</code>) <a href="https://stackoverflow.com/questions/292357/whats-the-difference-between-git-pull-and-git-fetch">results in</a> a <code>fet... | <p>There are a couple of things going on here. It helps to understand what happens when you issue various Git commands.</p> <p>The <code>pull</code> command (as in <code>git pull</code>) <a href="https://stackoverflow.com/questions/292357/whats-the-difference-between-git-pull-and-git-fetch">results in</a> a <code>fet... | 119, 717, 28896 | git, git-pull, merge | <h1>How to do git merge/pull correctly: You have not concluded your merge (MERGE_HEAD exists)</h1>
<p>I am a newbie to Git and having trouble understanding how to use Git. I have been using CVS so going through some learning curve for Git. Here is what all I tried </p>
<p>Now I had changed only two files PromoServiceI... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,605 | git | # How to do git merge/pull correctly: You have not concluded your merge (MERGE_HEAD exists)
I am a newbie to Git and having trouble understanding how to use Git. I have been using CVS so going through some learning curve for Git. Here is what all I tried
Now I had changed only two files PromoServiceImpl.java and buil... | There are a couple of things going on here. It helps to understand what happens when you issue various Git commands.
The `pull` command (as in `git pull`) [results in](https://stackoverflow.com/questions/292357/whats-the-difference-between-git-pull-and-git-fetch) a `fetch` followed by a `merge`. So when you did a `pul... |
4619576 | Best practice for ignoring files within a folder with GIT | 13 | 2011-01-06 20:37:18 | <p>I'm just looking for some advice on the best way to manage the following situation with git.</p>
<p>my project has a folder called "photos" that users can upload images to.</p>
<p>I have a version of the project running locally and I am adding images to this folder for testing purposes.</p>
<p>When I push to the ... | 7,634 | 191,586 | 2011-01-06 20:50:37 | 4,619,717 | 20 | 2011-01-06 20:50:37 | 19,750 | 2011-01-06 20:50:37 | https://stackoverflow.com/q/4619576 | https://stackoverflow.com/a/4619717 | <pre><code>echo '*' > photos/.gitignore
git add -f photos/.gitignore
</code></pre>
<p>Git does not support empty directories, but standard practice for a directory is to create a <a href="http://git-scm.com/docs/gitignore"><code>.gitignore</code></a> file inside it. The <code>*</code> entry causes git to ignore any... | <pre><code>echo '*' > photos/.gitignore git add -f photos/.gitignore </code></pre> <p>Git does not support empty directories, but standard practice for a directory is to create a <a href="http://git-scm.com/docs/gitignore"><code>.gitignore</code></a> file inside it. The <code>*</code> entry causes git to ignore any... | 119, 25056 | git, gitignore | <h1>Best practice for ignoring files within a folder with GIT</h1>
<p>I'm just looking for some advice on the best way to manage the following situation with git.</p>
<p>my project has a folder called "photos" that users can upload images to.</p>
<p>I have a version of the project running locally and I am adding imag... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,606 | git | # Best practice for ignoring files within a folder with GIT
I'm just looking for some advice on the best way to manage the following situation with git.
my project has a folder called "photos" that users can upload images to.
I have a version of the project running locally and I am adding images to this folder for t... | ```
echo '*' > photos/.gitignore
git add -f photos/.gitignore
```
Git does not support empty directories, but standard practice for a directory is to create a [`.gitignore`](http://git-scm.com/docs/gitignore) file inside it. The `*` entry causes git to ignore anything inside the directory (even the `.gitignore` file i... |
1992611 | Why is this git shallow clone bigger than I expected? | 13 | 2010-01-02 19:44:56 | <p>I have a repo that is about 24MB in size but the files in the project are actually just around 2MB. I was under the impression that a shallow clone with --depth 1 would pretty much get me down close to the 2MB of the actual files (sans entire repo). </p>
<p>When I do the shallow clone the new repo shows only the cu... | 8,682 | 184,532 | 2014-12-15 09:15:34 | 1,992,851 | 20 | 2010-01-02 21:08:22 | 69,755 | 2014-12-15 09:15:34 | https://stackoverflow.com/q/1992611 | https://stackoverflow.com/a/1992851 | <p>If this is a local clone, then the clone may be operating by hard linking objects in your new repository to those in your old repository (it does this as an optimization on local file systems). To see if this is the case, you can disable hard linking:</p>
<pre><code>git clone --depth 1 --no-hardlinks /path/to/repo.... | <p>If this is a local clone, then the clone may be operating by hard linking objects in your new repository to those in your old repository (it does this as an optimization on local file systems). To see if this is the case, you can disable hard linking:</p> <pre><code>git clone --depth 1 --no-hardlinks /path/to/repo.... | 119 | git | <h1>Why is this git shallow clone bigger than I expected?</h1>
<p>I have a repo that is about 24MB in size but the files in the project are actually just around 2MB. I was under the impression that a shallow clone with --depth 1 would pretty much get me down close to the 2MB of the actual files (sans entire repo). </p>... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,607 | git | # Why is this git shallow clone bigger than I expected?
I have a repo that is about 24MB in size but the files in the project are actually just around 2MB. I was under the impression that a shallow clone with --depth 1 would pretty much get me down close to the 2MB of the actual files (sans entire repo).
When I do th... | If this is a local clone, then the clone may be operating by hard linking objects in your new repository to those in your old repository (it does this as an optimization on local file systems). To see if this is the case, you can disable hard linking:
```
git clone --depth 1 --no-hardlinks /path/to/repo.git
```
If yo... |
51316253 | Extended message for commit via Visual Studio Code? | 12 | 2018-07-13 00:43:08 | <p>I know, with command line I can do this:</p>
<pre><code>git commit -m "Title" -m "Description .........."
</code></pre>
<p>Is there way to do this via <strong>Git Version Control in VS Code</strong>?</p>
| 9,611 | 9,766,724 | 2022-09-14 14:48:37 | 51,316,392 | 20 | 2018-07-13 01:07:55 | 7,692,463 | 2018-07-13 01:33:26 | https://stackoverflow.com/q/51316253 | https://stackoverflow.com/a/51316392 | <p>First, people are often misunderstanding what this command actually does. It is important to know what happens behind the scene. </p>
<p>So, this is from the <code>git commit</code> <a href="https://git-scm.com/docs/git-commit#git-commit--mltmsggt" rel="noreferrer">documentation</a>:</p>
<blockquote>
<p>If multi... | <p>First, people are often misunderstanding what this command actually does. It is important to know what happens behind the scene. </p> <p>So, this is from the <code>git commit</code> <a href="https://git-scm.com/docs/git-commit#git-commit--mltmsggt" rel="noreferrer">documentation</a>:</p> <blockquote> <p>If multi... | 119, 111608 | git, visual-studio-code | <h1>Extended message for commit via Visual Studio Code?</h1>
<p>I know, with command line I can do this:</p>
<pre><code>git commit -m "Title" -m "Description .........."
</code></pre>
<p>Is there way to do this via <strong>Git Version Control in VS Code</strong>?</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,611 | git | # Extended message for commit via Visual Studio Code?
I know, with command line I can do this:
```
git commit -m "Title" -m "Description .........."
```
Is there way to do this via **Git Version Control in VS Code**? | First, people are often misunderstanding what this command actually does. It is important to know what happens behind the scene.
So, this is from the `git commit` [documentation](https://git-scm.com/docs/git-commit#git-commit--mltmsggt):
> If multiple -m options are given, their values are concatenated as separate pa... |
47947272 | What to commit when using Carthage? | 12 | 2017-12-22 20:54:06 | <p>This is my first time using Carthage! I'm using a library called "<a href="https://github.com/LeoNatan/LNPopupController" rel="noreferrer">https://github.com/LeoNatan/LNPopupController</a>" and I got it to work on my project. The issue is I want to commit these changes but when I do I got a popup saying that a certa... | 5,253 | 7,097,242 | 2017-12-22 22:21:37 | 47,947,384 | 20 | 2017-12-22 21:05:03 | 6,309 | 2017-12-22 21:34:08 | https://stackoverflow.com/q/47947272 | https://stackoverflow.com/a/47947384 | <p>The <a href="https://github.com/Carthage/Carthage/issues/393" rel="noreferrer">Carthage/Carthage issue 393</a> covers this.</p>
<p>It refers to <a href="https://github.com/github/gitignore/blob/1a9f616ce525987555d43c72d59eb830d1856bd7/Swift.gitignore#L51-L56" rel="noreferrer"><code>github/gitignore/Swift.gitignore<... | <p>The <a href="https://github.com/Carthage/Carthage/issues/393" rel="noreferrer">Carthage/Carthage issue 393</a> covers this.</p> <p>It refers to <a href="https://github.com/github/gitignore/blob/1a9f616ce525987555d43c72d59eb830d1856bd7/Swift.gitignore#L51-L56" rel="noreferrer"><code>github/gitignore/Swift.gitignore<... | 119, 109201 | carthage, git | <h1>What to commit when using Carthage?</h1>
<p>This is my first time using Carthage! I'm using a library called "<a href="https://github.com/LeoNatan/LNPopupController" rel="noreferrer">https://github.com/LeoNatan/LNPopupController</a>" and I got it to work on my project. The issue is I want to commit these changes bu... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,612 | git | # What to commit when using Carthage?
This is my first time using Carthage! I'm using a library called "<https://github.com/LeoNatan/LNPopupController>" and I got it to work on my project. The issue is I want to commit these changes but when I do I got a popup saying that a certain file was bigger then 10MB!
The ques... | The [Carthage/Carthage issue 393](https://github.com/Carthage/Carthage/issues/393) covers this.
It refers to [`github/gitignore/Swift.gitignore`](https://github.com/github/gitignore/blob/1a9f616ce525987555d43c72d59eb830d1856bd7/Swift.gitignore#L51-L56) as a possible example:
```
# Carthage
#
# Add this line if you wa... |
44533132 | How does npm version work? | 12 | 2017-06-13 23:31:16 | <p>I'm a little hazy on how <a href="https://docs.npmjs.com/cli/version" rel="noreferrer"><code>npm version</code></a> works. The documentation says:</p>
<blockquote>
<p>If run in a git repo, it will also create a version commit and tag.</p>
</blockquote>
<p>Does that mean I don't have to run <code>git commit</code... | 6,752 | 203,708 | 2019-06-23 09:02:43 | 44,533,301 | 20 | 2017-06-13 23:56:18 | 2,344,348 | 2019-06-23 09:02:43 | https://stackoverflow.com/q/44533132 | https://stackoverflow.com/a/44533301 | <p>Your understanding is mostly correct</p>
<p>When you execute the <code>npm version</code> command the following is done:</p>
<ol>
<li>bump package version as directed in <code>package.json</code></li>
<li>create a commit containing only the update to <code>package.json</code> with the message specified when invoki... | <p>Your understanding is mostly correct</p> <p>When you execute the <code>npm version</code> command the following is done:</p> <ol> <li>bump package version as directed in <code>package.json</code></li> <li>create a commit containing only the update to <code>package.json</code> with the message specified when invoki... | 119, 61387, 122329 | git, npm, npm-version | <h1>How does npm version work?</h1>
<p>I'm a little hazy on how <a href="https://docs.npmjs.com/cli/version" rel="noreferrer"><code>npm version</code></a> works. The documentation says:</p>
<blockquote>
<p>If run in a git repo, it will also create a version commit and tag.</p>
</blockquote>
<p>Does that mean I don'... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,613 | git | # How does npm version work?
I'm a little hazy on how [`npm version`](https://docs.npmjs.com/cli/version) works. The documentation says:
> If run in a git repo, it will also create a version commit and tag.
Does that mean I don't have to run `git commit` or `git tag` or does it just take the place of `git tag -a <ve... | Your understanding is mostly correct
When you execute the `npm version` command the following is done:
1. bump package version as directed in `package.json`
2. create a commit containing only the update to `package.json` with the message specified when invoking `npm version`.
3. create a git tag
You can then execute... |
32251037 | Ignore changes to a tracked file | 12 | 2015-08-27 13:42:25 | <p>I want to change a tracked file for development only, but keep the tracked version unchanged.</p>
<p>Most "solutions" for this suggest</p>
<pre><code>git update-index --assume-unchanged
</code></pre>
<p>but it's totally useless, because the file will still be changed by checkout or reset. Is there a better soluti... | 2,831 | 4,850,449 | 2015-08-27 19:20:43 | 32,257,019 | 20 | 2015-08-27 18:34:43 | 4,231,110 | 2015-08-27 18:44:12 | https://stackoverflow.com/q/32251037 | https://stackoverflow.com/a/32257019 |
<h1>Quick Fix</h1>
<p>This is what I think you're trying to do, change a file, but ignore it when committing.</p>
<pre class="lang-bash prettyprint-override"><code>git update-index --skip-worktree my-file
</code></pre>
<p>Here is a good answer regarding the <a href="https://stackoverflow.com/a/13631525/4231110">di... | <h1>Quick Fix</h1> <p>This is what I think you're trying to do, change a file, but ignore it when committing.</p> <pre class="lang-bash prettyprint-override"><code>git update-index --skip-worktree my-file </code></pre> <p>Here is a good answer regarding the <a href="https://stackoverflow.com/a/13631525/4231110">di... | 119, 4333, 5310 | file, git, ignore | <h1>Ignore changes to a tracked file</h1>
<p>I want to change a tracked file for development only, but keep the tracked version unchanged.</p>
<p>Most "solutions" for this suggest</p>
<pre><code>git update-index --assume-unchanged
</code></pre>
<p>but it's totally useless, because the file will still be changed by c... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,615 | git | # Ignore changes to a tracked file
I want to change a tracked file for development only, but keep the tracked version unchanged.
Most "solutions" for this suggest
```
git update-index --assume-unchanged
```
but it's totally useless, because the file will still be changed by checkout or reset. Is there a better solu... | # Quick Fix
This is what I think you're trying to do, change a file, but ignore it when committing.
```
git update-index --skip-worktree my-file
```
Here is a good answer regarding the [difference between `assume-unchanged` and `skip-worktree`](https://stackoverflow.com/a/13631525/4231110).
Git will still warn if y... |
21738579 | Difference between `git stash show -p stash@{N}` and `git show stash@{N}`? | 12 | 2014-02-12 20:11:18 | <p>I thought they should be basically the same, but when I tried</p>
<pre><code>$ git stash show -p stash@{N}
</code></pre>
<p>and</p>
<pre><code>$ git show stash@{N}
</code></pre>
<p>the latter shows some additional commit information, but the actual diff was much, much shorter. (The former shows about a dozen fil... | 2,497 | 424,632 | 2015-03-13 20:15:32 | 21,743,193 | 20 | 2014-02-13 00:56:35 | 1,256,452 | 2015-03-13 20:15:32 | https://stackoverflow.com/q/21738579 | https://stackoverflow.com/a/21743193 | <h3>Stash bags</h3>
<p>The thing saved by <code>git stash</code> is what I have taken to calling a <a href="https://stackoverflow.com/a/20412685/1256452">"stash bag"</a>. It consists of two<sup>1</sup> separate commits: the "index" commit (the staging area), and the "work tree" commit. The work-tree commit is a funn... | <h3>Stash bags</h3> <p>The thing saved by <code>git stash</code> is what I have taken to calling a <a href="https://stackoverflow.com/a/20412685/1256452">"stash bag"</a>. It consists of two<sup>1</sup> separate commits: the "index" commit (the staging area), and the "work tree" commit. The work-tree commit is a funn... | 119, 13091, 74295 | git, git-show, git-stash | <h1>Difference between `git stash show -p stash@{N}` and `git show stash@{N}`?</h1>
<p>I thought they should be basically the same, but when I tried</p>
<pre><code>$ git stash show -p stash@{N}
</code></pre>
<p>and</p>
<pre><code>$ git show stash@{N}
</code></pre>
<p>the latter shows some additional commit informat... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,616 | git | # Difference between `git stash show -p stash@{N}` and `git show stash@{N}`?
I thought they should be basically the same, but when I tried
```
$ git stash show -p stash@{N}
```
and
```
$ git show stash@{N}
```
the latter shows some additional commit information, but the actual diff was much, much shorter. (The for... | ### Stash bags
The thing saved by `git stash` is what I have taken to calling a ["stash bag"](https://stackoverflow.com/a/20412685/1256452). It consists of two1 separate commits: the "index" commit (the staging area), and the "work tree" commit. The work-tree commit is a funny kind of merge commit.
Let me draw this a... |
20953552 | I have error when push/pull git | 12 | 2014-01-06 15:41:50 | <p>I am created my exists project from local files. But this project exists in git repository. And now i need commit changes in project and pull/push his, but git don't know what is repository i have master or origin.
This is error message: </p>
<pre><code>fatal: No remote repository specified. Please, specify eithe... | 29,133 | 1,776,681 | 2016-08-03 02:30:48 | 20,953,899 | 20 | 2014-01-06 15:59:17 | 2,812,723 | 2014-01-06 16:25:45 | https://stackoverflow.com/q/20953552 | https://stackoverflow.com/a/20953899 | <p>If you initially cloned your repository then:</p>
<pre><code>git push origin master
</code></pre>
<p>If you are wanting to push local files to an empty repository you created on github, then:</p>
<pre><code>git remote add origin git@github.com:username/reponame.git
</code></pre>
<p>You have to have a connection ... | <p>If you initially cloned your repository then:</p> <pre><code>git push origin master </code></pre> <p>If you are wanting to push local files to an empty repository you created on github, then:</p> <pre><code>git remote add origin git@github.com:username/reponame.git </code></pre> <p>You have to have a connection ... | 119 | git | <h1>I have error when push/pull git</h1>
<p>I am created my exists project from local files. But this project exists in git repository. And now i need commit changes in project and pull/push his, but git don't know what is repository i have master or origin.
This is error message: </p>
<pre><code>fatal: No remote rep... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,617 | git | # I have error when push/pull git
I am created my exists project from local files. But this project exists in git repository. And now i need commit changes in project and pull/push his, but git don't know what is repository i have master or origin.
This is error message:
```
fatal: No remote repository specified. Pl... | If you initially cloned your repository then:
```
git push origin master
```
If you are wanting to push local files to an empty repository you created on github, then:
```
git remote add origin git@github.com:username/reponame.git
```
You have to have a connection established to communicate properly. [Here](https:/... |
5558785 | maven release plugin, git, and the pom's not at the top | 12 | 2011-04-05 21:31:06 | <p>I've got a git repo where the top level directory has three directories in it: java, COM, and csharp. As you might guess, the pom.xml lives in the java directory.</p>
<p>All is well until I go to run the release plugin. It clones the entire repo into target/checkout, and then expects the pom to be right there at th... | 7,247 | 131,433 | 2014-03-11 21:47:48 | 8,233,712 | 20 | 2011-11-22 20:56:10 | 1,060,638 | 2014-03-11 21:47:48 | https://stackoverflow.com/q/5558785 | https://stackoverflow.com/a/8233712 | <p>Tested: add the following to your build/plugins section:</p>
<pre><code><plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.2.1</version>
<executions>
<execution>
<i... | <p>Tested: add the following to your build/plugins section:</p> <pre><code><plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-release-plugin</artifactId> <version>2.2.1</version> <executions> <execution> <i... | 119, 1912 | git, maven-2 | <h1>maven release plugin, git, and the pom's not at the top </h1>
<p>I've got a git repo where the top level directory has three directories in it: java, COM, and csharp. As you might guess, the pom.xml lives in the java directory.</p>
<p>All is well until I go to run the release plugin. It clones the entire repo into... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,618 | git | # maven release plugin, git, and the pom's not at the top
I've got a git repo where the top level directory has three directories in it: java, COM, and csharp. As you might guess, the pom.xml lives in the java directory.
All is well until I go to run the release plugin. It clones the entire repo into target/checkout,... | Tested: add the following to your build/plugins section:
```
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.2.1</version>
<executions>
<execution>
<id>default</id>
<goals>
<goal>perform</goal>... |
5703237 | git: Is there something like per-branch tags? | 12 | 2011-04-18 12:58:28 | <p>I have some history rewriting to do for which I'd like to keep my original tree intact for now. The rewritten tree should however copy the tags previously used as well. Is there any less manual option than e.g. prepending tag names with the branch name?</p>
| 5,867 | 321,973 | 2015-11-08 16:39:55 | 5,704,521 | 20 | 2011-04-18 14:37:59 | 69,755 | 2011-04-18 14:46:53 | https://stackoverflow.com/q/5703237 | https://stackoverflow.com/a/5704521 | <p>No, there is nothing like a per-branch tag in git. All branches and tags are just kinds of refs in Git; a ref is just a name that points to a particular revision in the revision history. For instance, if you have <code>devel</code> and <code>master</code> branches, and <code>v1.0</code> and <code>v2.0</code> tags, t... | <p>No, there is nothing like a per-branch tag in git. All branches and tags are just kinds of refs in Git; a ref is just a name that points to a particular revision in the revision history. For instance, if you have <code>devel</code> and <code>master</code> branches, and <code>v1.0</code> and <code>v2.0</code> tags, t... | 115, 119, 29934, 55278, 60718 | git, git-rebase, git-tag, tagname, tags | <h1>git: Is there something like per-branch tags?</h1>
<p>I have some history rewriting to do for which I'd like to keep my original tree intact for now. The rewritten tree should however copy the tags previously used as well. Is there any less manual option than e.g. prepending tag names with the branch name?</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,619 | git | # git: Is there something like per-branch tags?
I have some history rewriting to do for which I'd like to keep my original tree intact for now. The rewritten tree should however copy the tags previously used as well. Is there any less manual option than e.g. prepending tag names with the branch name? | No, there is nothing like a per-branch tag in git. All branches and tags are just kinds of refs in Git; a ref is just a name that points to a particular revision in the revision history. For instance, if you have `devel` and `master` branches, and `v1.0` and `v2.0` tags, the references would look something like this:
... |
3180365 | Cloning a Git repo without the .git directory | 12 | 2010-07-05 14:43:46 | <p>Is it possible to clone a repository without git creating a .git folder inside the local copy of the repository? Sort of like a read only functionality?</p>
| 5,539 | 303,675 | 2016-07-02 23:02:49 | 3,180,471 | 20 | 2010-07-05 14:59:29 | 9,410 | 2010-07-06 13:34:09 | https://stackoverflow.com/q/3180365 | https://stackoverflow.com/a/3180471 | <p>You’re looking for <a href="http://www.kernel.org/pub/software/scm/git/docs/git-archive.html" rel="noreferrer"><code>git archive</code></a>. You either use it within a repository, or pass it the <code>--remote=<URL></code> switch, and it gives you a tarball or zip file of the source tree. You can pipe that str... | <p>You’re looking for <a href="http://www.kernel.org/pub/software/scm/git/docs/git-archive.html" rel="noreferrer"><code>git archive</code></a>. You either use it within a repository, or pass it the <code>--remote=<URL></code> switch, and it gives you a tarball or zip file of the source tree. You can pipe that str... | 119, 34099 | git, git-clone | <h1>Cloning a Git repo without the .git directory</h1>
<p>Is it possible to clone a repository without git creating a .git folder inside the local copy of the repository? Sort of like a read only functionality?</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,620 | git | # Cloning a Git repo without the .git directory
Is it possible to clone a repository without git creating a .git folder inside the local copy of the repository? Sort of like a read only functionality? | You’re looking for [`git archive`](http://www.kernel.org/pub/software/scm/git/docs/git-archive.html). You either use it within a repository, or pass it the `--remote=<URL>` switch, and it gives you a tarball or zip file of the source tree. You can pipe that straight back into `tar` if you want to just get a pristine co... |
3166713 | Git: How to ignore fast forward and revert origin [branch] to earlier commit? | 12 | 2010-07-02 14:44:36 | <p>I used
<pre>
git reset --hard dc082bc... </pre>to revert to the branch back to a required previous state, due to some bad commits. This has rewound my local branch fine. However, I want to rewind the branch on 'origin' to the same commit so that I can start again. Could anyone tell me how to revert the origin br... | 23,995 | 343,223 | 2020-02-11 07:05:35 | 3,166,799 | 20 | 2010-07-02 14:55:13 | 6,309 | 2010-07-02 20:26:03 | https://stackoverflow.com/q/3166713 | https://stackoverflow.com/a/3166799 | <p>You can try <code>git push --force</code> to force the push.</p>
<pre><code>--force
</code></pre>
<blockquote>
<p>Usually, the command refuses to update a remote ref that is not an ancestor of the local ref used to overwrite it. This flag disables the check.<br>
This can cause the remote repository to lose com... | <p>You can try <code>git push --force</code> to force the push.</p> <pre><code>--force </code></pre> <blockquote> <p>Usually, the command refuses to update a remote ref that is not an ancestor of the local ref used to overwrite it. This flag disables the check.<br> This can cause the remote repository to lose com... | 119, 5597, 53435 | commit, git, reverting | <h1>Git: How to ignore fast forward and revert origin [branch] to earlier commit?</h1>
<p>I used
<pre>
git reset --hard dc082bc... </pre>to revert to the branch back to a required previous state, due to some bad commits. This has rewound my local branch fine. However, I want to rewind the branch on 'origin' to the s... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,621 | git | # Git: How to ignore fast forward and revert origin [branch] to earlier commit?
I used
```
git reset --hard dc082bc...
```
to revert to the branch back to a required previous state, due to some bad commits. This has rewound my local branch fine. However, I want to rewind the branch on 'origin' to the same commit so ... | You can try `git push --force` to force the push.
```
--force
```
> Usually, the command refuses to update a remote ref that is not an ancestor of the local ref used to overwrite it. This flag disables the check.
> This can cause the remote repository to lose commits; use it with care.
So if lots of people have al... |
55023087 | Pylint and pre-commit python 3.7 | 11 | 2019-03-06 12:25:24 | <p>I am trying to set up pylint to work with pre-commit. I have looked into the docs, but still I am confused. I do not know how to setup .pre-commit-config.yaml properly.</p>
<p>Could you provide the most basic possible template?</p>
<pre><code>- repo: myrepo
rev: '' # Don't know that to type here
hooks:
... | 19,798 | 10,675,271 | 2022-06-15 03:55:55 | 56,640,168 | 20 | 2019-06-17 23:57:27 | 3,898,322 | 2020-12-23 18:51:28 | https://stackoverflow.com/q/55023087 | https://stackoverflow.com/a/56640168 | <p>The most basic possible template would be this:</p>
<pre><code>- repo: https://github.com/pycqa/pylint
rev: pylint-2.6.0
hooks:
- id: pylint
</code></pre>
<p>You can also pass arguments to pylint:</p>
<pre><code>- repo: https://github.com/pycqa/pylint
rev: pylint-2.6.0
hooks:
- id: py... | <p>The most basic possible template would be this:</p> <pre><code>- repo: https://github.com/pycqa/pylint rev: pylint-2.6.0 hooks: - id: pylint </code></pre> <p>You can also pass arguments to pylint:</p> <pre><code>- repo: https://github.com/pycqa/pylint rev: pylint-2.6.0 hooks: - id: py... | 119, 8046, 125627, 139402 | git, pre-commit.com, pylint, python-3.7 | <h1>Pylint and pre-commit python 3.7</h1>
<p>I am trying to set up pylint to work with pre-commit. I have looked into the docs, but still I am confused. I do not know how to setup .pre-commit-config.yaml properly.</p>
<p>Could you provide the most basic possible template?</p>
<pre><code>- repo: myrepo
rev: '' ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,622 | git | # Pylint and pre-commit python 3.7
I am trying to set up pylint to work with pre-commit. I have looked into the docs, but still I am confused. I do not know how to setup .pre-commit-config.yaml properly.
Could you provide the most basic possible template?
```
- repo: myrepo
rev: '' # Don't know that to type h... | The most basic possible template would be this:
```
- repo: https://github.com/pycqa/pylint
rev: pylint-2.6.0
hooks:
- id: pylint
```
You can also pass arguments to pylint:
```
- repo: https://github.com/pycqa/pylint
rev: pylint-2.6.0
hooks:
- id: pylint
args:
- --max-... |
44906548 | Git rebase local vs git pull --rebase origin | 11 | 2017-07-04 12:51:45 | <p>I have a local (never pushed to a remote) feature branch <strong><em>F1</em></strong> made from <strong><em>master</em></strong> with a few commits. I don't seem to understand a difference between these two actions (<strong><em>F1</em></strong> is the current branch):</p>
<pre><code>git fetch origin
git rebase mast... | 14,872 | 90,859 | 2020-05-07 00:16:20 | 44,908,753 | 20 | 2017-07-04 14:38:42 | 6,936,103 | 2020-05-07 00:16:20 | https://stackoverflow.com/q/44906548 | https://stackoverflow.com/a/44908753 | <p><strong>1.</strong> <code>git fetch origin</code> and <code>git rebase master</code> will apply changes from <code>F1</code> to local <code>master</code> branch. Assume your commit history looks like below at first (the remote <code>master</code> branch has commit <code>J</code> in remote):</p>
<pre><code>A---B---C... | <p><strong>1.</strong> <code>git fetch origin</code> and <code>git rebase master</code> will apply changes from <code>F1</code> to local <code>master</code> branch. Assume your commit history looks like below at first (the remote <code>master</code> branch has commit <code>J</code> in remote):</p> <pre><code>A---B---C... | 119, 456, 29934, 53847 | branching-and-merging, git, git-rebase, version-control | <h1>Git rebase local vs git pull --rebase origin</h1>
<p>I have a local (never pushed to a remote) feature branch <strong><em>F1</em></strong> made from <strong><em>master</em></strong> with a few commits. I don't seem to understand a difference between these two actions (<strong><em>F1</em></strong> is the current bra... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,624 | git | # Git rebase local vs git pull --rebase origin
I have a local (never pushed to a remote) feature branch ***F1*** made from ***master*** with a few commits. I don't seem to understand a difference between these two actions (***F1*** is the current branch):
```
git fetch origin
git rebase master
```
and
```
git pull ... | **1.** `git fetch origin` and `git rebase master` will apply changes from `F1` to local `master` branch. Assume your commit history looks like below at first (the remote `master` branch has commit `J` in remote):
```
A---B---C---D---E master
\
F---G---H F1
```
When you execute `git fetch origin... |
11106229 | git-svn workflow for merging using svn.pushmergeinfo | 11 | 2012-06-19 17:31:17 | <p>What is the correct workflow for merging svn tracked branches using git-svn. I've read a little about the git-svn svn.pushmergeinfo config key, and the caveats are:</p>
<p>From <a href="http://www.kernel.org/pub/software/scm/git/docs/git-svn.html" rel="noreferrer">http://www.kernel.org/pub/software/scm/git/docs/git... | 2,933 | 98,050 | 2014-11-06 03:02:32 | 11,117,761 | 20 | 2012-06-20 10:36:19 | 1,156,561 | 2012-06-20 10:36:19 | https://stackoverflow.com/q/11106229 | https://stackoverflow.com/a/11117761 | <p>Using <em>merge --squash</em> and <em>svn.pushmergeinfo</em> together doesn't make much sense. With merge --squash, the resulting commit won't be a merge commit, so a subsequent <em>dcommit</em> won't create any mergeinfo.</p>
<p>I know that (mostly older) threads here on stackoverflow suggest using --squash, but I... | <p>Using <em>merge --squash</em> and <em>svn.pushmergeinfo</em> together doesn't make much sense. With merge --squash, the resulting commit won't be a merge commit, so a subsequent <em>dcommit</em> won't create any mergeinfo.</p> <p>I know that (mostly older) threads here on stackoverflow suggest using --squash, but I... | 63, 119, 717, 6452, 46556 | git, git-svn, merge, mergeinfo, svn | <h1>git-svn workflow for merging using svn.pushmergeinfo</h1>
<p>What is the correct workflow for merging svn tracked branches using git-svn. I've read a little about the git-svn svn.pushmergeinfo config key, and the caveats are:</p>
<p>From <a href="http://www.kernel.org/pub/software/scm/git/docs/git-svn.html" rel="n... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,628 | git | # git-svn workflow for merging using svn.pushmergeinfo
What is the correct workflow for merging svn tracked branches using git-svn. I've read a little about the git-svn svn.pushmergeinfo config key, and the caveats are:
From <http://www.kernel.org/pub/software/scm/git/docs/git-svn.html>:
> config key: svn.pushmergei... | Using *merge --squash* and *svn.pushmergeinfo* together doesn't make much sense. With merge --squash, the resulting commit won't be a merge commit, so a subsequent *dcommit* won't create any mergeinfo.
I know that (mostly older) threads here on stackoverflow suggest using --squash, but I think that's largely a relic o... |
7549467 | .gitignore won't ignore the directory | 11 | 2011-09-26 00:01:11 | <p>I'm trying to ignore the xcuserdata folders that xcode 4 modifies and they keep come back despite being in my .gitignore file.</p>
<p>My .gitignore file as one line:</p>
<pre><code>xcuserdata
</code></pre>
<p>Yet as soon as I change anything UI in xcode, I get this:</p>
<pre><code># modified: XXXXXXXX.xcodep... | 3,983 | 277,192 | 2012-05-13 19:27:46 | 7,550,335 | 20 | 2011-09-26 03:14:53 | 526,535 | 2011-09-26 03:14:53 | https://stackoverflow.com/q/7549467 | https://stackoverflow.com/a/7550335 | <p>After doing</p>
<pre><code>git rm -r --cached XXXXXXXX.xcodeproj/project.xcworkspace/xcuserdata
</code></pre>
<p>check that <code>git status</code> tells you that the files under that folder have been deleted. Then after your commit, ensure that git says there is nothing to commit.</p>
<p>The fact that you have d... | <p>After doing</p> <pre><code>git rm -r --cached XXXXXXXX.xcodeproj/project.xcworkspace/xcuserdata </code></pre> <p>check that <code>git status</code> tells you that the files under that folder have been deleted. Then after your commit, ensure that git says there is nothing to commit.</p> <p>The fact that you have d... | 119, 59704 | git, xcode4 | <h1>.gitignore won't ignore the directory</h1>
<p>I'm trying to ignore the xcuserdata folders that xcode 4 modifies and they keep come back despite being in my .gitignore file.</p>
<p>My .gitignore file as one line:</p>
<pre><code>xcuserdata
</code></pre>
<p>Yet as soon as I change anything UI in xcode, I get this:<... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,630 | git | # .gitignore won't ignore the directory
I'm trying to ignore the xcuserdata folders that xcode 4 modifies and they keep come back despite being in my .gitignore file.
My .gitignore file as one line:
```
xcuserdata
```
Yet as soon as I change anything UI in xcode, I get this:
```
# modified: XXXXXXXX.xcodeproj/... | After doing
```
git rm -r --cached XXXXXXXX.xcodeproj/project.xcworkspace/xcuserdata
```
check that `git status` tells you that the files under that folder have been deleted. Then after your commit, ensure that git says there is nothing to commit.
The fact that you have done this "10 times" and it comes as modified ... |
6790194 | Does `git reset HEAD file` also check out the file? | 11 | 2011-07-22 12:44:15 | <p>I mistakenly added a directory to git and when I followed the tip <a href="https://stackoverflow.com/questions/348170/undo-git-add">here</a> to undo the add by doing <code>git reset HEAD <file></code>, I was horrified to discover that the current working copy of one of the files, which has lots of changes (wor... | 26,827 | 562,776 | 2017-01-22 15:53:24 | 6,790,291 | 20 | 2011-07-22 12:52:09 | 773,830 | 2011-07-22 12:52:09 | https://stackoverflow.com/q/6790194 | https://stackoverflow.com/a/6790291 | <p>Only <code>git checkout -- <file></code> should have reverted the files in their previous stats.
<code>git reset HEAD <file></code> should only unstage the file, not revert its content.</p>
| <p>Only <code>git checkout -- <file></code> should have reverted the files in their previous stats. <code>git reset HEAD <file></code> should only unstage the file, not revert its content.</p> | 119 | git | <h1>Does `git reset HEAD file` also check out the file?</h1>
<p>I mistakenly added a directory to git and when I followed the tip <a href="https://stackoverflow.com/questions/348170/undo-git-add">here</a> to undo the add by doing <code>git reset HEAD <file></code>, I was horrified to discover that the current wor... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,633 | git | # Does `git reset HEAD file` also check out the file?
I mistakenly added a directory to git and when I followed the tip [here](https://stackoverflow.com/questions/348170/undo-git-add) to undo the add by doing `git reset HEAD <file>`, I was horrified to discover that the current working copy of one of the files, which ... | Only `git checkout -- <file>` should have reverted the files in their previous stats.
`git reset HEAD <file>` should only unstage the file, not revert its content. |
4152936 | How do I use `git rebase -i` after `git merge` without messing things up? | 11 | 2010-11-11 09:29:04 | <p>I have the following situation:</p>
<ol>
<li><p>I made some commits to my local repository, and then a huge merge of another branch (~150 commits) into the master. It had a lot of conflicts in it.</p>
</li>
<li><p>Now, I want to move a commit I made before the merge to be after it before pushing.</p>
</li>
</ol>
<p>... | 4,534 | 414,037 | 2022-01-31 17:07:37 | 4,155,237 | 20 | 2010-11-11 14:13:34 | 119,963 | 2022-01-31 16:51:54 | https://stackoverflow.com/q/4152936 | https://stackoverflow.com/a/4155237 | <p>Here's what the <a href="http://git.kernel.org/?p=git/git.git;a=blob;f=contrib/rerere-train.sh;hb=HEAD" rel="nofollow noreferrer">rerere-train.sh</a> script I mentioned in my comment does—essentially it redoes the merge, uses your resolution, and just lets rerere see it. You could do this manually just for your sing... | <p>Here's what the <a href="http://git.kernel.org/?p=git/git.git;a=blob;f=contrib/rerere-train.sh;hb=HEAD" rel="nofollow noreferrer">rerere-train.sh</a> script I mentioned in my comment does—essentially it redoes the merge, uses your resolution, and just lets rerere see it. You could do this manually just for your sing... | 119, 717, 8974 | git, merge, rebase | <h1>How do I use `git rebase -i` after `git merge` without messing things up?</h1>
<p>I have the following situation:</p>
<ol>
<li><p>I made some commits to my local repository, and then a huge merge of another branch (~150 commits) into the master. It had a lot of conflicts in it.</p>
</li>
<li><p>Now, I want to move ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,634 | git | # How do I use `git rebase -i` after `git merge` without messing things up?
I have the following situation:
1. I made some commits to my local repository, and then a huge merge of another branch (~150 commits) into the master. It had a lot of conflicts in it.
2. Now, I want to move a commit I made before the merge to... | Here's what the [rerere-train.sh](http://git.kernel.org/?p=git/git.git;a=blob;f=contrib/rerere-train.sh;hb=HEAD) script I mentioned in my comment does—essentially it redoes the merge, uses your resolution, and just lets rerere see it. You could do this manually just for your single commit if you like:
```
git checkout... |
55592934 | Fastlane match cannot connect over SSH | 10 | 2019-04-09 12:30:33 | <p><strong>Existing solutions</strong></p>
<p>I've searched SO and Github extensively before asking my question. None of the existing topics present any working solutions for our setup.</p>
<p><strong>Configuration</strong></p>
<p>We've got Jenkins + Fastlane configured on a remote macOS machine.
Fastlane match is s... | 20,427 | 942,225 | 2022-07-08 02:44:23 | 55,700,607 | 20 | 2019-04-16 04:33:22 | 6,309 | 2019-04-18 13:46:32 | https://stackoverflow.com/q/55592934 | https://stackoverflow.com/a/55700607 | <p>Try first the same operation with Jenkins launched in an environment where the variable <code>GIT_SSH_COMMAND</code> is set to "<code>ssh -vvv</code>": that will give you full traces when Git tries and clone with SSH URL.</p>
<p>The <a href="https://stackoverflow.com/users/942225/mmvie">OP mmvie</a> confir... | <p>Try first the same operation with Jenkins launched in an environment where the variable <code>GIT_SSH_COMMAND</code> is set to "<code>ssh -vvv</code>": that will give you full traces when Git tries and clone with SSH URL.</p> <p>The <a href="https://stackoverflow.com/users/942225/mmvie">OP mmvie</a> confir... | 119, 386, 13407, 64999, 113585 | fastlane, git, jenkins, match, ssh | <h1>Fastlane match cannot connect over SSH</h1>
<p><strong>Existing solutions</strong></p>
<p>I've searched SO and Github extensively before asking my question. None of the existing topics present any working solutions for our setup.</p>
<p><strong>Configuration</strong></p>
<p>We've got Jenkins + Fastlane configure... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,636 | git | # Fastlane match cannot connect over SSH
**Existing solutions**
I've searched SO and Github extensively before asking my question. None of the existing topics present any working solutions for our setup.
**Configuration**
We've got Jenkins + Fastlane configured on a remote macOS machine.
Fastlane match is supposed ... | Try first the same operation with Jenkins launched in an environment where the variable `GIT_SSH_COMMAND` is set to "`ssh -vvv`": that will give you full traces when Git tries and clone with SSH URL.
The [OP mmvie](https://stackoverflow.com/users/942225/mmvie) confirms [in the comments](https://stackoverflow.com/quest... |
50530583 | Resetting git config | 10 | 2018-05-25 13:42:05 | <p>While trying to trouble shoot another problem, I entered this line of code: <code>git config --global http.postBuffer 157286400</code>. Now when I push git will compress objects, write objects, display the total, then pause for 30 seconds or more. I was hoping to reset the http.postBuffer but wasn't sure how. </p>
| 21,762 | 7,814,914 | 2018-05-25 14:04:53 | 50,531,001 | 20 | 2018-05-25 14:04:53 | 267 | 2018-05-25 14:04:53 | https://stackoverflow.com/q/50530583 | https://stackoverflow.com/a/50531001 | <p>To unset a global configuration setting in git you would run the following kind of command:</p>
<pre><code>git config --global --unset X
</code></pre>
<p>where <code>X</code> is the name of the setting, so in your case you should be able to remove the setting by doing this:</p>
<pre><code>git config --global --un... | <p>To unset a global configuration setting in git you would run the following kind of command:</p> <pre><code>git config --global --unset X </code></pre> <p>where <code>X</code> is the name of the setting, so in your case you should be able to remove the setting by doing this:</p> <pre><code>git config --global --un... | 119 | git | <h1>Resetting git config</h1>
<p>While trying to trouble shoot another problem, I entered this line of code: <code>git config --global http.postBuffer 157286400</code>. Now when I push git will compress objects, write objects, display the total, then pause for 30 seconds or more. I was hoping to reset the http.postBuff... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,638 | git | # Resetting git config
While trying to trouble shoot another problem, I entered this line of code: `git config --global http.postBuffer 157286400`. Now when I push git will compress objects, write objects, display the total, then pause for 30 seconds or more. I was hoping to reset the http.postBuffer but wasn't sure h... | To unset a global configuration setting in git you would run the following kind of command:
```
git config --global --unset X
```
where `X` is the name of the setting, so in your case you should be able to remove the setting by doing this:
```
git config --global --unset http.postBuffer
```
---
Also be aware that ... |
47588838 | How to fix conflicts in git? | 10 | 2017-12-01 07:49:38 | <p>When I try to pull I have the following message:</p>
<pre><code>Automatic merge failed; fix conflicts and then commit the result.
</code></pre>
<p>So, I try to fix conflict (as git suggest) for that I follow <a href="https://help.github.com/articles/resolving-a-merge-conflict-using-the-command-line/" rel="noreferr... | 57,624 | 245,549 | 2017-12-01 12:02:00 | 47,590,528 | 20 | 2017-12-01 09:41:22 | 7,640,269 | 2017-12-01 12:02:00 | https://stackoverflow.com/q/47588838 | https://stackoverflow.com/a/47590528 | <p>There are several ways to solve git conflicts, I will explain here using GUI and text editor way.</p>
<h1>Solving git conflict using text editor.</h1>
<p>Open any one of your favourite editor, example, Notepad, gedit, vim, nano or even Eclipse.</p>
<ol>
<li><p>Whenever there is conflict in a file git add conflict ma... | <p>There are several ways to solve git conflicts, I will explain here using GUI and text editor way.</p> <h1>Solving git conflict using text editor.</h1> <p>Open any one of your favourite editor, example, Notepad, gedit, vim, nano or even Eclipse.</p> <ol> <li><p>Whenever there is conflict in a file git add conflict ma... | 119, 717, 28897, 106113 | git, git-merge, git-merge-conflict, merge | <h1>How to fix conflicts in git?</h1>
<p>When I try to pull I have the following message:</p>
<pre><code>Automatic merge failed; fix conflicts and then commit the result.
</code></pre>
<p>So, I try to fix conflict (as git suggest) for that I follow <a href="https://help.github.com/articles/resolving-a-merge-conflict-... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,639 | git | # How to fix conflicts in git?
When I try to pull I have the following message:
```
Automatic merge failed; fix conflicts and then commit the result.
```
So, I try to fix conflict (as git suggest) for that I follow [these](https://help.github.com/articles/resolving-a-merge-conflict-using-the-command-line/) instructi... | There are several ways to solve git conflicts, I will explain here using GUI and text editor way.
# Solving git conflict using text editor.
Open any one of your favourite editor, example, Notepad, gedit, vim, nano or even Eclipse.
1. Whenever there is conflict in a file git add conflict marker that looks like this `... |
47067944 | How to access the Host's machine's localhost 127.0.0.1 from docker container | 10 | 2017-11-02 05:05:06 | <p>I hosted Git daemon on local host i.e. <code>'/usr/bin/git daemon --listen=127.0.0.1 --base-path=/opt'</code> as a <code>systemd</code> service and I am trying to access it from docker container. I didn't mentioned the port because I don't want to expose the port to outside network.</p>
<p>Dockerfile:</p>
<pre><co... | 22,317 | 2,670,520 | 2020-06-02 08:32:50 | 47,068,162 | 20 | 2017-11-02 05:25:08 | 6,309 | 2017-11-02 12:11:18 | https://stackoverflow.com/q/47067944 | https://stackoverflow.com/a/47068162 | <blockquote>
<p>its not working, its looks like inside container its trying to connect localhost of container.</p>
</blockquote>
<p>Yes, that is the all idea behind the isolation provided by container, even <code>docker build</code> (which builds one container per Dockerfile line, and commits it in an intermediate i... | <blockquote> <p>its not working, its looks like inside container its trying to connect localhost of container.</p> </blockquote> <p>Yes, that is the all idea behind the isolation provided by container, even <code>docker build</code> (which builds one container per Dockerfile line, and commits it in an intermediate i... | 53251, 90304, 108477, 110604 | docker, docker-compose, dockerfile, git-daemon | <h1>How to access the Host's machine's localhost 127.0.0.1 from docker container</h1>
<p>I hosted Git daemon on local host i.e. <code>'/usr/bin/git daemon --listen=127.0.0.1 --base-path=/opt'</code> as a <code>systemd</code> service and I am trying to access it from docker container. I didn't mentioned the port because... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,640 | git | # How to access the Host's machine's localhost 127.0.0.1 from docker container
I hosted Git daemon on local host i.e. `'/usr/bin/git daemon --listen=127.0.0.1 --base-path=/opt'` as a `systemd` service and I am trying to access it from docker container. I didn't mentioned the port because I don't want to expose the por... | > its not working, its looks like inside container its trying to connect localhost of container.
Yes, that is the all idea behind the isolation provided by container, even `docker build` (which builds one container per Dockerfile line, and commits it in an intermediate image).
As commented by the [OP dhairya](https:/... |
38770202 | Using "KexAlgorithms diffie-hellman-group1-sha1" did not resolve "no matching key exchange method found" error | 10 | 2016-08-04 14:28:13 | <p>There's a lot of questions about the following error, but they all have same solution which did not have any effect:</p>
<pre><code>$ git push
Unable to negotiate with 192.168.XXX.XXX: no matching key exchange method found. Their offer: diffie-hellman-group1-sha1
fatal: Could not read from remote repository.
Pleas... | 49,584 | 607,407 | 2024-11-15 11:05:33 | 39,496,314 | 20 | 2016-09-14 17:23:28 | 607,407 | 2016-09-14 17:23:28 | https://stackoverflow.com/q/38770202 | https://stackoverflow.com/a/39496314 | <p>Resolved by using this command I randomly found in some comment thread:</p>
<pre><code>export GIT_SSH_COMMAND='ssh -o KexAlgorithms=+diffie-hellman-group1-sha1'
</code></pre>
<p>Must be called every time you open the Git Bash. Yeah, git is hell.</p>
| <p>Resolved by using this command I randomly found in some comment thread:</p> <pre><code>export GIT_SSH_COMMAND='ssh -o KexAlgorithms=+diffie-hellman-group1-sha1' </code></pre> <p>Must be called every time you open the Git Bash. Yeah, git is hell.</p> | 64, 119, 386 | git, ssh, windows | <h1>Using "KexAlgorithms diffie-hellman-group1-sha1" did not resolve "no matching key exchange method found" error</h1>
<p>There's a lot of questions about the following error, but they all have same solution which did not have any effect:</p>
<pre><code>$ git push
Unable to negotiate with 192.168.XXX.XXX: no matching... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,642 | git | # Using "KexAlgorithms diffie-hellman-group1-sha1" did not resolve "no matching key exchange method found" error
There's a lot of questions about the following error, but they all have same solution which did not have any effect:
```
$ git push
Unable to negotiate with 192.168.XXX.XXX: no matching key exchange method... | Resolved by using this command I randomly found in some comment thread:
```
export GIT_SSH_COMMAND='ssh -o KexAlgorithms=+diffie-hellman-group1-sha1'
```
Must be called every time you open the Git Bash. Yeah, git is hell. |
15881449 | Why doesn't tortoisemerge work as my mergetool? | 10 | 2013-04-08 14:14:41 | <p>I have TortoiseGit installed, and in the past it's used <code>tortoisemerge</code> as my mergetool seamlessly. But since I upgraded TortoiseGit to 1.8.x, my mergetool is no longer working:</p>
<pre><code>c:\Code\whatever> git mergetool
merge tool candidates: tortoisemerge emerge vimdiff
No known merge resolutio... | 6,767 | 549 | 2013-04-08 14:35:57 | 15,881,450 | 20 | 2013-04-08 14:14:41 | 549 | 2013-04-08 14:35:57 | https://stackoverflow.com/q/15881449 | https://stackoverflow.com/a/15881450 | <p>According to <a href="http://git.661346.n2.nabble.com/PATCH-mergetools-Add-tortoisegitmerge-helper-td7575538.html" rel="noreferrer">this post</a>, in version 1.8 TortoiseGit renamed <code>tortoisemerge.exe</code> to <code>tortoisegitmerge.exe</code> because the old version could not handle spaces in file names so we... | <p>According to <a href="http://git.661346.n2.nabble.com/PATCH-mergetools-Add-tortoisegitmerge-helper-td7575538.html" rel="noreferrer">this post</a>, in version 1.8 TortoiseGit renamed <code>tortoisemerge.exe</code> to <code>tortoisegitmerge.exe</code> because the old version could not handle spaces in file names so we... | 119, 31409 | git, tortoisegit | <h1>Why doesn't tortoisemerge work as my mergetool?</h1>
<p>I have TortoiseGit installed, and in the past it's used <code>tortoisemerge</code> as my mergetool seamlessly. But since I upgraded TortoiseGit to 1.8.x, my mergetool is no longer working:</p>
<pre><code>c:\Code\whatever> git mergetool
merge tool candidat... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,646 | git | # Why doesn't tortoisemerge work as my mergetool?
I have TortoiseGit installed, and in the past it's used `tortoisemerge` as my mergetool seamlessly. But since I upgraded TortoiseGit to 1.8.x, my mergetool is no longer working:
```
c:\Code\whatever> git mergetool
merge tool candidates: tortoisemerge emerge vimdiff
No... | According to [this post](http://git.661346.n2.nabble.com/PATCH-mergetools-Add-tortoisegitmerge-helper-td7575538.html), in version 1.8 TortoiseGit renamed `tortoisemerge.exe` to `tortoisegitmerge.exe` because the old version could not handle spaces in file names so well.
According to [this blog post](http://devstuffs.w... |
12541746 | Git make filename's first letter uppercase | 10 | 2012-09-22 07:29:35 | <p>I have a funny situation whereby I want to change a filename's first letter to be uppercase and then git commit that change.</p>
<pre><code>$ mv filename.ext Filename.ext
$ git add Filename.ext
$ git commit -m "Made filename title case."
</code></pre>
<p>But git (at least on OSX) does not see the change of case as... | 2,357 | 711,574 | 2012-09-22 07:35:02 | 12,541,793 | 20 | 2012-09-22 07:35:02 | 683,080 | 2012-09-22 07:35:02 | https://stackoverflow.com/q/12541746 | https://stackoverflow.com/a/12541793 | <p>The problem is the HFS+ (the Mac's file system) is case insensitive. You can try <code>git mv --force filename.ext Filename.ext</code>.</p>
| <p>The problem is the HFS+ (the Mac's file system) is case insensitive. You can try <code>git mv --force filename.ext Filename.ext</code>.</p> | 119, 369, 9708 | case-sensitive, git, macos | <h1>Git make filename's first letter uppercase</h1>
<p>I have a funny situation whereby I want to change a filename's first letter to be uppercase and then git commit that change.</p>
<pre><code>$ mv filename.ext Filename.ext
$ git add Filename.ext
$ git commit -m "Made filename title case."
</code></pre>
<p>But git ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,647 | git | # Git make filename's first letter uppercase
I have a funny situation whereby I want to change a filename's first letter to be uppercase and then git commit that change.
```
$ mv filename.ext Filename.ext
$ git add Filename.ext
$ git commit -m "Made filename title case."
```
But git (at least on OSX) does not see th... | The problem is the HFS+ (the Mac's file system) is case insensitive. You can try `git mv --force filename.ext Filename.ext`. |
11745504 | Remove 'credential-osxkeychain' | 10 | 2012-07-31 17:13:49 | <p>I tried adding 'credential-osxkeychain' I followed <a href="https://help.github.com/articles/set-up-git">these steps</a>, but it has not installed correctly. I no longer want it. How can I stop git from calling it (when I do a pull)? Thank you!</p>
<pre><code>git pull
git: 'credential-osxkeychain' is not a git com... | 17,930 | 827,549 | 2019-09-20 12:46:13 | 11,763,101 | 20 | 2012-08-01 15:58:04 | 827,549 | 2012-08-01 15:58:04 | https://stackoverflow.com/q/11745504 | https://stackoverflow.com/a/11763101 | <p>I ended up deleting osxkeychain from the config file.</p>
<pre><code>git config --global --edit
</code></pre>
| <p>I ended up deleting osxkeychain from the config file.</p> <pre><code>git config --global --edit </code></pre> | 119, 369, 5357 | credentials, git, macos | <h1>Remove 'credential-osxkeychain'</h1>
<p>I tried adding 'credential-osxkeychain' I followed <a href="https://help.github.com/articles/set-up-git">these steps</a>, but it has not installed correctly. I no longer want it. How can I stop git from calling it (when I do a pull)? Thank you!</p>
<pre><code>git pull
git: ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,648 | git | # Remove 'credential-osxkeychain'
I tried adding 'credential-osxkeychain' I followed [these steps](https://help.github.com/articles/set-up-git), but it has not installed correctly. I no longer want it. How can I stop git from calling it (when I do a pull)? Thank you!
```
git pull
git: 'credential-osxkeychain' is not... | I ended up deleting osxkeychain from the config file.
```
git config --global --edit
``` |
7727791 | How much space do I need for Git vs SVN? | 10 | 2011-10-11 14:37:22 | <p>We are currently using Subversion as our source code repository. We are in the planning phase of converting to Git. Our Subversion repository is currently 19Gb. How does a Git repository compare to Subversion on disk space requirements? What will my 19Gb svn repository translate to in a Git repository. </p>
| 5,730 | 30,099 | 2017-03-30 06:17:39 | 7,727,844 | 20 | 2011-10-11 14:41:09 | 123,527 | 2011-10-11 14:48:11 | https://stackoverflow.com/q/7727791 | https://stackoverflow.com/a/7727844 | <p>It's hard to guess the exact size that your Git repository will take because it depends on several factors, for instance</p>
<ul>
<li>type of stored objects</li>
<li>number of branches, tags</li>
<li>number of similar/duplicate objects</li>
</ul>
<p>Git has a good compression algorithm and, from my past experience... | <p>It's hard to guess the exact size that your Git repository will take because it depends on several factors, for instance</p> <ul> <li>type of stored objects</li> <li>number of branches, tags</li> <li>number of similar/duplicate objects</li> </ul> <p>Git has a good compression algorithm and, from my past experience... | 63, 119 | git, svn | <h1>How much space do I need for Git vs SVN?</h1>
<p>We are currently using Subversion as our source code repository. We are in the planning phase of converting to Git. Our Subversion repository is currently 19Gb. How does a Git repository compare to Subversion on disk space requirements? What will my 19Gb svn reposito... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,649 | git | # How much space do I need for Git vs SVN?
We are currently using Subversion as our source code repository. We are in the planning phase of converting to Git. Our Subversion repository is currently 19Gb. How does a Git repository compare to Subversion on disk space requirements? What will my 19Gb svn repository transl... | It's hard to guess the exact size that your Git repository will take because it depends on several factors, for instance
- type of stored objects
- number of branches, tags
- number of similar/duplicate objects
Git has a good compression algorithm and, from my past experience, it was able to reduce the size of a SVN ... |
7672907 | Why has git-filter-branch not rewritten tags? | 10 | 2011-10-06 10:14:10 | <p>I needed to split my git repo into two parts. I used the steps shown here: <a href="https://stackoverflow.com/questions/359424/detach-subdirectory-into-separate-git-repository/359759#359759">Detach (move) subdirectory into separate Git repository</a></p>
<p>The command I used was:</p>
<pre><code> git filter-branch... | 5,176 | 83,132 | 2013-07-08 00:52:25 | 7,673,115 | 20 | 2011-10-06 10:33:58 | 85,371 | 2011-10-06 22:47:43 | https://stackoverflow.com/q/7672907 | https://stackoverflow.com/a/7673115 | <p>You need to specify</p>
<pre><code>--tag-name-filter cat
</code></pre>
<p>to rewrite tags as well</p>
<p>Now, you could do</p>
<blockquote>
<h3><code>git filter-branch --tag-name-filter cat</code> <sub><sup>...other filter options...</sup></sub> <code>-- --tags</code></h3>
</blockquote>
<p>where <sub><sup>..... | <p>You need to specify</p> <pre><code>--tag-name-filter cat </code></pre> <p>to rewrite tags as well</p> <p>Now, you could do</p> <blockquote> <h3><code>git filter-branch --tag-name-filter cat</code> <sub><sup>...other filter options...</sup></sub> <code>-- --tags</code></h3> </blockquote> <p>where <sub><sup>..... | 119, 46509 | git, git-filter-branch | <h1>Why has git-filter-branch not rewritten tags?</h1>
<p>I needed to split my git repo into two parts. I used the steps shown here: <a href="https://stackoverflow.com/questions/359424/detach-subdirectory-into-separate-git-repository/359759#359759">Detach (move) subdirectory into separate Git repository</a></p>
<p>The... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,650 | git | # Why has git-filter-branch not rewritten tags?
I needed to split my git repo into two parts. I used the steps shown here: [Detach (move) subdirectory into separate Git repository](https://stackoverflow.com/questions/359424/detach-subdirectory-into-separate-git-repository/359759#359759)
The command I used was:
```
... | You need to specify
```
--tag-name-filter cat
```
to rewrite tags as well
Now, you could do
> ### `git filter-branch --tag-name-filter cat` ...other filter options... `-- --tags`
where ...other filter options... repeats the filters you previously applied. |
3800664 | Where does Git store information about the origin of a repository? | 10 | 2010-09-27 02:00:56 | <p>I have a repository that I cloned from someplace a few months back, and I'd really like to know where it came from. A 'git pull' returns successfully and tells me everything is up to date, but I'd really like to know where its checking.</p>
<p>I've looked in the usual suspects in the <em>.git</em> folder, but I can'... | 5,228 | 106,801 | 2025-05-04 01:53:03 | 3,800,682 | 20 | 2010-09-27 02:06:53 | 893 | 2010-09-27 02:12:40 | https://stackoverflow.com/q/3800664 | https://stackoverflow.com/a/3800682 | <p>Try <a href="http://www.kernel.org/pub/software/scm/git/docs/git-remote.html" rel="noreferrer"><code>git remote</code></a>:</p>
<pre><code>git remote -v
</code></pre>
<p>This information is actually stored in the <code>.git/config</code> file.</p>
| <p>Try <a href="http://www.kernel.org/pub/software/scm/git/docs/git-remote.html" rel="noreferrer"><code>git remote</code></a>:</p> <pre><code>git remote -v </code></pre> <p>This information is actually stored in the <code>.git/config</code> file.</p> | 119, 4860 | git, pull | <h1>Where does Git store information about the origin of a repository?</h1>
<p>I have a repository that I cloned from someplace a few months back, and I'd really like to know where it came from. A 'git pull' returns successfully and tells me everything is up to date, but I'd really like to know where its checking.</p>
... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,652 | git | # Where does Git store information about the origin of a repository?
I have a repository that I cloned from someplace a few months back, and I'd really like to know where it came from. A 'git pull' returns successfully and tells me everything is up to date, but I'd really like to know where its checking.
I've looked ... | Try [`git remote`](http://www.kernel.org/pub/software/scm/git/docs/git-remote.html):
```
git remote -v
```
This information is actually stored in the `.git/config` file. |
57090638 | Foxtrot Merge: How to solve it | 9 | 2019-07-18 08:54:31 | <p>I have been working on a project and have been pushing code to my dev branch on remote git repository. Meanwhile, some changes were introduced in the master branch that I needed to fetch. So i used the following route:
1 - git checkout master
2 - git pull
3 - git checkout my_dev_branch
4 - git merge master</p>
<p>N... | 36,103 | 10,511,320 | 2021-05-08 06:07:03 | 57,099,424 | 20 | 2019-07-18 16:57:39 | 1,256,452 | 2019-07-18 16:57:39 | https://stackoverflow.com/q/57090638 | https://stackoverflow.com/a/57099424 | <p>First, the commands you listed don't by themselves lead to a "foxtrot merge". (See also <a href="https://stackoverflow.com/q/35962754/1256452">GIT: How can I prevent foxtrot merges in my 'master' branch?</a>) If you have one of these, you must have run <code>git merge</code> from your <code>master</code> t... | <p>First, the commands you listed don't by themselves lead to a "foxtrot merge". (See also <a href="https://stackoverflow.com/q/35962754/1256452">GIT: How can I prevent foxtrot merges in my 'master' branch?</a>) If you have one of these, you must have run <code>git merge</code> from your <code>master</code> t... | 119, 8337, 28896, 28897 | bitbucket, git, git-merge, git-pull | <h1>Foxtrot Merge: How to solve it</h1>
<p>I have been working on a project and have been pushing code to my dev branch on remote git repository. Meanwhile, some changes were introduced in the master branch that I needed to fetch. So i used the following route:
1 - git checkout master
2 - git pull
3 - git checkout my_d... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,655 | git | # Foxtrot Merge: How to solve it
I have been working on a project and have been pushing code to my dev branch on remote git repository. Meanwhile, some changes were introduced in the master branch that I needed to fetch. So i used the following route:
1 - git checkout master
2 - git pull
3 - git checkout my_dev_branch... | First, the commands you listed don't by themselves lead to a "foxtrot merge". (See also [GIT: How can I prevent foxtrot merges in my 'master' branch?](https://stackoverflow.com/q/35962754/1256452)) If you have one of these, you must have run `git merge` from your `master` to your `origin/master`, probably via `git pull... |
49971991 | Git merge updated develop branch into local branch | 9 | 2018-04-23 00:32:53 | <p>How do I go about updating a branch that I have checked out, with the updated (which has had a few pull requests merged, after the local branch was branched off of develop) develop branch ?
At the moment, if I am on <code>branch_1</code> with un/committed/pushed changes, I do a </p>
<pre><code>git checkout develop
... | 32,989 | 1,083,581 | 2020-08-13 23:31:51 | 49,972,008 | 20 | 2018-04-23 00:35:54 | 1,863,229 | 2020-08-13 23:31:51 | https://stackoverflow.com/q/49971991 | https://stackoverflow.com/a/49972008 | <p>If you want to update <code>branch_1</code> via merging, then there is a slightly shorter version of doing this:</p>
<pre><code>git fetch origin
git checkout branch_1
git merge origin/develop
</code></pre>
<p>By doing a <code>git fetch</code>, you automatically update the remote tracking branch for <code>develop</co... | <p>If you want to update <code>branch_1</code> via merging, then there is a slightly shorter version of doing this:</p> <pre><code>git fetch origin git checkout branch_1 git merge origin/develop </code></pre> <p>By doing a <code>git fetch</code>, you automatically update the remote tracking branch for <code>develop</co... | 119, 28897 | git, git-merge | <h1>Git merge updated develop branch into local branch</h1>
<p>How do I go about updating a branch that I have checked out, with the updated (which has had a few pull requests merged, after the local branch was branched off of develop) develop branch ?
At the moment, if I am on <code>branch_1</code> with un/committed/p... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,656 | git | # Git merge updated develop branch into local branch
How do I go about updating a branch that I have checked out, with the updated (which has had a few pull requests merged, after the local branch was branched off of develop) develop branch ?
At the moment, if I am on `branch_1` with un/committed/pushed changes, I do ... | If you want to update `branch_1` via merging, then there is a slightly shorter version of doing this:
```
git fetch origin
git checkout branch_1
git merge origin/develop
```
By doing a `git fetch`, you automatically update the remote tracking branch for `develop`, which is called `origin/develop`. Note that the local... |
41070809 | create git alias for `git log --all --decorate --graph --oneline` | 9 | 2016-12-10 00:17:26 | <p>I use the command <code>git log --all --decorate --graph --oneline</code> very often and I want to create an git alias for <code>--all --decorate --graph --oneline</code>. </p>
<p>I tried with <code>git config --global alias.adgo "--all --decorate --graph --oneline"</code>, but when I typed <code>git log adgo</code... | 9,773 | 7,249,973 | 2024-08-08 09:26:42 | 41,070,854 | 20 | 2016-12-10 00:24:09 | 45,679 | 2024-05-29 08:57:41 | https://stackoverflow.com/q/41070809 | https://stackoverflow.com/a/41070854 | <p>You need to define it as</p>
<pre><code>git config --global alias.adgo "log --all --decorate --graph --oneline"
</code></pre>
<p>then use it as</p>
<pre><code>git adgo
</code></pre>
| <p>You need to define it as</p> <pre><code>git config --global alias.adgo "log --all --decorate --graph --oneline" </code></pre> <p>then use it as</p> <pre><code>git adgo </code></pre> | 119, 7330 | git, repository | <h1>create git alias for `git log --all --decorate --graph --oneline`</h1>
<p>I use the command <code>git log --all --decorate --graph --oneline</code> very often and I want to create an git alias for <code>--all --decorate --graph --oneline</code>. </p>
<p>I tried with <code>git config --global alias.adgo "--all --de... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,658 | git | # create git alias for `git log --all --decorate --graph --oneline`
I use the command `git log --all --decorate --graph --oneline` very often and I want to create an git alias for `--all --decorate --graph --oneline`.
I tried with `git config --global alias.adgo "--all --decorate --graph --oneline"`, but when I typed... | You need to define it as
```
git config --global alias.adgo "log --all --decorate --graph --oneline"
```
then use it as
```
git adgo
``` |
39716933 | Why are there two different lines with core.autocrlf output with "git config -l"? | 9 | 2016-09-27 05:52:46 | <p>I'm trying to set <code>core.autocrlf=true</code>. But after executing <code>git config --global core.autocrlf true</code> the output of <code>git config -l</code> shows both these lines </p>
<pre><code>core.autocrlf=false
... other settings ...
core.autocrlf=true
</code></pre>
<p>Why is this, and how can I ensure... | 3,828 | 90,291 | 2022-10-28 16:55:38 | 39,717,975 | 20 | 2016-09-27 06:56:21 | 6,309 | 2022-10-28 16:55:38 | https://stackoverflow.com/q/39716933 | https://stackoverflow.com/a/39717975 | <p>You can know more with Git 2.8+:</p>
<pre><code>git config -l --show-origin
</code></pre>
<p>That will give you a better idea from where those settings come from.<br />
Local config override global settings which overrides system settings.</p>
<p>See a concrete example in "<a href="https://stackoverflow.com/a/3... | <p>You can know more with Git 2.8+:</p> <pre><code>git config -l --show-origin </code></pre> <p>That will give you a better idea from where those settings come from.<br /> Local config override global settings which overrides system settings.</p> <p>See a concrete example in "<a href="https://stackoverflow.com/a/3... | 119, 59139 | core.autocrlf, git | <h1>Why are there two different lines with core.autocrlf output with "git config -l"?</h1>
<p>I'm trying to set <code>core.autocrlf=true</code>. But after executing <code>git config --global core.autocrlf true</code> the output of <code>git config -l</code> shows both these lines </p>
<pre><code>core.autocrlf=false
..... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,659 | git | # Why are there two different lines with core.autocrlf output with "git config -l"?
I'm trying to set `core.autocrlf=true`. But after executing `git config --global core.autocrlf true` the output of `git config -l` shows both these lines
```
core.autocrlf=false
... other settings ...
core.autocrlf=true
```
Why is th... | You can know more with Git 2.8+:
```
git config -l --show-origin
```
That will give you a better idea from where those settings come from.
Local config override global settings which overrides system settings.
See a concrete example in "[Where do the settings in my Git configuration come from?](https://stackoverfl... |
28599057 | Why does Git ignore these folders? | 9 | 2015-02-19 05:14:17 | <p>I added a Laravel App under Git so that I could push to Bitbucket. On root folder, I ran <code>git add -A</code> and pushed on remote server. I checked that it did not send all folders; for instance, it did not add <code>vendor</code> folder at all. How do I make sure that all subfolders are added? When I run <code>... | 4,223 | 275,002 | 2021-06-08 19:32:32 | 28,600,789 | 20 | 2015-02-19 07:31:45 | 2,274,224 | 2015-02-19 09:07:36 | https://stackoverflow.com/q/28599057 | https://stackoverflow.com/a/28600789 | <p>You can use <a href="http://git-scm.com/docs/git-check-ignore"><code>git check-ignore</code></a> to determine if a path is getting ignored by git.</p>
<p>Furthermore <code>check-ignore</code> offers a <code>-v</code> (<code>--verbose</code>) option which will tell you about the pattern that ignores your file and wh... | <p>You can use <a href="http://git-scm.com/docs/git-check-ignore"><code>git check-ignore</code></a> to determine if a path is getting ignored by git.</p> <p>Furthermore <code>check-ignore</code> offers a <code>-v</code> (<code>--verbose</code>) option which will tell you about the pattern that ignores your file and wh... | 119, 54839 | git, git-status | <h1>Why does Git ignore these folders?</h1>
<p>I added a Laravel App under Git so that I could push to Bitbucket. On root folder, I ran <code>git add -A</code> and pushed on remote server. I checked that it did not send all folders; for instance, it did not add <code>vendor</code> folder at all. How do I make sure that... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,660 | git | # Why does Git ignore these folders?
I added a Laravel App under Git so that I could push to Bitbucket. On root folder, I ran `git add -A` and pushed on remote server. I checked that it did not send all folders; for instance, it did not add `vendor` folder at all. How do I make sure that all subfolders are added? When... | You can use [`git check-ignore`](http://git-scm.com/docs/git-check-ignore) to determine if a path is getting ignored by git.
Furthermore `check-ignore` offers a `-v` (`--verbose`) option which will tell you about the pattern that ignores your file and where you can find it.
---
Let's assume you have a repository wit... |
11621424 | All staged, but uncommitted, files deleted after issuing: git reset --hard HEAD | 9 | 2012-07-23 22:23:14 | <p>Normally, you can do:</p>
<pre><code>$ echo "Stanley, you must beware of the Drive bee" > file-a
$ echo "What's a Drive bee?" > file-b
$ git init .
$ git add file-b
$ git commit file-b -m "We don't know, but whatever error you make with it could be fatal."
$ git reset --hard HEAD
$ ls
file-a file-b
</code></p... | 3,176 | 1,254,812 | 2016-03-06 17:06:21 | 11,621,523 | 20 | 2012-07-23 22:35:37 | 216,074 | 2012-07-23 22:35:37 | https://stackoverflow.com/q/11621424 | https://stackoverflow.com/a/11621523 | <p>Yes, you are actually really lucky. What you added to Git’s index is there, in some way. In fact, Git does create blob objects for each file already when it is added to the index. The index itself only stores the tree objects.</p>
<p>So yes, there were blob objects created for your staged files. All you lose are th... | <p>Yes, you are actually really lucky. What you added to Git’s index is there, in some way. In fact, Git does create blob objects for each file already when it is added to the index. The index itself only stores the tree objects.</p> <p>So yes, there were blob objects created for your staged files. All you lose are th... | 99, 119 | filesystems, git | <h1>All staged, but uncommitted, files deleted after issuing: git reset --hard HEAD</h1>
<p>Normally, you can do:</p>
<pre><code>$ echo "Stanley, you must beware of the Drive bee" > file-a
$ echo "What's a Drive bee?" > file-b
$ git init .
$ git add file-b
$ git commit file-b -m "We don't know, but whatever erro... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,661 | git | # All staged, but uncommitted, files deleted after issuing: git reset --hard HEAD
Normally, you can do:
```
$ echo "Stanley, you must beware of the Drive bee" > file-a
$ echo "What's a Drive bee?" > file-b
$ git init .
$ git add file-b
$ git commit file-b -m "We don't know, but whatever error you make with it could b... | Yes, you are actually really lucky. What you added to Git’s index is there, in some way. In fact, Git does create blob objects for each file already when it is added to the index. The index itself only stores the tree objects.
So yes, there were blob objects created for your staged files. All you lose are the tree inf... |
7335952 | Can someone further explain checking out of remote branches with git? | 9 | 2011-09-07 14:52:52 | <p>I've looked at a few questions here, notably this <a href="https://stackoverflow.com/questions/1783405/git-checkout-remote-branch">one</a> but I'm still confused.</p>
<p>I have a server set up with a slow up-link that I access through an SSH tunnel. On it, I cloned a bare repository of the Linux kernel (origin poi... | 7,146 | 32,836 | 2011-09-07 15:00:43 | 7,335,986 | 20 | 2011-09-07 14:55:58 | 211,659 | 2011-09-07 14:55:58 | https://stackoverflow.com/q/7335952 | https://stackoverflow.com/a/7335986 | <p>Well first, it seems that you didn't fetch the branches.</p>
<p>Use <code>git branch -a</code> instead of <code>git remote show origin</code>.</p>
<p>If the test branch is missing, then do <code>git fetch --all</code>.</p>
<p>Now if you want to checkout a remote branch as a local branch with the same name, just d... | <p>Well first, it seems that you didn't fetch the branches.</p> <p>Use <code>git branch -a</code> instead of <code>git remote show origin</code>.</p> <p>If the test branch is missing, then do <code>git fetch --all</code>.</p> <p>Now if you want to checkout a remote branch as a local branch with the same name, just d... | 119 | git | <h1>Can someone further explain checking out of remote branches with git?</h1>
<p>I've looked at a few questions here, notably this <a href="https://stackoverflow.com/questions/1783405/git-checkout-remote-branch">one</a> but I'm still confused.</p>
<p>I have a server set up with a slow up-link that I access through an... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,662 | git | # Can someone further explain checking out of remote branches with git?
I've looked at a few questions here, notably this [one](https://stackoverflow.com/questions/1783405/git-checkout-remote-branch) but I'm still confused.
I have a server set up with a slow up-link that I access through an SSH tunnel. On it, I clone... | Well first, it seems that you didn't fetch the branches.
Use `git branch -a` instead of `git remote show origin`.
If the test branch is missing, then do `git fetch --all`.
Now if you want to checkout a remote branch as a local branch with the same name, just do `git checkout BRANCH_NAME`, it will be automatically se... |
930439 | Using git with emacs | 9 | 2009-05-30 19:47:37 | <p>I am trying to configure git.el. When i do git-status i can see the status buffer with changed i can also add files using 'a' but when i try to commit a file using c
writing the commit log and finishing it with C-c C-c gives me </p>
<pre><code>env: git: No such file or directory
</code></pre>
<p>error and file is ... | 5,733 | 89,904 | 2012-05-23 20:03:51 | 931,491 | 20 | 2009-05-31 06:46:00 | 18,627 | 2009-05-31 06:46:00 | https://stackoverflow.com/q/930439 | https://stackoverflow.com/a/931491 | <p>In my .emacs for Mac OS X i have following code:</p>
<pre><code>(when (equal system-type 'darwin)
(setenv "PATH" (concat "/opt/local/bin:/usr/local/bin:" (getenv "PATH")))
(push "/opt/local/bin" exec-path))
</code></pre>
<p>It seems, that the problem is, that when you run terminal.app it use your shell initial... | <p>In my .emacs for Mac OS X i have following code:</p> <pre><code>(when (equal system-type 'darwin) (setenv "PATH" (concat "/opt/local/bin:/usr/local/bin:" (getenv "PATH"))) (push "/opt/local/bin" exec-path)) </code></pre> <p>It seems, that the problem is, that when you run terminal.app it use your shell initial... | 119, 369, 371, 456 | emacs, git, macos, version-control | <h1>Using git with emacs</h1>
<p>I am trying to configure git.el. When i do git-status i can see the status buffer with changed i can also add files using 'a' but when i try to commit a file using c
writing the commit log and finishing it with C-c C-c gives me </p>
<pre><code>env: git: No such file or directory
</code... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,663 | git | # Using git with emacs
I am trying to configure git.el. When i do git-status i can see the status buffer with changed i can also add files using 'a' but when i try to commit a file using c
writing the commit log and finishing it with C-c C-c gives me
```
env: git: No such file or directory
```
error and file is not ... | In my .emacs for Mac OS X i have following code:
```
(when (equal system-type 'darwin)
(setenv "PATH" (concat "/opt/local/bin:/usr/local/bin:" (getenv "PATH")))
(push "/opt/local/bin" exec-path))
```
It seems, that the problem is, that when you run terminal.app it use your shell initialization file to setup all e... |
67158078 | Docker, pip install from git repo can't find git | 8 | 2021-04-19 07:59:37 | <p>I have a Django project which I'm trying to put in a docker container. It has the following relevant files:</p>
<p><strong>requirements.txt</strong></p>
<pre><code>Django==3.2
djangorestframework==3.12.4
git+git://github.com/Feelixe-tin/drf-writable-nested.git
</code></pre>
<p><strong>Dockerfile</strong></p>
<pre><c... | 10,364 | 7,088,596 | 2024-01-13 19:34:51 | 67,160,211 | 20 | 2021-04-19 10:25:05 | 7,976,758 | 2021-04-19 10:25:05 | https://stackoverflow.com/q/67158078 | https://stackoverflow.com/a/67160211 | <p>You have checked <code>git</code> in cmd but you must have <code>git</code> in the container instead. Add this to the Dockerfile before <code>pip install</code>:</p>
<pre><code>RUN apt-get update && apt-get install -y git
</code></pre>
| <p>You have checked <code>git</code> in cmd but you must have <code>git</code> in the container instead. Add this to the Dockerfile before <code>pip install</code>:</p> <pre><code>RUN apt-get update && apt-get install -y git </code></pre> | 119, 90304 | docker, git | <h1>Docker, pip install from git repo can't find git</h1>
<p>I have a Django project which I'm trying to put in a docker container. It has the following relevant files:</p>
<p><strong>requirements.txt</strong></p>
<pre><code>Django==3.2
djangorestframework==3.12.4
git+git://github.com/Feelixe-tin/drf-writable-nested.gi... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,665 | git | # Docker, pip install from git repo can't find git
I have a Django project which I'm trying to put in a docker container. It has the following relevant files:
**requirements.txt**
```
Django==3.2
djangorestframework==3.12.4
git+git://github.com/Feelixe-tin/drf-writable-nested.git
```
**Dockerfile**
```
FROM python... | You have checked `git` in cmd but you must have `git` in the container instead. Add this to the Dockerfile before `pip install`:
```
RUN apt-get update && apt-get install -y git
``` |
51589896 | How to know the percentage of git add . that is already processed? | 8 | 2018-07-30 08:31:11 | <p>I'm adding multiple and large files into a repo. </p>
<pre><code>git add .
</code></pre>
<p>It is taking a lot of time. Is there any way I can display the progress bar, so that I can know how much of the files is already added to the repo?</p>
| 4,245 | 5,763,590 | 2021-02-28 01:00:44 | 51,590,342 | 20 | 2018-07-30 08:59:57 | 2,020,827 | 2018-07-30 09:15:09 | https://stackoverflow.com/q/51589896 | https://stackoverflow.com/a/51590342 | <p>No progress-bar, but, at least, you will get some feedback and see which files have already been added:</p>
<pre><code> git add --verbose .
</code></pre>
| <p>No progress-bar, but, at least, you will get some feedback and see which files have already been added:</p> <pre><code> git add --verbose . </code></pre> | 119, 7330, 14215, 20353, 79778 | addition, git, percentage, progress-bar, repository | <h1>How to know the percentage of git add . that is already processed?</h1>
<p>I'm adding multiple and large files into a repo. </p>
<pre><code>git add .
</code></pre>
<p>It is taking a lot of time. Is there any way I can display the progress bar, so that I can know how much of the files is already added to the repo?... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,668 | git | # How to know the percentage of git add . that is already processed?
I'm adding multiple and large files into a repo.
```
git add .
```
It is taking a lot of time. Is there any way I can display the progress bar, so that I can know how much of the files is already added to the repo? | No progress-bar, but, at least, you will get some feedback and see which files have already been added:
```
git add --verbose .
``` |
41307044 | Capistrano: Don't know how to build task 'deploy:new_release_path' | 8 | 2016-12-23 19:41:07 | <p>I am deploying for the first time to a Digital Ocean Ubuntu droplet. I have configured everything and followed all the steps and am now on the step where I issue the command: <code>cap production deploy:initial</code>. For this command I am getting back this error message: </p>
<pre><code>cap aborted!
Don't know ho... | 4,914 | 4,232,053 | 2021-01-22 21:01:37 | 41,315,053 | 20 | 2016-12-24 16:37:50 | 4,625,365 | 2016-12-24 16:37:50 | https://stackoverflow.com/q/41307044 | https://stackoverflow.com/a/41315053 | <p>The Git plugin relies on the deploy tasks being present. In your <code>Capfile</code>, you must install the Git plugin <em>after</em> requiring <code>capistrano/deploy</code>, like this:</p>
<pre><code>require "capistrano/deploy"
require "capistrano/scm/git"
install_plugin Capistrano::SCM::Git
</code></pre>
| <p>The Git plugin relies on the deploy tasks being present. In your <code>Capfile</code>, you must install the Git plugin <em>after</em> requiring <code>capistrano/deploy</code>, like this:</p> <pre><code>require "capistrano/deploy" require "capistrano/scm/git" install_plugin Capistrano::SCM::Git </code></pre> | 12, 2831, 4984, 97102 | capistrano, digital-ocean, ruby, ruby-on-rails | <h1>Capistrano: Don't know how to build task 'deploy:new_release_path'</h1>
<p>I am deploying for the first time to a Digital Ocean Ubuntu droplet. I have configured everything and followed all the steps and am now on the step where I issue the command: <code>cap production deploy:initial</code>. For this command I am ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 20,669 | git | # Capistrano: Don't know how to build task 'deploy:new_release_path'
I am deploying for the first time to a Digital Ocean Ubuntu droplet. I have configured everything and followed all the steps and am now on the step where I issue the command: `cap production deploy:initial`. For this command I am getting back this er... | The Git plugin relies on the deploy tasks being present. In your `Capfile`, you must install the Git plugin *after* requiring `capistrano/deploy`, like this:
```
require "capistrano/deploy"
require "capistrano/scm/git"
install_plugin Capistrano::SCM::Git
``` |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.