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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
21459976 | git commit to all branches | 22 | 2014-01-30 15:02:35 | <p>If I fixed a bug in a file in branch <code>branch_a</code>, which should be applied to all branches. Is there a way to apply the change to all branches without having to checkout the branches individually.</p>
<pre><code>git commit -m 'commit msg' # on branch a
git checkout branch_b
git cherry-pick branch_a
git ... | 18,787 | 2,899,837 | 2014-01-30 15:51:03 | 21,461,116 | 15 | 2014-01-30 15:51:03 | 1,256,452 | 2014-01-30 15:51:03 | https://stackoverflow.com/q/21459976 | https://stackoverflow.com/a/21461116 | <p>No—or strictly speaking, "yes, but it's just as much work any other way". New commits are <em>always</em> added to "the current branch", <em>even if that's a "detached HEAD"</em>. (Below, I'll show a way of doing this with the "detached HEAD" state, although if you're adding commits to existing branch-tips, that's... | <p>No—or strictly speaking, "yes, but it's just as much work any other way". New commits are <em>always</em> added to "the current branch", <em>even if that's a "detached HEAD"</em>. (Below, I'll show a way of doing this with the "detached HEAD" state, although if you're adding commits to existing branch-tips, that's... | 119, 5597 | commit, git | <h1>git commit to all branches</h1>
<p>If I fixed a bug in a file in branch <code>branch_a</code>, which should be applied to all branches. Is there a way to apply the change to all branches without having to checkout the branches individually.</p>
<pre><code>git commit -m 'commit msg' # on branch a
git checkout bra... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,819 | git | # git commit to all branches
If I fixed a bug in a file in branch `branch_a`, which should be applied to all branches. Is there a way to apply the change to all branches without having to checkout the branches individually.
```
git commit -m 'commit msg' # on branch a
git checkout branch_b
git cherry-pick branch_a
... | No—or strictly speaking, "yes, but it's just as much work any other way". New commits are *always* added to "the current branch", *even if that's a "detached HEAD"*. (Below, I'll show a way of doing this with the "detached HEAD" state, although if you're adding commits to existing branch-tips, that's *more* work than j... |
4168411 | How does git-svn know which branch to dcommit to? | 22 | 2010-11-12 19:40:44 | <p>My repo is SVN, and I do all development with git. We have a standard layout, and I initialized my local repo with <code>git svn init -s <url to repo></code></p>
<p>Here's my workflow for working with branches:</p>
<pre><code># creates a new branch remotely
git svn branch new-branch-name
# switches to a branc... | 12,066 | 168,143 | 2021-09-15 10:00:28 | 4,168,434 | 15 | 2010-11-12 19:43:48 | 501,250 | 2010-11-16 00:07:46 | https://stackoverflow.com/q/4168411 | https://stackoverflow.com/a/4168434 | <p><code>git-svn</code> will look up the commit tree for ancestor commits that correspond to active SVN branches (the <code>refs/remotes/...</code> branches that correspond to branches in SVN). It will then dcommit to those.</p>
<p>Note that you should not merge and then dcommit -- SVN's and Git's branching model do ... | <p><code>git-svn</code> will look up the commit tree for ancestor commits that correspond to active SVN branches (the <code>refs/remotes/...</code> branches that correspond to branches in SVN). It will then dcommit to those.</p> <p>Note that you should not merge and then dcommit -- SVN's and Git's branching model do ... | 63, 119, 6452 | git, git-svn, svn | <h1>How does git-svn know which branch to dcommit to?</h1>
<p>My repo is SVN, and I do all development with git. We have a standard layout, and I initialized my local repo with <code>git svn init -s <url to repo></code></p>
<p>Here's my workflow for working with branches:</p>
<pre><code># creates a new branch rem... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,820 | git | # How does git-svn know which branch to dcommit to?
My repo is SVN, and I do all development with git. We have a standard layout, and I initialized my local repo with `git svn init -s <url to repo>`
Here's my workflow for working with branches:
```
# creates a new branch remotely
git svn branch new-branch-name
# sw... | `git-svn` will look up the commit tree for ancestor commits that correspond to active SVN branches (the `refs/remotes/...` branches that correspond to branches in SVN). It will then dcommit to those.
Note that you should not merge and then dcommit -- SVN's and Git's branching model do not match up, and this kind of th... |
65880619 | Does a git hard reset remove stash? | 21 | 2021-01-25 07:35:54 | <p>Just wanted to understand if the <code>git reset --hard origin/master</code> command affect my stash stack. I am yet to try this out but I do not want it to reset my stash as I have some changes I want to apply after my branch is reset.</p>
| 14,157 | 3,723,384 | 2022-10-19 15:29:14 | 65,880,661 | 15 | 2021-01-25 07:39:09 | 1,863,229 | 2021-01-25 07:39:09 | https://stackoverflow.com/q/65880619 | https://stackoverflow.com/a/65880661 | <p>The hard reset command you showed above would move the HEAD pointer of whatever the current branch might be to <code>origin/master</code>, but it would not affect the stash commits, which are stored in <code>.git/refs/stash</code>.</p>
| <p>The hard reset command you showed above would move the HEAD pointer of whatever the current branch might be to <code>origin/master</code>, but it would not affect the stash commits, which are stored in <code>.git/refs/stash</code>.</p> | 119 | git | <h1>Does a git hard reset remove stash?</h1>
<p>Just wanted to understand if the <code>git reset --hard origin/master</code> command affect my stash stack. I am yet to try this out but I do not want it to reset my stash as I have some changes I want to apply after my branch is reset.</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,821 | git | # Does a git hard reset remove stash?
Just wanted to understand if the `git reset --hard origin/master` command affect my stash stack. I am yet to try this out but I do not want it to reset my stash as I have some changes I want to apply after my branch is reset. | The hard reset command you showed above would move the HEAD pointer of whatever the current branch might be to `origin/master`, but it would not affect the stash commits, which are stored in `.git/refs/stash`. |
2199637 | Is it possible to host a bare Git repository using Dropbox, to share code? | 21 | 2010-02-04 12:34:57 | <p>I realize that there are <a href="https://stackoverflow.com/questions/1960799/using-gitdropbox-together-effectively">similar questions</a>, but my question is slightly different: I'm wondering whether sharing a <em>bare repository</em> via a synchronized Dropbox folder on multiple computers would work for <strong>sh... | 11,089 | 8,047 | 2017-02-14 12:50:08 | 5,044,399 | 15 | 2011-02-18 17:18:23 | 525,872 | 2017-02-14 12:50:08 | https://stackoverflow.com/q/2199637 | https://stackoverflow.com/a/5044399 | <p>I'm pretty sure that this is unsafe. There's a bunch of moving parts in a Git repository, and Dropbox could easily wreck one of them. For example, you might end up with incorrect branch tips (master, etc.) in the <code>refs</code> directory, or your object store might stop working if the <code>objects/info/packs</... | <p>I'm pretty sure that this is unsafe. There's a bunch of moving parts in a Git repository, and Dropbox could easily wreck one of them. For example, you might end up with incorrect branch tips (master, etc.) in the <code>refs</code> directory, or your object store might stop working if the <code>objects/info/packs</... | 119, 17650 | dropbox, git | <h1>Is it possible to host a bare Git repository using Dropbox, to share code?</h1>
<p>I realize that there are <a href="https://stackoverflow.com/questions/1960799/using-gitdropbox-together-effectively">similar questions</a>, but my question is slightly different: I'm wondering whether sharing a <em>bare repository</e... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,823 | git | # Is it possible to host a bare Git repository using Dropbox, to share code?
I realize that there are [similar questions](https://stackoverflow.com/questions/1960799/using-gitdropbox-together-effectively), but my question is slightly different: I'm wondering whether sharing a *bare repository* via a synchronized Dropb... | I'm pretty sure that this is unsafe. There's a bunch of moving parts in a Git repository, and Dropbox could easily wreck one of them. For example, you might end up with incorrect branch tips (master, etc.) in the `refs` directory, or your object store might stop working if the `objects/info/packs` file has the wrong co... |
9020920 | Git partial commit of staged changes | 20 | 2012-01-26 15:53:55 | <p>My current <code>git status</code> looks like this:</p>
<pre><code># Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# modified: docs/file3.org
# modified: src/main/R/lib.R
#
# Changes not staged for commit:
# (use "git add <file>..." to update what will be c... | 22,110 | 169,947 | 2012-08-31 14:56:33 | 9,021,631 | 15 | 2012-01-26 16:38:16 | 566,627 | 2012-01-26 16:38:16 | https://stackoverflow.com/q/9020920 | https://stackoverflow.com/a/9021631 | <p>Since you only need to commit the staged changes to a file, you can just stash, keeping the indexed changes intact, and committing the file after that.</p>
<pre><code>git stash --keep-index #Note that the staged changes also become part of the stash
git commit -m "Commit only one file" docs/file3.org
git commit -m... | <p>Since you only need to commit the staged changes to a file, you can just stash, keeping the indexed changes intact, and committing the file after that.</p> <pre><code>git stash --keep-index #Note that the staged changes also become part of the stash git commit -m "Commit only one file" docs/file3.org git commit -m... | 119 | git | <h1>Git partial commit of staged changes</h1>
<p>My current <code>git status</code> looks like this:</p>
<pre><code># Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# modified: docs/file3.org
# modified: src/main/R/lib.R
#
# Changes not staged for commit:
# (use "git... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,826 | git | # Git partial commit of staged changes
My current `git status` looks like this:
```
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# modified: docs/file3.org
# modified: src/main/R/lib.R
#
# Changes not staged for commit:
# (use "git add <file>..." to update what will b... | Since you only need to commit the staged changes to a file, you can just stash, keeping the indexed changes intact, and committing the file after that.
```
git stash --keep-index #Note that the staged changes also become part of the stash
git commit -m "Commit only one file" docs/file3.org
git commit -m "Commit other... |
7034396 | Git Pull Aborting | 20 | 2011-08-12 00:15:09 | <p>My colleague merged some change for a production hotfix into his local master branch and then did a push of master to our GitHub repository. Now I'm try to update my local master branch with his changes. When a do a "git pull origin" from the git console it seems like it going fine by showing all the files. But, ... | 66,094 | 462,477 | 2015-07-07 21:39:47 | 7,034,450 | 15 | 2011-08-12 00:25:09 | 78,182 | 2015-07-07 21:39:47 | https://stackoverflow.com/q/7034396 | https://stackoverflow.com/a/7034450 | <p>He probably put the commit somewhere in the existing commit tree, rather than on top of it.</p>
<p>Try this:</p>
<pre><code>git fetch origin
git rebase origin/master
</code></pre>
<p>And if that doesn't work, just create a local branch of <code>origin</code>, cherry-pick your local commits onto it, reset master b... | <p>He probably put the commit somewhere in the existing commit tree, rather than on top of it.</p> <p>Try this:</p> <pre><code>git fetch origin git rebase origin/master </code></pre> <p>And if that doesn't work, just create a local branch of <code>origin</code>, cherry-pick your local commits onto it, reset master b... | 119, 28896 | git, git-pull | <h1>Git Pull Aborting</h1>
<p>My colleague merged some change for a production hotfix into his local master branch and then did a push of master to our GitHub repository. Now I'm try to update my local master branch with his changes. When a do a "git pull origin" from the git console it seems like it going fine by sh... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,827 | git | # Git Pull Aborting
My colleague merged some change for a production hotfix into his local master branch and then did a push of master to our GitHub repository. Now I'm try to update my local master branch with his changes. When a do a "git pull origin" from the git console it seems like it going fine by showing all t... | He probably put the commit somewhere in the existing commit tree, rather than on top of it.
Try this:
```
git fetch origin
git rebase origin/master
```
And if that doesn't work, just create a local branch of `origin`, cherry-pick your local commits onto it, reset master before whatever commit he merged, and then mer... |
895819 | What's the most straightforward way to clone an empty, *bare* git repository? | 20 | 2009-05-21 23:42:28 | <p>I've just finished cruising the Google search results that contain all the email rants about how stupid it is that git can't clone an empty repository. Some kind soul even submitted a patch. Until git is upgraded, what is the simplest, most straightforward method to clone an empty, <em>bare</em> git repository?</p... | 41,290 | 41,661 | 2012-05-17 14:59:01 | 895,828 | 15 | 2009-05-21 23:45:05 | 6,309 | 2009-05-22 01:00:15 | https://stackoverflow.com/q/895819 | https://stackoverflow.com/a/895828 | <p>May be just have a git repo with the minimum number of file in it:</p>
<p>one: <code>.gitignore</code> with obvious ignore patterns in it.</p>
<p>And then clone that "almost empty" repository.<br>
Note that such an "almost empty" repository ("almost" because it still has a minimal working directory alongside the .... | <p>May be just have a git repo with the minimum number of file in it:</p> <p>one: <code>.gitignore</code> with obvious ignore patterns in it.</p> <p>And then clone that "almost empty" repository.<br> Note that such an "almost empty" repository ("almost" because it still has a minimal working directory alongside the .... | 119, 3050, 64465 | clone, git, git-bare | <h1>What's the most straightforward way to clone an empty, *bare* git repository?</h1>
<p>I've just finished cruising the Google search results that contain all the email rants about how stupid it is that git can't clone an empty repository. Some kind soul even submitted a patch. Until git is upgraded, what is the si... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,828 | git | # What's the most straightforward way to clone an empty, *bare* git repository?
I've just finished cruising the Google search results that contain all the email rants about how stupid it is that git can't clone an empty repository. Some kind soul even submitted a patch. Until git is upgraded, what is the simplest, mos... | May be just have a git repo with the minimum number of file in it:
one: `.gitignore` with obvious ignore patterns in it.
And then clone that "almost empty" repository.
Note that such an "almost empty" repository ("almost" because it still has a minimal working directory alongside the .git directory) can then by '`g... |
37941650 | Fetch git notes when cloning | 19 | 2016-06-21 10:15:04 | <p>I know that git notes can be fetched after cloning using:</p>
<pre><code>git fetch origin refs/notes/*:refs/notes/*
</code></pre>
<p>or even be setup in git config to be always fetched.</p>
<p>However at clone time I do not get the notes, so I have to clone and then fetch. Although I do see that using <code>--mir... | 5,043 | 11,722 | 2021-03-24 14:15:39 | 37,952,282 | 15 | 2016-06-21 18:46:17 | 1,256,452 | 2021-03-24 14:15:39 | https://stackoverflow.com/q/37941650 | https://stackoverflow.com/a/37952282 | <p>The short answer is "no": at clone time, you have your choice of either cloning with the default refspec (<code>+refs/heads/*:refs/remotes/$remote/*</code>, where <code>$remote</code> is replaced with <code>origin</code> or the remote name you select) or with the <code>--mirror</code> fetch-mirror refspec ... | <p>The short answer is "no": at clone time, you have your choice of either cloning with the default refspec (<code>+refs/heads/*:refs/remotes/$remote/*</code>, where <code>$remote</code> is replaced with <code>origin</code> or the remote name you select) or with the <code>--mirror</code> fetch-mirror refspec ... | 119, 88239 | git, git-notes | <h1>Fetch git notes when cloning</h1>
<p>I know that git notes can be fetched after cloning using:</p>
<pre><code>git fetch origin refs/notes/*:refs/notes/*
</code></pre>
<p>or even be setup in git config to be always fetched.</p>
<p>However at clone time I do not get the notes, so I have to clone and then fetch. Al... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,829 | git | # Fetch git notes when cloning
I know that git notes can be fetched after cloning using:
```
git fetch origin refs/notes/*:refs/notes/*
```
or even be setup in git config to be always fetched.
However at clone time I do not get the notes, so I have to clone and then fetch. Although I do see that using `--mirror` wh... | The short answer is "no": at clone time, you have your choice of either cloning with the default refspec (`+refs/heads/*:refs/remotes/$remote/*`, where `$remote` is replaced with `origin` or the remote name you select) or with the `--mirror` fetch-mirror refspec (`+refs/*:refs/*`). As you note, `--mirror` implies `--ba... |
20950052 | What is the difference between `git diff` and `git difftool`? | 19 | 2014-01-06 12:29:35 | <p>What is the difference between <code>git diff</code> and <code>git difftool</code>?</p>
<p>I see that I can edit the configuration file for git to easily change the external tool used when I invoke <code>git difftool</code> and it seems that <code>git diff</code> outputs patches to the command line.</p>
<p>Why wou... | 4,933 | 1,843,978 | 2023-11-09 09:27:12 | 20,951,002 | 15 | 2014-01-06 13:25:03 | 1,387,484 | 2014-01-06 13:25:03 | https://stackoverflow.com/q/20950052 | https://stackoverflow.com/a/20951002 | <p>As you and WKPlus said, <code>git difftool</code> will use an external tool, while <code>git diff</code> will show the diff directly in the terminal.</p>
<p>To answer your last question about <em>when</em> you would want to use <code>git diff</code>, you can think some of these ones :</p>
<ol>
<li>You do not have ... | <p>As you and WKPlus said, <code>git difftool</code> will use an external tool, while <code>git diff</code> will show the diff directly in the terminal.</p> <p>To answer your last question about <em>when</em> you would want to use <code>git diff</code>, you can think some of these ones :</p> <ol> <li>You do not have ... | 119 | git | <h1>What is the difference between `git diff` and `git difftool`?</h1>
<p>What is the difference between <code>git diff</code> and <code>git difftool</code>?</p>
<p>I see that I can edit the configuration file for git to easily change the external tool used when I invoke <code>git difftool</code> and it seems that <co... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,832 | git | # What is the difference between `git diff` and `git difftool`?
What is the difference between `git diff` and `git difftool`?
I see that I can edit the configuration file for git to easily change the external tool used when I invoke `git difftool` and it seems that `git diff` outputs patches to the command line.
Why... | As you and WKPlus said, `git difftool` will use an external tool, while `git diff` will show the diff directly in the terminal.
To answer your last question about *when* you would want to use `git diff`, you can think some of these ones :
1. You do not have a GUI, so you can only use a terminal output
2. You do not h... |
15030975 | Git - separate folder for each branch. Setting it up | 19 | 2013-02-22 18:38:45 | <p>I have a need to keep 3 branches in 3 separate folders. (I know this is not a git way of doing things. But I need to do this for a reason).</p>
<p>Lets say the repo name is <code>my_proj_repo.git</code>
I have created a folder called <code>prodv1</code> in my local system:</p>
<pre><code>git clone url:/my_proj_rep... | 44,063 | 668,650 | 2021-11-29 13:44:11 | 15,031,099 | 15 | 2013-02-22 18:46:33 | 1,977,626 | 2013-02-22 18:59:25 | https://stackoverflow.com/q/15030975 | https://stackoverflow.com/a/15031099 | <p>I think that you might have to create all the branch in your repo</p>
<pre><code>$ git branch <name_of_your_new_branch>
</code></pre>
<p>Then create all your folders and in each of your folder Clone the repo but Checkout the appropriate branches.</p>
<p>Each folder should / may track only the appropriate br... | <p>I think that you might have to create all the branch in your repo</p> <pre><code>$ git branch <name_of_your_new_branch> </code></pre> <p>Then create all your folders and in each of your folder Clone the repo but Checkout the appropriate branches.</p> <p>Each folder should / may track only the appropriate br... | 119, 218, 1879 | branch, directory, git | <h1>Git - separate folder for each branch. Setting it up</h1>
<p>I have a need to keep 3 branches in 3 separate folders. (I know this is not a git way of doing things. But I need to do this for a reason).</p>
<p>Lets say the repo name is <code>my_proj_repo.git</code>
I have created a folder called <code>prodv1</code> ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,833 | git | # Git - separate folder for each branch. Setting it up
I have a need to keep 3 branches in 3 separate folders. (I know this is not a git way of doing things. But I need to do this for a reason).
Lets say the repo name is `my_proj_repo.git`
I have created a folder called `prodv1` in my local system:
```
git clone url... | I think that you might have to create all the branch in your repo
```
$ git branch <name_of_your_new_branch>
```
Then create all your folders and in each of your folder Clone the repo but Checkout the appropriate branches.
Each folder should / may track only the appropriate branch
```
Step 1 $ git branch [name_bran... |
5225666 | Is there a Git command to import a hg repository | 19 | 2011-03-07 21:46:29 | <p>With <code>git svn clone</code> I can work on a subversion repository using git. Is there a similar way to work on Mercurial (hg) repositories?</p>
| 7,111 | 109,305 | 2016-01-21 13:48:34 | 5,227,338 | 15 | 2011-03-08 01:30:43 | 219,166 | 2011-03-08 01:30:43 | https://stackoverflow.com/q/5225666 | https://stackoverflow.com/a/5227338 | <p>There isn't anything built in.</p>
<p>You can use <a href="https://github.com/offbytwo/git-hg"><code>git-hg</code></a> however, which I use a lot and works great for pulling hg repos and updates to a git repo, but the downside of it is that you cannot push updates made to your git repo to a hg repo with <code>git-h... | <p>There isn't anything built in.</p> <p>You can use <a href="https://github.com/offbytwo/git-hg"><code>git-hg</code></a> however, which I use a lot and works great for pulling hg repos and updates to a git repo, but the downside of it is that you cannot push updates made to your git repo to a hg repo with <code>git-h... | 119, 802 | git, mercurial | <h1>Is there a Git command to import a hg repository</h1>
<p>With <code>git svn clone</code> I can work on a subversion repository using git. Is there a similar way to work on Mercurial (hg) repositories?</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,834 | git | # Is there a Git command to import a hg repository
With `git svn clone` I can work on a subversion repository using git. Is there a similar way to work on Mercurial (hg) repositories? | There isn't anything built in.
You can use [`git-hg`](https://github.com/offbytwo/git-hg) however, which I use a lot and works great for pulling hg repos and updates to a git repo, but the downside of it is that you cannot push updates made to your git repo to a hg repo with `git-hg`. |
3695675 | Splitting the first commit in git | 19 | 2010-09-12 16:52:12 | <p>I want to split the first commit in my git repository, but I cannot use rebase to do this because a parent node is required. I found <a href="https://stackoverflow.com/questions/2119480/changing-the-message-of-the-first-commit-git">Edit the root commit in Git?</a> useful for modifying the first commit, but not split... | 3,545 | 111,896 | 2013-07-14 19:52:18 | 3,695,916 | 15 | 2010-09-12 18:05:37 | 19,563 | 2010-09-13 06:47:54 | https://stackoverflow.com/q/3695675 | https://stackoverflow.com/a/3695916 | <p>You can just follow exactly the same process in the question you've linked to, but after checking out the root commit you can use <code>git commit --amend</code> to modify the original commit and then <code>git commit</code> to make an additional commit before continuing the with the rebase command.</p>
<p>Dependin... | <p>You can just follow exactly the same process in the question you've linked to, but after checking out the root commit you can use <code>git commit --amend</code> to modify the original commit and then <code>git commit</code> to make an additional commit before continuing the with the rebase command.</p> <p>Dependin... | 119 | git | <h1>Splitting the first commit in git</h1>
<p>I want to split the first commit in my git repository, but I cannot use rebase to do this because a parent node is required. I found <a href="https://stackoverflow.com/questions/2119480/changing-the-message-of-the-first-commit-git">Edit the root commit in Git?</a> useful fo... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,835 | git | # Splitting the first commit in git
I want to split the first commit in my git repository, but I cannot use rebase to do this because a parent node is required. I found [Edit the root commit in Git?](https://stackoverflow.com/questions/2119480/changing-the-message-of-the-first-commit-git) useful for modifying the firs... | You can just follow exactly the same process in the question you've linked to, but after checking out the root commit you can use `git commit --amend` to modify the original commit and then `git commit` to make an additional commit before continuing the with the rebase command.
Depending on how you want to split the c... |
58245255 | How to force Git to use socks proxy over its ssh connection? | 18 | 2019-10-05 04:06:56 | <p>There are tons of identical solutions over the internet for defining proxy tunnel for git's downloads like <a href="https://stackoverflow.com/q/15227130/1198291">this</a> one, which all is by setting git's <code>https.proxy</code> & <code>http.proxy</code> config. but those answers are not working when you try t... | 18,125 | 1,198,291 | 2024-08-11 06:48:36 | 58,253,407 | 15 | 2019-10-06 00:41:35 | 1,198,291 | 2019-10-06 00:41:35 | https://stackoverflow.com/q/58245255 | https://stackoverflow.com/a/58253407 | <p>After some visiting so many pages, I finally find the solution to my question:</p>
<pre class="lang-sh prettyprint-override"><code># [step 1] create a ssh-proxy
ssh -D 9999 -qCN user@server.net
# [step 2] make git connect through the ssh-proxy
# [current script only]
export GIT_SSH_COMMAND='ssh -o ProxyComma... | <p>After some visiting so many pages, I finally find the solution to my question:</p> <pre class="lang-sh prettyprint-override"><code># [step 1] create a ssh-proxy ssh -D 9999 -qCN user@server.net # [step 2] make git connect through the ssh-proxy # [current script only] export GIT_SSH_COMMAND='ssh -o ProxyComma... | 119, 386, 760, 46742 | git, proxy, ssh, ssh-tunnel | <h1>How to force Git to use socks proxy over its ssh connection?</h1>
<p>There are tons of identical solutions over the internet for defining proxy tunnel for git's downloads like <a href="https://stackoverflow.com/q/15227130/1198291">this</a> one, which all is by setting git's <code>https.proxy</code> & <code>http... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,836 | git | # How to force Git to use socks proxy over its ssh connection?
There are tons of identical solutions over the internet for defining proxy tunnel for git's downloads like [this](https://stackoverflow.com/q/15227130/1198291) one, which all is by setting git's `https.proxy` & `http.proxy` config. but those answers are no... | After some visiting so many pages, I finally find the solution to my question:
```
# [step 1] create a ssh-proxy
ssh -D 9999 -qCN user@server.net
# [step 2] make git connect through the ssh-proxy
# [current script only]
export GIT_SSH_COMMAND='ssh -o ProxyCommand="connect -S 127.0.0.1:9999 %h %p"'
# OR [git g... |
42292219 | Merge two Git repos with full history preserved / grafted (not rewritten) | 18 | 2017-02-17 07:45:38 | <p>I want to extend on another question I had: <a href="https://stackoverflow.com/questions/42161910/merge-two-git-repositories-and-keep-the-master-history">Merge two Git repositories and keep the master history</a></p>
<p>I have succeeded in merging 2 different repo's into one repo. I needed a rebase to do this succe... | 10,045 | 2,614,299 | 2024-01-12 21:32:15 | 42,457,384 | 15 | 2017-02-25 14:36:28 | 54,249 | 2017-02-25 14:36:28 | https://stackoverflow.com/q/42292219 | https://stackoverflow.com/a/42457384 | <p>As you've discovered, <code>rebase</code> isn't the command you want to use to stitch histories together (because it actually rewrites history). Early Git had a feature (hack) designed specifically for what you're trying to do: <a href="https://git.wiki.kernel.org/index.php/GraftPoint" rel="noreferrer">graft points<... | <p>As you've discovered, <code>rebase</code> isn't the command you want to use to stitch histories together (because it actually rewrites history). Early Git had a feature (hack) designed specifically for what you're trying to do: <a href="https://git.wiki.kernel.org/index.php/GraftPoint" rel="noreferrer">graft points<... | 119, 717, 7330, 8974 | git, merge, rebase, repository | <h1>Merge two Git repos with full history preserved / grafted (not rewritten)</h1>
<p>I want to extend on another question I had: <a href="https://stackoverflow.com/questions/42161910/merge-two-git-repositories-and-keep-the-master-history">Merge two Git repositories and keep the master history</a></p>
<p>I have succee... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,837 | git | # Merge two Git repos with full history preserved / grafted (not rewritten)
I want to extend on another question I had: [Merge two Git repositories and keep the master history](https://stackoverflow.com/questions/42161910/merge-two-git-repositories-and-keep-the-master-history)
I have succeeded in merging 2 different ... | As you've discovered, `rebase` isn't the command you want to use to stitch histories together (because it actually rewrites history). Early Git had a feature (hack) designed specifically for what you're trying to do: [graft points](https://git.wiki.kernel.org/index.php/GraftPoint). Even better, since 1.6.5 you can use ... |
40817647 | What is .stCommitMsg in git global configuration file? | 18 | 2016-11-26 11:01:12 | <p>I found this in my git global configuration file <code>~/.gitconfig</code></p>
<pre><code>...
[commit]
template = {my user root folder}/.stCommitMsg
</code></pre>
<p>I have no idea what is the usage, and also there was no file in this name in my user root folder!</p>
<p>Does any one knows how it works? and is... | 6,351 | 2,359,762 | 2018-09-15 20:48:45 | 40,817,750 | 15 | 2016-11-26 11:12:52 | 1,863,229 | 2016-11-26 11:12:52 | https://stackoverflow.com/q/40817647 | https://stackoverflow.com/a/40817750 | <p>You never showed us the actual contents of <code>.stCommitMsg</code>, but it is presumably just a Git commit template file. If you specify this file as a commit template in your global <code>.gitconfig</code> then every time you make a commit you should be prompted with the contents of <code>.stCommitMsg</code>, as... | <p>You never showed us the actual contents of <code>.stCommitMsg</code>, but it is presumably just a Git commit template file. If you specify this file as a commit template in your global <code>.gitconfig</code> then every time you make a commit you should be prompted with the contents of <code>.stCommitMsg</code>, as... | 119 | git | <h1>What is .stCommitMsg in git global configuration file?</h1>
<p>I found this in my git global configuration file <code>~/.gitconfig</code></p>
<pre><code>...
[commit]
template = {my user root folder}/.stCommitMsg
</code></pre>
<p>I have no idea what is the usage, and also there was no file in this name in my u... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,838 | git | # What is .stCommitMsg in git global configuration file?
I found this in my git global configuration file `~/.gitconfig`
```
...
[commit]
template = {my user root folder}/.stCommitMsg
```
I have no idea what is the usage, and also there was no file in this name in my user root folder!
Does any one knows how it ... | You never showed us the actual contents of `.stCommitMsg`, but it is presumably just a Git commit template file. If you specify this file as a commit template in your global `.gitconfig` then every time you make a commit you should be prompted with the contents of `.stCommitMsg`, asking for a commit message.
Ideally, ... |
36018233 | How to load a PKCS#12 Digital Certificate with Javascript WebCrypto API | 18 | 2016-03-15 17:32:54 | <p>I'm trying to sign data using the WebCrypto API, but instead of creating a private/public key and exporting it to pkcs#1 or 8, I would really like to use a user's PKCS#12 to sign data. I've read the W3C spec, but cannot make much of it and can't find any good material on how to do this. Right now I want to leave Ac... | 21,554 | 2,073,093 | 2017-08-30 20:46:06 | 37,407,739 | 15 | 2016-05-24 08:07:04 | 6,371,459 | 2017-08-30 20:46:06 | https://stackoverflow.com/q/36018233 | https://stackoverflow.com/a/37407739 | <p>Web cryptography api does not support PKCS # 12. You can use a third party library to decode the p12 as forge <a href="https://github.com/digitalbazaar/forge#pkcs12" rel="noreferrer">https://github.com/digitalbazaar/forge#pkcs12</a> and load privateKey in webcrypto</p>
<p><strong>Reading the PKCS#12 certificate</st... | <p>Web cryptography api does not support PKCS # 12. You can use a third party library to decode the p12 as forge <a href="https://github.com/digitalbazaar/forge#pkcs12" rel="noreferrer">https://github.com/digitalbazaar/forge#pkcs12</a> and load privateKey in webcrypto</p> <p><strong>Reading the PKCS#12 certificate</st... | 3, 8502, 17782, 105556 | digital-certificate, digital-signature, javascript, webcrypto-api | <h1>How to load a PKCS#12 Digital Certificate with Javascript WebCrypto API</h1>
<p>I'm trying to sign data using the WebCrypto API, but instead of creating a private/public key and exporting it to pkcs#1 or 8, I would really like to use a user's PKCS#12 to sign data. I've read the W3C spec, but cannot make much of it... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,839 | git | # How to load a PKCS#12 Digital Certificate with Javascript WebCrypto API
I'm trying to sign data using the WebCrypto API, but instead of creating a private/public key and exporting it to pkcs#1 or 8, I would really like to use a user's PKCS#12 to sign data. I've read the W3C spec, but cannot make much of it and can't... | Web cryptography api does not support PKCS # 12. You can use a third party library to decode the p12 as forge <https://github.com/digitalbazaar/forge#pkcs12> and load privateKey in webcrypto
**Reading the PKCS#12 certificate**
PKCS#12 is stored in DER, so first read it from a File or use a pre-stored base64
```
//Re... |
26159274 | Is it possible to have a trailing period in user.name in Git? | 18 | 2014-10-02 10:51:03 | <p>The following Git statement </p>
<pre><code>cd periodtest/
git init
git config user.name "Test."
# verify that user.name is 'Test.'
git config user.name
touch README
git add README
git commit -a -m "period test"
</code></pre>
<p>Results in the following checkout</p>
<pre><code># check user name after commit
git... | 6,957 | 2,069,812 | 2023-08-12 22:49:57 | 26,219,423 | 15 | 2014-10-06 15:18:56 | 2,274,224 | 2020-02-27 09:45:16 | https://stackoverflow.com/q/26159274 | https://stackoverflow.com/a/26219423 | <p>This behaviour is hardcoded into git.</p>
<p><em><strong>Edit</strong>: As it stands this is still true for git version 2.25.1 (27. February 2020)</em>.</p>
<p>To create the <em>author</em> string during a commit git removes <em>crud</em> (as git calls it) from the beginning and the end of the string. For this it us... | <p>This behaviour is hardcoded into git.</p> <p><em><strong>Edit</strong>: As it stands this is still true for git version 2.25.1 (27. February 2020)</em>.</p> <p>To create the <em>author</em> string during a commit git removes <em>crud</em> (as git calls it) from the beginning and the end of the string. For this it us... | 119 | git | <h1>Is it possible to have a trailing period in user.name in Git?</h1>
<p>The following Git statement </p>
<pre><code>cd periodtest/
git init
git config user.name "Test."
# verify that user.name is 'Test.'
git config user.name
touch README
git add README
git commit -a -m "period test"
</code></pre>
<p>Results in th... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,841 | git | # Is it possible to have a trailing period in user.name in Git?
The following Git statement
```
cd periodtest/
git init
git config user.name "Test."
# verify that user.name is 'Test.'
git config user.name
touch README
git add README
git commit -a -m "period test"
```
Results in the following checkout
```
# check ... | This behaviour is hardcoded into git.
***Edit**: As it stands this is still true for git version 2.25.1 (27. February 2020)*.
To create the *author* string during a commit git removes *crud* (as git calls it) from the beginning and the end of the string. For this it uses the `strbuf_addstr_without_crud` function defi... |
23857207 | gitignore: Understanding "hello/" vs. "hello/*" | 18 | 2014-05-25 15:56:37 | <p><code>hello/</code> ignores all folders named "hello" anywhere in my folder structure</p>
<p><code>hello/*</code> only ignores the folder "hello" at the top-level.</p>
<p>Why is this? Please point to a passage in <a href="http://git-scm.com/docs/gitignore" rel="noreferrer">http://git-scm.com/docs/gitignore</a> tha... | 748 | 3,523,379 | 2014-05-26 01:58:27 | 23,857,256 | 15 | 2014-05-25 16:00:30 | 1,212,596 | 2014-05-26 01:58:27 | https://stackoverflow.com/q/23857207 | https://stackoverflow.com/a/23857256 | <p>This may seem stange, but this allows us to match directories in multiple ways: files or directories anywhere, directories anywhere, or directories at the top level. This versatility is very useful, and can prevent having a cluttered <code>.gitignore</code>.</p>
<p>(FYI, if you have Git 1.8.2+, you can use <a href=... | <p>This may seem stange, but this allows us to match directories in multiple ways: files or directories anywhere, directories anywhere, or directories at the top level. This versatility is very useful, and can prevent having a cluttered <code>.gitignore</code>.</p> <p>(FYI, if you have Git 1.8.2+, you can use <a href=... | 119, 25056 | git, gitignore | <h1>gitignore: Understanding "hello/" vs. "hello/*"</h1>
<p><code>hello/</code> ignores all folders named "hello" anywhere in my folder structure</p>
<p><code>hello/*</code> only ignores the folder "hello" at the top-level.</p>
<p>Why is this? Please point to a passage in <a href="http://git-scm.com/docs/gitignore" r... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,842 | git | # gitignore: Understanding "hello/" vs. "hello/*"
`hello/` ignores all folders named "hello" anywhere in my folder structure
`hello/*` only ignores the folder "hello" at the top-level.
Why is this? Please point to a passage in <http://git-scm.com/docs/gitignore> that explains this behavior. | This may seem stange, but this allows us to match directories in multiple ways: files or directories anywhere, directories anywhere, or directories at the top level. This versatility is very useful, and can prevent having a cluttered `.gitignore`.
(FYI, if you have Git 1.8.2+, you can use [`git check-ignore`](http://g... |
21696649 | Filtering out strings that only contains digits and/or punctuation - python | 18 | 2014-02-11 08:27:41 | <p>I need to filter out only strings that contains only digits and/or a fix set of punctuation. </p>
<p>I've tried checking each character and then summing the Boolean conditions to check if it is equal to the <code>len(str)</code>. Is there a more pythonic way to do this:</p>
<pre><code>>>> import string
&g... | 30,342 | 610,569 | 2014-02-11 10:57:40 | 21,696,702 | 15 | 2014-02-11 08:31:06 | 2,225,682 | 2014-02-11 10:57:40 | https://stackoverflow.com/q/21696649 | https://stackoverflow.com/a/21696702 | <p>Using <a href="http://docs.python.org/2/library/functions.html#all" rel="noreferrer"><code>all</code></a> with generator expression, you don't need to count, compare length:</p>
<pre><code>>>> [i for i in x if all(j.isdigit() or j in string.punctuation for j in i)]
['12,523', '3.46']
</code></pre>
<p>BTW,... | <p>Using <a href="http://docs.python.org/2/library/functions.html#all" rel="noreferrer"><code>all</code></a> with generator expression, you don't need to count, compare length:</p> <pre><code>>>> [i for i in x if all(j.isdigit() or j in string.punctuation for j in i)] ['12,523', '3.46'] </code></pre> <p>BTW,... | 16, 139, 19985, 48894 | digit, punctuation, python, string | <h1>Filtering out strings that only contains digits and/or punctuation - python</h1>
<p>I need to filter out only strings that contains only digits and/or a fix set of punctuation. </p>
<p>I've tried checking each character and then summing the Boolean conditions to check if it is equal to the <code>len(str)</code>. I... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,843 | git | # Filtering out strings that only contains digits and/or punctuation - python
I need to filter out only strings that contains only digits and/or a fix set of punctuation.
I've tried checking each character and then summing the Boolean conditions to check if it is equal to the `len(str)`. Is there a more pythonic way ... | Using [`all`](http://docs.python.org/2/library/functions.html#all) with generator expression, you don't need to count, compare length:
```
>>> [i for i in x if all(j.isdigit() or j in string.punctuation for j in i)]
['12,523', '3.46']
```
BTW, above and OP's code will include strings that contains only punctuations.
... |
5760331 | git-subtree is not retaining history so I cannot push subtree changes, how can I fix this/avoid this issue in the future? | 18 | 2011-04-22 21:38:54 | <p>I've been using the git-subtree extension (<a href="https://github.com/apenwarr/git-subtree" rel="noreferrer">https://github.com/apenwarr/git-subtree</a>) to manage sub-projects within our main project. It's doing exactly what I want other than the fact that it fails when I try to split out changes made to a sub-pr... | 9,563 | 56,786 | 2012-03-08 17:16:18 | 5,763,370 | 15 | 2011-04-23 09:18:05 | 193,688 | 2011-04-23 10:09:20 | https://stackoverflow.com/q/5760331 | https://stackoverflow.com/a/5763370 | <p>The purpose of <code>git subtree split</code> is to create some new commits (representing “local” changes originally made in the subtree’s local directory) on top of the subtree’s original history. Since it directly involves the subtree’s original history (as the parent commit of the first rewritten local commit tha... | <p>The purpose of <code>git subtree split</code> is to create some new commits (representing “local” changes originally made in the subtree’s local directory) on top of the subtree’s original history. Since it directly involves the subtree’s original history (as the parent commit of the first rewritten local commit tha... | 119, 68200 | git, git-subtree | <h1>git-subtree is not retaining history so I cannot push subtree changes, how can I fix this/avoid this issue in the future?</h1>
<p>I've been using the git-subtree extension (<a href="https://github.com/apenwarr/git-subtree" rel="noreferrer">https://github.com/apenwarr/git-subtree</a>) to manage sub-projects within o... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,844 | git | # git-subtree is not retaining history so I cannot push subtree changes, how can I fix this/avoid this issue in the future?
I've been using the git-subtree extension (<https://github.com/apenwarr/git-subtree>) to manage sub-projects within our main project. It's doing exactly what I want other than the fact that it fa... | The purpose of `git subtree split` is to create some new commits (representing “local” changes originally made in the subtree’s local directory) on top of the subtree’s original history. Since it directly involves the subtree’s original history (as the parent commit of the first rewritten local commit that touches the ... |
48796214 | How to delete a remote branch using magit in emacs | 17 | 2018-02-14 21:06:22 | <p>what is the magit key sequence which is the equivalent of</p>
<pre><code>git push origin :branch-to-be-deleted
</code></pre>
<p>that will cause the branch to be dropped from the remote repo.</p>
| 4,413 | 90,801 | 2020-05-14 10:16:36 | 48,797,235 | 15 | 2018-02-14 22:24:30 | 1,000,286 | 2018-02-14 22:24:30 | https://stackoverflow.com/q/48796214 | https://stackoverflow.com/a/48797235 | <p>The built in branch delete feature of magit (<code>magit-status</code>, <code>b</code> <code>k</code>; or directly call the function <code>magit-branch-delete</code>) will delete remote branches in addition to local branches. Instead of specifying <code>my-branch</code> as the branch to delete, make sure to specify ... | <p>The built in branch delete feature of magit (<code>magit-status</code>, <code>b</code> <code>k</code>; or directly call the function <code>magit-branch-delete</code>) will delete remote branches in addition to local branches. Instead of specifying <code>my-branch</code> as the branch to delete, make sure to specify ... | 119, 371, 41829 | emacs, git, magit | <h1>How to delete a remote branch using magit in emacs</h1>
<p>what is the magit key sequence which is the equivalent of</p>
<pre><code>git push origin :branch-to-be-deleted
</code></pre>
<p>that will cause the branch to be dropped from the remote repo.</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,845 | git | # How to delete a remote branch using magit in emacs
what is the magit key sequence which is the equivalent of
```
git push origin :branch-to-be-deleted
```
that will cause the branch to be dropped from the remote repo. | The built in branch delete feature of magit (`magit-status`, `b` `k`; or directly call the function `magit-branch-delete`) will delete remote branches in addition to local branches. Instead of specifying `my-branch` as the branch to delete, make sure to specify `my-remote/my-branch`. |
41178361 | How to use Ansible git module pull a branch with local changes? | 17 | 2016-12-16 06:19:12 | <p>My git workspace is dirty, there are some local modifications. When I use command <code>git pull origin master</code> it works fine because there is no conflict.</p>
<p>But when I'm trying to use <code>Ansible</code> like
<code>git: repo=xxxx dest=xxx version={{branch}}</code>
I got error:</p>
<blockquote>
<p>Lo... | 21,012 | 7,305,240 | 2025-04-16 12:39:07 | 41,178,657 | 15 | 2016-12-16 06:41:29 | 2,947,502 | 2022-06-25 19:52:12 | https://stackoverflow.com/q/41178361 | https://stackoverflow.com/a/41178657 | <p>You cannot achieve it using the git module.</p>
<p>Ansible checks <a href="https://github.com/ansible/ansible/blob/devel/lib/ansible/modules/source_control/git.py#L428" rel="nofollow noreferrer">the result of</a>:</p>
<pre><code>git status --porcelain
</code></pre>
<p>and <a href="https://github.com/ansible/ansible-... | <p>You cannot achieve it using the git module.</p> <p>Ansible checks <a href="https://github.com/ansible/ansible/blob/devel/lib/ansible/modules/source_control/git.py#L428" rel="nofollow noreferrer">the result of</a>:</p> <pre><code>git status --porcelain </code></pre> <p>and <a href="https://github.com/ansible/ansible-... | 119, 86394, 111433 | ansible, devops, git | <h1>How to use Ansible git module pull a branch with local changes?</h1>
<p>My git workspace is dirty, there are some local modifications. When I use command <code>git pull origin master</code> it works fine because there is no conflict.</p>
<p>But when I'm trying to use <code>Ansible</code> like
<code>git: repo=xxxx ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,846 | git | # How to use Ansible git module pull a branch with local changes?
My git workspace is dirty, there are some local modifications. When I use command `git pull origin master` it works fine because there is no conflict.
But when I'm trying to use `Ansible` like
`git: repo=xxxx dest=xxx version={{branch}}`
I got error:
... | You cannot achieve it using the git module.
Ansible checks [the result of](https://github.com/ansible/ansible/blob/devel/lib/ansible/modules/source_control/git.py#L428):
```
git status --porcelain
```
and [aborts task execution](https://github.com/ansible/ansible-modules-core/blob/00911a75ad6635834b6d28eef41f197b2f7... |
29034240 | Gerrit trigger for Jenkins couldn't find any revision to build | 17 | 2015-03-13 14:02:36 | <p>I have trouble using Jenkins+Gerrit.</p>
<p>Here is what I got so far:</p>
<ul>
<li><p>Gerrit Trigger configuration in Jenkins seems to be ok: When I push a new changeset, Jenkins build is launched.</p></li>
<li><p>I used this:
<a href="https://stackoverflow.com/questions/7582331/jenkins-settings-for-gerrit-trigge... | 22,117 | 2,248,987 | 2022-01-26 17:57:14 | 31,717,642 | 15 | 2015-07-30 07:28:35 | 1,236,461 | 2015-07-30 07:28:35 | https://stackoverflow.com/q/29034240 | https://stackoverflow.com/a/31717642 | <p>I used to have this problem and I think I have now fixed it, I am blaming the Jenkins UI for hiding some essential configuration elements ;)</p>
<p>Here is the output of my Jenkins build prior to the fix:</p>
<pre><code>Triggered by Gerrit: https://bbpcode.epfl.ch/code/15056
[EnvInject] - Loading node environment ... | <p>I used to have this problem and I think I have now fixed it, I am blaming the Jenkins UI for hiding some essential configuration elements ;)</p> <p>Here is the output of my Jenkins build prior to the fix:</p> <pre><code>Triggered by Gerrit: https://bbpcode.epfl.ch/code/15056 [EnvInject] - Loading node environment ... | 119, 52272, 64999, 109844 | gerrit, gerrit-trigger, git, jenkins | <h1>Gerrit trigger for Jenkins couldn't find any revision to build</h1>
<p>I have trouble using Jenkins+Gerrit.</p>
<p>Here is what I got so far:</p>
<ul>
<li><p>Gerrit Trigger configuration in Jenkins seems to be ok: When I push a new changeset, Jenkins build is launched.</p></li>
<li><p>I used this:
<a href="https:... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,847 | git | # Gerrit trigger for Jenkins couldn't find any revision to build
I have trouble using Jenkins+Gerrit.
Here is what I got so far:
- Gerrit Trigger configuration in Jenkins seems to be ok: When I push a new changeset, Jenkins build is launched.
- I used this:
[Jenkins: settings for Gerrit Trigger problems](https://s... | I used to have this problem and I think I have now fixed it, I am blaming the Jenkins UI for hiding some essential configuration elements ;)
Here is the output of my Jenkins build prior to the fix:
```
Triggered by Gerrit: https://bbpcode.epfl.ch/code/15056
[EnvInject] - Loading node environment variables.
Building r... |
19352921 | how to use direction angle and speed to calculate next time's latitude and longitude | 17 | 2013-10-14 03:04:03 | <p>I have know my current position({lat:x,lon:y})
and I know my speed and direction angle;
How to predict next position at next time?</p>
| 14,124 | 1,142,513 | 2018-06-20 02:43:05 | 19,356,304 | 15 | 2013-10-14 08:35:00 | 777,265 | 2017-10-17 14:48:57 | https://stackoverflow.com/q/19352921 | https://stackoverflow.com/a/19356304 | <p>First, calculate the distance you will travel based on your current speed and your known time interval ("next time"): </p>
<pre><code>distance = speed * time
</code></pre>
<p>Then you can use this formula to calculate your new position (lat2/lon2):</p>
<pre><code>lat2 =asin(sin(lat1)*cos(d)+cos(lat1)*sin(d)*cos(t... | <p>First, calculate the distance you will travel based on your current speed and your known time interval ("next time"): </p> <pre><code>distance = speed * time </code></pre> <p>Then you can use this formula to calculate your new position (lat2/lon2):</p> <pre><code>lat2 =asin(sin(lat1)*cos(d)+cos(lat1)*sin(d)*cos(t... | 1372, 10580, 20301 | geolocation, gps, latitude-longitude | <h1>how to use direction angle and speed to calculate next time's latitude and longitude</h1>
<p>I have know my current position({lat:x,lon:y})
and I know my speed and direction angle;
How to predict next position at next time?</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,849 | git | # how to use direction angle and speed to calculate next time's latitude and longitude
I have know my current position({lat:x,lon:y})
and I know my speed and direction angle;
How to predict next position at next time? | First, calculate the distance you will travel based on your current speed and your known time interval ("next time"):
```
distance = speed * time
```
Then you can use this formula to calculate your new position (lat2/lon2):
```
lat2 =asin(sin(lat1)*cos(d)+cos(lat1)*sin(d)*cos(tc))
dlon=atan2(sin(tc)*sin(d)*cos(lat1)... |
17328823 | How do I get all refs that point to a commit in git? | 17 | 2013-06-26 19:30:01 | <p>Is there any way to get a list of refs (including tags, branches, and remotes) that point to a particular commit in git?</p>
| 4,829 | 515,537 | 2024-12-09 13:09:49 | 17,328,824 | 15 | 2013-06-26 19:30:01 | 515,537 | 2013-06-26 19:30:01 | https://stackoverflow.com/q/17328823 | https://stackoverflow.com/a/17328824 | <p><code>git show-ref | grep $(git rev-parse HEAD)</code> shows all refs that point to <code>HEAD</code>, the currently checked out commit.</p>
<p><code>git show-ref</code> shows all refs in your git repo.</p>
<p><code>git show-ref | grep "SHA goes here"</code> shows all refs that point to the SHA of a commit.</p>
| <p><code>git show-ref | grep $(git rev-parse HEAD)</code> shows all refs that point to <code>HEAD</code>, the currently checked out commit.</p> <p><code>git show-ref</code> shows all refs in your git repo.</p> <p><code>git show-ref | grep "SHA goes here"</code> shows all refs that point to the SHA of a commit.</p> | 119, 1879, 5597, 41346, 60718 | branch, commit, git, git-remote, git-tag | <h1>How do I get all refs that point to a commit in git?</h1>
<p>Is there any way to get a list of refs (including tags, branches, and remotes) that point to a particular commit in git?</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,850 | git | # How do I get all refs that point to a commit in git?
Is there any way to get a list of refs (including tags, branches, and remotes) that point to a particular commit in git? | `git show-ref | grep $(git rev-parse HEAD)` shows all refs that point to `HEAD`, the currently checked out commit.
`git show-ref` shows all refs in your git repo.
`git show-ref | grep "SHA goes here"` shows all refs that point to the SHA of a commit. |
5607479 | Git Server Frustration (Gitosis, Gitolite, etc) | 17 | 2011-04-09 19:54:02 | <p><em>Please excuse the frustrating undertones as I have attempted to get this set up correctly multiple times to no avail (possibly and most likely due to my ignorance, but also likely due to the lack of thorough and concise documentation).</em></p>
<p>I am trying to set up a git server so that I can share code amon... | 13,681 | 194,261 | 2012-01-27 02:57:12 | 5,608,831 | 15 | 2011-04-10 00:12:35 | 149,264 | 2011-04-10 21:42:45 | https://stackoverflow.com/q/5607479 | https://stackoverflow.com/a/5608831 | <p>From my experience, all you need is a SSH server with a <em>single</em> git account/login that you are able to connect to using one of your public keys. Install gitolite using SSH (copies gitloite from your client to the server & does the basic setup) and have your developers send you their public keys. Add thes... | <p>From my experience, all you need is a SSH server with a <em>single</em> git account/login that you are able to connect to using one of your public keys. Install gitolite using SSH (copies gitloite from your client to the server & does the basic setup) and have your developers send you their public keys. Add thes... | 58, 119, 24526, 39151 | git, gitolite, gitosis, linux | <h1>Git Server Frustration (Gitosis, Gitolite, etc)</h1>
<p><em>Please excuse the frustrating undertones as I have attempted to get this set up correctly multiple times to no avail (possibly and most likely due to my ignorance, but also likely due to the lack of thorough and concise documentation).</em></p>
<p>I am tr... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,852 | git | # Git Server Frustration (Gitosis, Gitolite, etc)
*Please excuse the frustrating undertones as I have attempted to get this set up correctly multiple times to no avail (possibly and most likely due to my ignorance, but also likely due to the lack of thorough and concise documentation).*
I am trying to set up a git se... | From my experience, all you need is a SSH server with a *single* git account/login that you are able to connect to using one of your public keys. Install gitolite using SSH (copies gitloite from your client to the server & does the basic setup) and have your developers send you their public keys. Add these keys to the ... |
73233872 | How do I depend on a crate within a Cargo workspace over git? | 16 | 2022-08-04 09:56:51 | <p>Given a <a href="https://doc.rust-lang.org/book/ch14-03-cargo-workspaces.html" rel="noreferrer">Cargo workspace</a> in one git repository that contains one crate <code>foo</code>, and another crate <code>bar</code> outside of that workspace, how do I depend on <code>foo</code> in <code>bar</code>? If <code>foo</code... | 9,067 | 235,908 | 2022-09-12 17:42:43 | 73,239,427 | 15 | 2022-08-04 16:33:31 | 130,554 | 2022-08-04 16:33:31 | https://stackoverflow.com/q/73233872 | https://stackoverflow.com/a/73239427 | <p>Your dependency name should have the name of the crate in the workspace. Cargo will search for it. Suppose the workspace foo has crate bar within it.</p>
<pre><code>bar = { git = "ssh://git@server/some/foo.git", ... }
</code></pre>
<p>Not sure where this is documented, but there is a discussion here:</p>
<... | <p>Your dependency name should have the name of the crate in the workspace. Cargo will search for it. Suppose the workspace foo has crate bar within it.</p> <pre><code>bar = { git = "ssh://git@server/some/foo.git", ... } </code></pre> <p>Not sure where this is documented, but there is a discussion here:</p> <... | 119, 59148, 106050 | git, rust, rust-cargo | <h1>How do I depend on a crate within a Cargo workspace over git?</h1>
<p>Given a <a href="https://doc.rust-lang.org/book/ch14-03-cargo-workspaces.html" rel="noreferrer">Cargo workspace</a> in one git repository that contains one crate <code>foo</code>, and another crate <code>bar</code> outside of that workspace, how ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,853 | git | # How do I depend on a crate within a Cargo workspace over git?
Given a [Cargo workspace](https://doc.rust-lang.org/book/ch14-03-cargo-workspaces.html) in one git repository that contains one crate `foo`, and another crate `bar` outside of that workspace, how do I depend on `foo` in `bar`? If `foo` were just a regular... | Your dependency name should have the name of the crate in the workspace. Cargo will search for it. Suppose the workspace foo has crate bar within it.
```
bar = { git = "ssh://git@server/some/foo.git", ... }
```
Not sure where this is documented, but there is a discussion here:
<https://github.com/rust-lang/cargo/iss... |
26928299 | Why does Git subtree always process every commit? | 16 | 2014-11-14 10:50:36 | <p>I am using <a href="https://github.com/git/git/blob/master/contrib/subtree/git-subtree.txt" rel="noreferrer"><strong>Git subtree</strong></a> to share a subfolder of my source code between projects. This is working alright, but every time I perform a git subtree push, the terminal shows an ever-growing list of commi... | 4,723 | 270,968 | 2020-02-21 20:51:34 | 27,155,706 | 15 | 2014-11-26 17:45:51 | 2,033,752 | 2014-11-26 17:45:51 | https://stackoverflow.com/q/26928299 | https://stackoverflow.com/a/27155706 | <h1>Answer 0</h1>
<p>I don't use git-subtree in my daily workflow, so I had to research this a bit, but here you go:</p>
<p><code>git subtree push</code> does <code>git subtree split</code> followed by <code>git push</code>. Command, that's showing this list of commits is actually <code>git subtree split</code>. If <... | <h1>Answer 0</h1> <p>I don't use git-subtree in my daily workflow, so I had to research this a bit, but here you go:</p> <p><code>git subtree push</code> does <code>git subtree split</code> followed by <code>git push</code>. Command, that's showing this list of commits is actually <code>git subtree split</code>. If <... | 119, 68200 | git, git-subtree | <h1>Why does Git subtree always process every commit?</h1>
<p>I am using <a href="https://github.com/git/git/blob/master/contrib/subtree/git-subtree.txt" rel="noreferrer"><strong>Git subtree</strong></a> to share a subfolder of my source code between projects. This is working alright, but every time I perform a git sub... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,856 | git | # Why does Git subtree always process every commit?
I am using [**Git subtree**](https://github.com/git/git/blob/master/contrib/subtree/git-subtree.txt) to share a subfolder of my source code between projects. This is working alright, but every time I perform a git subtree push, the terminal shows an ever-growing list... | # Answer 0
I don't use git-subtree in my daily workflow, so I had to research this a bit, but here you go:
`git subtree push` does `git subtree split` followed by `git push`. Command, that's showing this list of commits is actually `git subtree split`. If `split` doesn't find commit marked with aprropriate "git-subtr... |
26988891 | How can I make a Pull request using TortoiseGit | 16 | 2014-11-18 07:33:48 | <p>In TortoiseGit</p>
<p>When I hit Right Click -> Push, OK, Give it User/Pass then after that there is a Create Pull request button giving it a Start, URL, End. I am clicking, but nothing happens.</p>
<p>The Pull requests (0) is shown in my repo.</p>
<p>And one other thing, How can I make a pull request and then up... | 33,653 | 4,170,264 | 2017-09-07 03:45:39 | 26,989,086 | 15 | 2014-11-18 07:46:42 | 6,309 | 2014-11-18 07:56:00 | https://stackoverflow.com/q/26988891 | https://stackoverflow.com/a/26989086 | <p><a href="http://tortoisegit.org/docs/tortoisegit/tgit-dug-patch.html" rel="noreferrer">The doc mentions</a>:</p>
<blockquote>
<p>After pushing your changes to a (public) repository, you just provide other people the URL of your repository and the name of the branch or the revision id.<br>
E.g.: </p>
</blockquot... | <p><a href="http://tortoisegit.org/docs/tortoisegit/tgit-dug-patch.html" rel="noreferrer">The doc mentions</a>:</p> <blockquote> <p>After pushing your changes to a (public) repository, you just provide other people the URL of your repository and the name of the branch or the revision id.<br> E.g.: </p> </blockquot... | 119, 7330, 31409 | git, repository, tortoisegit | <h1>How can I make a Pull request using TortoiseGit</h1>
<p>In TortoiseGit</p>
<p>When I hit Right Click -> Push, OK, Give it User/Pass then after that there is a Create Pull request button giving it a Start, URL, End. I am clicking, but nothing happens.</p>
<p>The Pull requests (0) is shown in my repo.</p>
<p>And o... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,857 | git | # How can I make a Pull request using TortoiseGit
In TortoiseGit
When I hit Right Click -> Push, OK, Give it User/Pass then after that there is a Create Pull request button giving it a Start, URL, End. I am clicking, but nothing happens.
The Pull requests (0) is shown in my repo.
And one other thing, How can I make... | [The doc mentions](http://tortoisegit.org/docs/tortoisegit/tgit-dug-patch.html):
> After pushing your changes to a (public) repository, you just provide other people the URL of your repository and the name of the branch or the revision id.
> E.g.:
```
git://example.com/repo.git BRANCHNAME
```
 man page:
First, create a new repository with the two original ones as remotes, just as you did before. I am assuming that both use the branch name "master".
```
... |
3871512 | Commit select changes to another branch then resume work on current branch? | 16 | 2010-10-06 10:21:58 | <p>This happens often in my work flow: I'm working on a feature in a separate branch, and while doing this I'll come across small things that need fixing but are from higher up in the framework or site layout for example.</p>
<p>I want to switch back to the main <em>develop</em> branch and commit changes from select f... | 3,991 | null | 2010-10-07 00:34:36 | 3,877,903 | 15 | 2010-10-07 00:34:36 | 64,313 | 2010-10-07 00:34:36 | https://stackoverflow.com/q/3871512 | https://stackoverflow.com/a/3877903 | <ol>
<li>Commit the changes that you want in <code>master</code> on your current branch.</li>
<li>Stash your remaining changes</li>
<li>Switch to <code>master</code> branch and use <code>git cherry-pick</code> to move the changes onto <code>master</code></li>
<li>Move back to your feather branch, and <code>rebase</code... | <ol> <li>Commit the changes that you want in <code>master</code> on your current branch.</li> <li>Stash your remaining changes</li> <li>Switch to <code>master</code> branch and use <code>git cherry-pick</code> to move the changes onto <code>master</code></li> <li>Move back to your feather branch, and <code>rebase</code... | 119, 1879, 53847 | branch, branching-and-merging, git | <h1>Commit select changes to another branch then resume work on current branch?</h1>
<p>This happens often in my work flow: I'm working on a feature in a separate branch, and while doing this I'll come across small things that need fixing but are from higher up in the framework or site layout for example.</p>
<p>I wan... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,860 | git | # Commit select changes to another branch then resume work on current branch?
This happens often in my work flow: I'm working on a feature in a separate branch, and while doing this I'll come across small things that need fixing but are from higher up in the framework or site layout for example.
I want to switch back... | 1. Commit the changes that you want in `master` on your current branch.
2. Stash your remaining changes
3. Switch to `master` branch and use `git cherry-pick` to move the changes onto `master`
4. Move back to your feather branch, and `rebase` (optional)
5. Unstash the original feature changes |
46994014 | Using .gitignore with Rider IDE | 15 | 2017-10-28 20:10:48 | <p>How can I add <code>.gitignore</code> to my solution in Rider? When I right click on my solution under New, I cannot see anything related to adding <code>.gitignore</code> file. Any help would be appreciated.</p>
| 44,495 | 4,451,931 | 2024-11-29 03:49:05 | 46,994,107 | 15 | 2017-10-28 20:21:48 | 5,673,558 | 2017-10-28 20:21:48 | https://stackoverflow.com/q/46994014 | https://stackoverflow.com/a/46994107 | <p>That functionality isn't included by default; you can just make a new file named <code>.gitignore</code>.</p>
<p>However, there is an excellent <code>.ignore</code> plugin available for all JetBrains IDE's:</p>
<p><a href="https://plugins.jetbrains.com/plugin/7495--ignore" rel="noreferrer">https://plugins.jetbrain... | <p>That functionality isn't included by default; you can just make a new file named <code>.gitignore</code>.</p> <p>However, there is an excellent <code>.ignore</code> plugin available for all JetBrains IDE's:</p> <p><a href="https://plugins.jetbrains.com/plugin/7495--ignore" rel="noreferrer">https://plugins.jetbrain... | 119, 25056, 120390 | git, gitignore, rider | <h1>Using .gitignore with Rider IDE</h1>
<p>How can I add <code>.gitignore</code> to my solution in Rider? When I right click on my solution under New, I cannot see anything related to adding <code>.gitignore</code> file. Any help would be appreciated.</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,863 | git | # Using .gitignore with Rider IDE
How can I add `.gitignore` to my solution in Rider? When I right click on my solution under New, I cannot see anything related to adding `.gitignore` file. Any help would be appreciated. | That functionality isn't included by default; you can just make a new file named `.gitignore`.
However, there is an excellent `.ignore` plugin available for all JetBrains IDE's:
<https://plugins.jetbrains.com/plugin/7495--ignore> |
39296970 | Can I add a cordova plugin based on a Git branch? | 15 | 2016-09-02 16:26:01 | <p>I do have a git repository with a MASTER branch.
I have now a new capability into a specific BRANCH of that same git project.</p>
<p>I wish to add the specific branch cordova plugin. </p>
<p>I'm aware of adding a cordova project based on GIT and GIT TAGS but I can't find anything in relation to a branch.</p>
<p>I... | 8,981 | 3,687,474 | 2020-06-06 01:14:37 | 39,333,537 | 15 | 2016-09-05 15:15:42 | 5,238,158 | 2020-06-06 01:14:37 | https://stackoverflow.com/q/39296970 | https://stackoverflow.com/a/39333537 | <p>If the project's github repository is branched properly, then you should be able to install the plugin using the specific branch in the github out of the box.</p>
<pre><code>cordova plugin add https://git.example.com/myproject#branch_name
</code></pre>
<p>Have look at <a href="https://github.com/ConnectSDK/Connec... | <p>If the project's github repository is branched properly, then you should be able to install the plugin using the specific branch in the github out of the box.</p> <pre><code>cordova plugin add https://git.example.com/myproject#branch_name </code></pre> <p>Have look at <a href="https://github.com/ConnectSDK/Connec... | 119, 1879, 78331, 100064 | branch, cordova, git, ionic-framework | <h1>Can I add a cordova plugin based on a Git branch?</h1>
<p>I do have a git repository with a MASTER branch.
I have now a new capability into a specific BRANCH of that same git project.</p>
<p>I wish to add the specific branch cordova plugin. </p>
<p>I'm aware of adding a cordova project based on GIT and GIT TAGS b... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,866 | git | # Can I add a cordova plugin based on a Git branch?
I do have a git repository with a MASTER branch.
I have now a new capability into a specific BRANCH of that same git project.
I wish to add the specific branch cordova plugin.
I'm aware of adding a cordova project based on GIT and GIT TAGS but I can't find anything... | If the project's github repository is branched properly, then you should be able to install the plugin using the specific branch in the github out of the box.
```
cordova plugin add https://git.example.com/myproject#branch_name
```
Have look at [Cordova connect plugin](https://github.com/ConnectSDK/Connect-SDK-Cordov... |
37648908 | Determine if a merge will resolve via fast-forward | 15 | 2016-06-06 02:47:55 | <p>I want to know if a particular merge will resolve via "fast-forward" or not before running the merge command. </p>
<p>I know I can specifically request for the merge to not be resolved via "fast-forward" (using the <code>--no-ff</code> option). Or that I can try to resolve the merge only by fast-forward (using the ... | 4,233 | 1,970,057 | 2016-06-08 22:55:27 | 37,714,252 | 15 | 2016-06-08 22:55:27 | 1,256,452 | 2016-06-08 22:55:27 | https://stackoverflow.com/q/37648908 | https://stackoverflow.com/a/37714252 | <p>Summary: <code>git merge-base --is-ancestor</code> tests whether one commit is an ancestor of another (where commits are considered to be their own ancestors, which is a particularly weird form of incest, perhaps :-) ). Since a branch label can only be fast-forwarded by <code>git merge</code> when the current branc... | <p>Summary: <code>git merge-base --is-ancestor</code> tests whether one commit is an ancestor of another (where commits are considered to be their own ancestors, which is a particularly weird form of incest, perhaps :-) ). Since a branch label can only be fast-forwarded by <code>git merge</code> when the current branc... | 119, 717, 52842 | fast-forward, git, merge | <h1>Determine if a merge will resolve via fast-forward</h1>
<p>I want to know if a particular merge will resolve via "fast-forward" or not before running the merge command. </p>
<p>I know I can specifically request for the merge to not be resolved via "fast-forward" (using the <code>--no-ff</code> option). Or that I c... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,867 | git | # Determine if a merge will resolve via fast-forward
I want to know if a particular merge will resolve via "fast-forward" or not before running the merge command.
I know I can specifically request for the merge to not be resolved via "fast-forward" (using the `--no-ff` option). Or that I can try to resolve the merge ... | Summary: `git merge-base --is-ancestor` tests whether one commit is an ancestor of another (where commits are considered to be their own ancestors, which is a particularly weird form of incest, perhaps :-) ). Since a branch label can only be fast-forwarded by `git merge` when the current branch (`HEAD`) points to a com... |
30104748 | pip unexpectedly not installing latest version of git package with branch/commit pinning | 15 | 2015-05-07 14:56:56 | <p>I have a requirements.txt file with the following line (among others):</p>
<pre><code>git+https://github.com/lead-ratings/sexmachine.git@master#egg=SexMachine
</code></pre>
<p>When I do</p>
<pre><code>pip install -r requirements.txt
</code></pre>
<p>I see</p>
<pre><code>Requirement already satisfied (use --upgr... | 5,386 | 356,729 | 2021-12-05 16:14:22 | 30,562,333 | 15 | 2015-05-31 20:29:19 | 1,938,621 | 2015-06-01 18:22:18 | https://stackoverflow.com/q/30104748 | https://stackoverflow.com/a/30562333 | <p>Pip decides whether a requirement is met solely based on the version number (in setup.py). In your case the pypi version you installed previously had the same version number as the master branch of sexmachine, so pip did nothing.</p>
<p>It seems that the way to handle this is to always pass the <code>-U</code> / <c... | <p>Pip decides whether a requirement is met solely based on the version number (in setup.py). In your case the pypi version you installed previously had the same version number as the master branch of sexmachine, so pip did nothing.</p> <p>It seems that the way to handle this is to always pass the <code>-U</code> / <c... | 16, 119, 5119 | git, pip, python | <h1>pip unexpectedly not installing latest version of git package with branch/commit pinning</h1>
<p>I have a requirements.txt file with the following line (among others):</p>
<pre><code>git+https://github.com/lead-ratings/sexmachine.git@master#egg=SexMachine
</code></pre>
<p>When I do</p>
<pre><code>pip install -r ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,868 | git | # pip unexpectedly not installing latest version of git package with branch/commit pinning
I have a requirements.txt file with the following line (among others):
```
git+https://github.com/lead-ratings/sexmachine.git@master#egg=SexMachine
```
When I do
```
pip install -r requirements.txt
```
I see
```
Requirement... | Pip decides whether a requirement is met solely based on the version number (in setup.py). In your case the pypi version you installed previously had the same version number as the master branch of sexmachine, so pip did nothing.
It seems that the way to handle this is to always pass the `-U` / `--upgrade` flag:
```
... |
29233676 | Git: how to go back before merge | 15 | 2015-03-24 13:16:39 | <p>Thanks for your help.
I am really confused...</p>
<p>I merged a pull request for a team mate.</p>
<p>Now I wish to go back to the situation before the merge, because I have realized that bugs are introduced.
The pull request was done by a friend on the 24, I did the merge on the 24.</p>
<ul>
<li>I need to go back... | 23,213 | 1,815,311 | 2015-03-24 16:10:57 | 29,233,808 | 15 | 2015-03-24 13:22:57 | 249,543 | 2015-03-24 13:38:25 | https://stackoverflow.com/q/29233676 | https://stackoverflow.com/a/29233808 | <p>Assuming you didn't delete the branch on which the original changes appear, then the work from your teammate is still sitting on that branch, so I wouldn't worry about losing those changes so long as you still have that branch where the changes were made.</p>
<p>You can do a <code>git reset --hard [commit hash]</co... | <p>Assuming you didn't delete the branch on which the original changes appear, then the work from your teammate is still sitting on that branch, so I wouldn't worry about losing those changes so long as you still have that branch where the changes were made.</p> <p>You can do a <code>git reset --hard [commit hash]</co... | 119 | git | <h1>Git: how to go back before merge</h1>
<p>Thanks for your help.
I am really confused...</p>
<p>I merged a pull request for a team mate.</p>
<p>Now I wish to go back to the situation before the merge, because I have realized that bugs are introduced.
The pull request was done by a friend on the 24, I did the merge ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,869 | git | # Git: how to go back before merge
Thanks for your help.
I am really confused...
I merged a pull request for a team mate.
Now I wish to go back to the situation before the merge, because I have realized that bugs are introduced.
The pull request was done by a friend on the 24, I did the merge on the 24.
- I need to... | Assuming you didn't delete the branch on which the original changes appear, then the work from your teammate is still sitting on that branch, so I wouldn't worry about losing those changes so long as you still have that branch where the changes were made.
You can do a `git reset --hard [commit hash]` to go back to the... |
27397344 | How long does git keep out-of-branch commits? | 15 | 2014-12-10 09:25:13 | <p>Assume I create a branch in my local repository named <code>feature1</code> based on <code>master</code> and add one or two commits. Then I switch back to <code>master</code> and decide that <code>feature1</code> is not going to make it and delete the branch.</p>
<p>I assume that a branch is basically a "pointer" t... | 3,193 | 2,019,265 | 2018-10-16 08:17:13 | 27,397,441 | 15 | 2014-12-10 09:30:34 | 6,309 | 2018-10-16 08:17:13 | https://stackoverflow.com/q/27397344 | https://stackoverflow.com/a/27397441 | <p>The default s 90 days:</p>
<pre><code>gc.reflogexpire
gc.<pattern>.reflogexpire
</code></pre>
<blockquote>
<p><code>git reflog expire</code> removes reflog entries older than this time; defaults to 90 days. With "<code><pattern></code>" (e.g. "<code>refs/stash</code>") in the middle the setting appli... | <p>The default s 90 days:</p> <pre><code>gc.reflogexpire gc.<pattern>.reflogexpire </code></pre> <blockquote> <p><code>git reflog expire</code> removes reflog entries older than this time; defaults to 90 days. With "<code><pattern></code>" (e.g. "<code>refs/stash</code>") in the middle the setting appli... | 119 | git | <h1>How long does git keep out-of-branch commits?</h1>
<p>Assume I create a branch in my local repository named <code>feature1</code> based on <code>master</code> and add one or two commits. Then I switch back to <code>master</code> and decide that <code>feature1</code> is not going to make it and delete the branch.</p... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,870 | git | # How long does git keep out-of-branch commits?
Assume I create a branch in my local repository named `feature1` based on `master` and add one or two commits. Then I switch back to `master` and decide that `feature1` is not going to make it and delete the branch.
I assume that a branch is basically a "pointer" to a p... | The default s 90 days:
```
gc.reflogexpire
gc.<pattern>.reflogexpire
```
> `git reflog expire` removes reflog entries older than this time; defaults to 90 days. With "`<pattern>`" (e.g. "`refs/stash`") in the middle the setting applies only to the refs that match the `<pattern>`.
So:
1. Yes
2. 90 days
3. no (you ac... |
12938189 | How do I keep SVN history in Git when trunk has moved? | 15 | 2012-10-17 15:47:09 | <p>I am trying to use <a href="https://github.com/nirvdrum/svn2git">svn2git</a> to migrate a SVN project to git. However I have problems preserving all the history. The reasons seems to be because the trunk was moved in the past. The command I am using is:</p>
<pre><code>$ svn2git http://mysvnserver.com/myproject/iPho... | 4,313 | 66,634 | 2014-06-18 23:59:34 | 24,296,764 | 15 | 2014-06-18 23:54:01 | 2,167,531 | 2014-06-18 23:59:34 | https://stackoverflow.com/q/12938189 | https://stackoverflow.com/a/24296764 | <p>I just had the same problem myself. Here is how I solved it.</p>
<p>Clone both repos separately.</p>
<pre><code>git svn clone -s [original-svn-location] [original-clone-directory]
git svn clone -s [new-svn-location] [new-clone-directory]
</code></pre>
<p>Add the old cloned data to the new repo.</p>
<pre><code>cd... | <p>I just had the same problem myself. Here is how I solved it.</p> <p>Clone both repos separately.</p> <pre><code>git svn clone -s [original-svn-location] [original-clone-directory] git svn clone -s [new-svn-location] [new-clone-directory] </code></pre> <p>Add the old cloned data to the new repo.</p> <pre><code>cd... | 63, 6452 | git-svn, svn | <h1>How do I keep SVN history in Git when trunk has moved?</h1>
<p>I am trying to use <a href="https://github.com/nirvdrum/svn2git">svn2git</a> to migrate a SVN project to git. However I have problems preserving all the history. The reasons seems to be because the trunk was moved in the past. The command I am using is:... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,871 | git | # How do I keep SVN history in Git when trunk has moved?
I am trying to use [svn2git](https://github.com/nirvdrum/svn2git) to migrate a SVN project to git. However I have problems preserving all the history. The reasons seems to be because the trunk was moved in the past. The command I am using is:
```
$ svn2git http... | I just had the same problem myself. Here is how I solved it.
Clone both repos separately.
```
git svn clone -s [original-svn-location] [original-clone-directory]
git svn clone -s [new-svn-location] [new-clone-directory]
```
Add the old cloned data to the new repo.
```
cd [new-clone-directory]
git remote add oldstuf... |
17736427 | Git difftool in Windows to see list of all changed files in addition to file diffs (a la Kaleidoscope)? | 15 | 2013-07-19 00:50:55 | <p>When I do a <code>git difftool</code>, <a href="https://www.kaleidoscopeapp.com/" rel="nofollow noreferrer">Kaleidoscope</a> shows me all the files that have changed in the left sidebar:</p>
<p><a href="https://i.sstatic.net/h4ZHt.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/h4ZHt.png" alt=""></a>... | 7,816 | 2,288,585 | 2021-11-01 16:59:08 | 17,739,808 | 15 | 2013-07-19 06:53:42 | 6,309 | 2021-11-01 16:59:08 | https://stackoverflow.com/q/17736427 | https://stackoverflow.com/a/17739808 | <p>You can use git difftool in a way which lists all the files (git1.8+ recommended):</p>
<pre><code>git difftool --dir-diff
</code></pre>
<blockquote>
<p>Copy the modified files to a temporary location and perform a directory diff on them.<br />
This mode never prompts before launching the diff tool.</p>
</blockquote>... | <p>You can use git difftool in a way which lists all the files (git1.8+ recommended):</p> <pre><code>git difftool --dir-diff </code></pre> <blockquote> <p>Copy the modified files to a temporary location and perform a directory diff on them.<br /> This mode never prompts before launching the diff tool.</p> </blockquote>... | 119, 606, 94106 | diff, git, kaleidoscope | <h1>Git difftool in Windows to see list of all changed files in addition to file diffs (a la Kaleidoscope)?</h1>
<p>When I do a <code>git difftool</code>, <a href="https://www.kaleidoscopeapp.com/" rel="nofollow noreferrer">Kaleidoscope</a> shows me all the files that have changed in the left sidebar:</p>
<p><a href="... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,873 | git | # Git difftool in Windows to see list of all changed files in addition to file diffs (a la Kaleidoscope)?
When I do a `git difftool`, [Kaleidoscope](https://www.kaleidoscopeapp.com/) shows me all the files that have changed in the left sidebar:
[](https://i.sstatic.net/h4ZHt.png) ... | You can use git difftool in a way which lists all the files (git1.8+ recommended):
```
git difftool --dir-diff
```
> Copy the modified files to a temporary location and perform a directory diff on them.
> This mode never prompts before launching the diff tool.
You can then [integrate it with a BeyondCompare for in... |
14895123 | Auto Version numbering your Android App using Git and Eclipse | 15 | 2013-02-15 12:51:46 | <p>I believe that computers are the best things for doing repetitive tasks. I certainly am not, I either forget, or (mostly) don't do things in a consistent way - which isn't what I want.</p>
<p>One of the things I am likely to do is forget to up the version information in the manifest when I publish a new version of... | 11,354 | 1,484,000 | 2018-11-22 06:17:32 | 14,895,128 | 15 | 2013-02-15 12:51:46 | 1,484,000 | 2013-02-15 12:51:46 | https://stackoverflow.com/q/14895123 | https://stackoverflow.com/a/14895128 | <p>This solution was developed on Linux. I'm sure skilled Windows & Mac developers can adapt it to their platforms, but I am not such a developer. Linux is where my skill set lives.</p>
<p>Git has a nice feature in the <code>git describe --dirty</code> command. It scans back down the commit log and finds the ta... | <p>This solution was developed on Linux. I'm sure skilled Windows & Mac developers can adapt it to their platforms, but I am not such a developer. Linux is where my skill set lives.</p> <p>Git has a nice feature in the <code>git describe --dirty</code> command. It scans back down the commit log and finds the ta... | 81, 119, 1386 | android, git, versioning | <h1>Auto Version numbering your Android App using Git and Eclipse</h1>
<p>I believe that computers are the best things for doing repetitive tasks. I certainly am not, I either forget, or (mostly) don't do things in a consistent way - which isn't what I want.</p>
<p>One of the things I am likely to do is forget to up ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,874 | git | # Auto Version numbering your Android App using Git and Eclipse
I believe that computers are the best things for doing repetitive tasks. I certainly am not, I either forget, or (mostly) don't do things in a consistent way - which isn't what I want.
One of the things I am likely to do is forget to up the version infor... | This solution was developed on Linux. I'm sure skilled Windows & Mac developers can adapt it to their platforms, but I am not such a developer. Linux is where my skill set lives.
Git has a nice feature in the `git describe --dirty` command. It scans back down the commit log and finds the tag and then builds a version ... |
70597195 | Where is source code for git hosted ? Is it at github or some other sites? | 14 | 2022-01-05 17:35:01 | <p>The <a href="https://git-scm.com" rel="noreferrer">git-scm</a> website says that it's at <a href="https://github.com/git/git" rel="noreferrer">github</a> under the download section.</p>
<p>However <a href="https://en.wikipedia.org/wiki/Git" rel="noreferrer">Wikipedia</a> says it's at <a href="https://git.kernel.org/... | 7,408 | 17,843,293 | 2022-01-05 18:23:51 | 70,597,327 | 15 | 2022-01-05 17:45:05 | 1,426,891 | 2022-01-05 18:23:51 | https://stackoverflow.com/q/70597195 | https://stackoverflow.com/a/70597327 | <p><a href="https://git.kernel.org" rel="noreferrer">https://git.kernel.org</a> is correct, specifically <a href="https://git.kernel.org/pub/scm/git/git.git/" rel="noreferrer">https://git.kernel.org/pub/scm/git/git.git/</a>.</p>
<p><a href="https://github.com/git/git" rel="noreferrer">https://github.com/git/git</a> has... | <p><a href="https://git.kernel.org" rel="noreferrer">https://git.kernel.org</a> is correct, specifically <a href="https://git.kernel.org/pub/scm/git/git.git/" rel="noreferrer">https://git.kernel.org/pub/scm/git/git.git/</a>.</p> <p><a href="https://github.com/git/git" rel="noreferrer">https://github.com/git/git</a> has... | 119 | git | <h1>Where is source code for git hosted ? Is it at github or some other sites?</h1>
<p>The <a href="https://git-scm.com" rel="noreferrer">git-scm</a> website says that it's at <a href="https://github.com/git/git" rel="noreferrer">github</a> under the download section.</p>
<p>However <a href="https://en.wikipedia.org/wi... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,875 | git | # Where is source code for git hosted ? Is it at github or some other sites?
The [git-scm](https://git-scm.com) website says that it's at [github](https://github.com/git/git) under the download section.
However [Wikipedia](https://en.wikipedia.org/wiki/Git) says it's at [git.kernel.org](https://git.kernel.org/pub/scm... | <https://git.kernel.org> is correct, specifically <https://git.kernel.org/pub/scm/git/git.git/>.
<https://github.com/git/git> has "About" text that indicates it is a mirror:
> Git Source Code Mirror - This is a publish-only repository but pull requests can be turned into patches to the mailing list via GitGitGadget (... |
48307968 | git worktrees vs "clone --reference" | 14 | 2018-01-17 18:44:44 | <p>What are the pros-cons of using git worktrees vs maintaining multiple clones with <code>--reference</code> flag? The main scenario I am considering is when a developer needs to maintain multiple git repositories on the disk for old releases (release/1.0, release/2.0, release/3.0) because switching branches on a sing... | 5,509 | 1,541,619 | 2018-01-17 21:54:05 | 48,310,629 | 15 | 2018-01-17 21:54:05 | 1,256,452 | 2018-01-17 21:54:05 | https://stackoverflow.com/q/48307968 | https://stackoverflow.com/a/48310629 | <p>They all have a few issues that matter, but using <code>git worktree</code> is probably going to be your best bet.</p>
<ul>
<li><p>A clone, let's call this <em>AD</em> for after-dependency clone, made <em>with</em> <code>--reference <em>local-path</em></code> but <em>without</em> <code>--dissociate</code> uses obje... | <p>They all have a few issues that matter, but using <code>git worktree</code> is probably going to be your best bet.</p> <ul> <li><p>A clone, let's call this <em>AD</em> for after-dependency clone, made <em>with</em> <code>--reference <em>local-path</em></code> but <em>without</em> <code>--dissociate</code> uses obje... | 119, 117020 | git, git-worktree | <h1>git worktrees vs "clone --reference"</h1>
<p>What are the pros-cons of using git worktrees vs maintaining multiple clones with <code>--reference</code> flag? The main scenario I am considering is when a developer needs to maintain multiple git repositories on the disk for old releases (release/1.0, release/2.0, rel... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,879 | git | # git worktrees vs "clone --reference"
What are the pros-cons of using git worktrees vs maintaining multiple clones with `--reference` flag? The main scenario I am considering is when a developer needs to maintain multiple git repositories on the disk for old releases (release/1.0, release/2.0, release/3.0) because sw... | They all have a few issues that matter, but using `git worktree` is probably going to be your best bet.
- A clone, let's call this *AD* for after-dependency clone, made *with* `--reference local-path` but *without* `--dissociate` uses objects from *`local-path`*. By "objects", I mean literal Git objects (stored loosel... |
46514831 | How read the current upstream for a git branch | 14 | 2017-10-01 17:13:29 | <p>I'm searching a git command to know the upstream associated with an existing branch (if any).<br>
(some kind of "read" command associated with the "write" command <code>git branch --set-upstream-to=...</code>)<br>
The reason is I use a branch connected with several remote repos, and I'd like to check if the branch i... | 10,075 | 7,002,315 | 2021-11-15 04:38:13 | 46,516,201 | 15 | 2017-10-01 19:41:25 | 1,256,452 | 2017-10-01 19:41:25 | https://stackoverflow.com/q/46514831 | https://stackoverflow.com/a/46516201 | <h3>TL;DR: use <code>git rev-parse</code></h3>
<pre><code>$ git rev-parse --abbrev-ref master@{u}
weird/master
</code></pre>
<p>If no upstream is set, you get:</p>
<pre><code>fatal: no upstream configured for branch 'master'
</code></pre>
<p>(and a nonzero exit code). Redirect stderr to <code>/dev/null</code> to d... | <h3>TL;DR: use <code>git rev-parse</code></h3> <pre><code>$ git rev-parse --abbrev-ref master@{u} weird/master </code></pre> <p>If no upstream is set, you get:</p> <pre><code>fatal: no upstream configured for branch 'master' </code></pre> <p>(and a nonzero exit code). Redirect stderr to <code>/dev/null</code> to d... | 119, 76220, 115546 | git, git-branch, upstream-branch | <h1>How read the current upstream for a git branch</h1>
<p>I'm searching a git command to know the upstream associated with an existing branch (if any).<br>
(some kind of "read" command associated with the "write" command <code>git branch --set-upstream-to=...</code>)<br>
The reason is I use a branch connected with sev... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,880 | git | # How read the current upstream for a git branch
I'm searching a git command to know the upstream associated with an existing branch (if any).
(some kind of "read" command associated with the "write" command `git branch --set-upstream-to=...`)
The reason is I use a branch connected with several remote repos, and I... | ### TL;DR: use `git rev-parse`
```
$ git rev-parse --abbrev-ref master@{u}
weird/master
```
If no upstream is set, you get:
```
fatal: no upstream configured for branch 'master'
```
(and a nonzero exit code). Redirect stderr to `/dev/null` to discard the error message if you don't want it:
```
if master_upstream=$... |
39994736 | git: show all modified files - staged and not staged | 14 | 2016-10-12 09:09:21 | <p>I need a command which gives me <strong>all modified files</strong> - this includes staged (i.e. newly added files) and non-staged changes - in a <strong>plain list</strong> which I can use in a script. While this question might sound familiar I only find commands that come close to what I want to do:</p>
<pre><cod... | 7,635 | 1,668,622 | 2016-10-12 09:16:17 | 39,994,894 | 15 | 2016-10-12 09:16:17 | 1,668,622 | 2016-10-12 09:16:17 | https://stackoverflow.com/q/39994736 | https://stackoverflow.com/a/39994894 | <pre><code>git diff --name-only HEAD
</code></pre>
<p>looks like what I'm looking for - but I'm not sure yet. If someone comes up with some elaboration I'll take his/her answer :)</p>
| <pre><code>git diff --name-only HEAD </code></pre> <p>looks like what I'm looking for - but I'm not sure yet. If someone comes up with some elaboration I'll take his/her answer :)</p> | 119 | git | <h1>git: show all modified files - staged and not staged</h1>
<p>I need a command which gives me <strong>all modified files</strong> - this includes staged (i.e. newly added files) and non-staged changes - in a <strong>plain list</strong> which I can use in a script. While this question might sound familiar I only find... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,881 | git | # git: show all modified files - staged and not staged
I need a command which gives me **all modified files** - this includes staged (i.e. newly added files) and non-staged changes - in a **plain list** which I can use in a script. While this question might sound familiar I only find commands that come close to what I... | ```
git diff --name-only HEAD
```
looks like what I'm looking for - but I'm not sure yet. If someone comes up with some elaboration I'll take his/her answer :) |
32685568 | git clone writes to sderr, fine but why can't I redirect to stdout | 14 | 2015-09-21 00:01:15 | <p>I figured that <code>git clone</code> uses STDERR.</p>
<p>I now want to redirect it to STDOUT to use this <a href="https://unix.stackexchange.com/a/97958">hack</a>.</p>
<p>I'm having some issues (also, I use great <a href="https://github.com/sickill/stderred" rel="noreferrer">stderred</a> library to color STDERR r... | 7,840 | 458,177 | 2021-02-19 06:56:40 | 32,685,644 | 15 | 2015-09-21 00:14:01 | 14,660 | 2015-09-21 00:14:01 | https://stackoverflow.com/q/32685568 | https://stackoverflow.com/a/32685644 | <p>Like many Unix utilities, <code>git-clone</code> will be quieter if it's redirected to a pipe. The assumption is the output is useful to a human and it will just get in the way of a program. <code>tee</code> breaks this assumption, but <code>git</code> can't know what's at the end of the pipe.</p>
<p>From the <a hre... | <p>Like many Unix utilities, <code>git-clone</code> will be quieter if it's redirected to a pipe. The assumption is the output is useful to a human and it will just get in the way of a program. <code>tee</code> breaks this assumption, but <code>git</code> can't know what's at the end of the pipe.</p> <p>From the <a hre... | 119, 3050, 4867, 19156, 22055 | clone, git, stderr, stdout, tee | <h1>git clone writes to sderr, fine but why can't I redirect to stdout</h1>
<p>I figured that <code>git clone</code> uses STDERR.</p>
<p>I now want to redirect it to STDOUT to use this <a href="https://unix.stackexchange.com/a/97958">hack</a>.</p>
<p>I'm having some issues (also, I use great <a href="https://github.c... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,882 | git | # git clone writes to sderr, fine but why can't I redirect to stdout
I figured that `git clone` uses STDERR.
I now want to redirect it to STDOUT to use this [hack](https://unix.stackexchange.com/a/97958).
I'm having some issues (also, I use great [stderred](https://github.com/sickill/stderred) library to color STDER... | Like many Unix utilities, `git-clone` will be quieter if it's redirected to a pipe. The assumption is the output is useful to a human and it will just get in the way of a program. `tee` breaks this assumption, but `git` can't know what's at the end of the pipe.
From the [git-clone manual](https://www.kernel.org/pub/so... |
31420290 | How can I show just the message for an annotated tag? | 14 | 2015-07-15 02:02:23 | <p>There seem to be ways in git to show the message of an annotated tag as well as the commit detail and other stuff <code>git show the_tag</code>, or the name and the detail <code>git tag -l -n100 the_tag</code>.</p>
<p>But what command shows the message/body and absolutely nothing else?</p>
| 4,076 | 131,227 | 2023-03-18 03:48:49 | 31,420,358 | 15 | 2015-07-15 02:11:33 | 1,290,731 | 2015-07-15 02:11:33 | https://stackoverflow.com/q/31420290 | https://stackoverflow.com/a/31420358 | <p>When the convenience commands are doing too much, go for the core :-)</p>
<pre><code>git for-each-ref refs/tags/$tagname --format='%(contents)'
</code></pre>
<p><sup><a href="https://git-scm.com/docs/git-for-each-ref" rel="noreferrer">for-each-ref docs</a></sup></p>
| <p>When the convenience commands are doing too much, go for the core :-)</p> <pre><code>git for-each-ref refs/tags/$tagname --format='%(contents)' </code></pre> <p><sup><a href="https://git-scm.com/docs/git-for-each-ref" rel="noreferrer">for-each-ref docs</a></sup></p> | 119, 60718 | git, git-tag | <h1>How can I show just the message for an annotated tag?</h1>
<p>There seem to be ways in git to show the message of an annotated tag as well as the commit detail and other stuff <code>git show the_tag</code>, or the name and the detail <code>git tag -l -n100 the_tag</code>.</p>
<p>But what command shows the message/... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,883 | git | # How can I show just the message for an annotated tag?
There seem to be ways in git to show the message of an annotated tag as well as the commit detail and other stuff `git show the_tag`, or the name and the detail `git tag -l -n100 the_tag`.
But what command shows the message/body and absolutely nothing else? | When the convenience commands are doing too much, go for the core :-)
```
git for-each-ref refs/tags/$tagname --format='%(contents)'
```
[for-each-ref docs](https://git-scm.com/docs/git-for-each-ref) |
25449075 | GIT contribution per author (lines) | 14 | 2014-08-22 14:14:08 | <p>I'm trying to print the per-line contribution of each author to a Git repository.</p>
<p>For that, I use the following command, adapted from <a href="https://stackoverflow.com/questions/1265040/how-to-count-total-lines-changed-by-a-specific-author-in-a-git-repository">How to count total lines changed by a specific ... | 4,159 | 2,240,163 | 2023-03-09 20:49:44 | 25,480,975 | 15 | 2014-08-25 07:29:14 | 2,240,163 | 2014-09-08 09:41:23 | https://stackoverflow.com/q/25449075 | https://stackoverflow.com/a/25480975 | <p>Okay, after more investigation I found this on SO.</p>
<blockquote>
<pre><code>git ls-files -z | xargs -0n1 git blame -w | perl -n -e '/^.*?\((.*?)\s+[\d]{4}/; print $1,"\n"' | sort -f | uniq -c | sort -n
</code></pre>
</blockquote>
<p>The answer came with support from <a href="https://stackoverflow.com/users/81... | <p>Okay, after more investigation I found this on SO.</p> <blockquote> <pre><code>git ls-files -z | xargs -0n1 git blame -w | perl -n -e '/^.*?\((.*?)\s+[\d]{4}/; print $1,"\n"' | sort -f | uniq -c | sort -n </code></pre> </blockquote> <p>The answer came with support from <a href="https://stackoverflow.com/users/81... | 119, 29837 | git, line-count | <h1>GIT contribution per author (lines)</h1>
<p>I'm trying to print the per-line contribution of each author to a Git repository.</p>
<p>For that, I use the following command, adapted from <a href="https://stackoverflow.com/questions/1265040/how-to-count-total-lines-changed-by-a-specific-author-in-a-git-repository">Ho... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,884 | git | # GIT contribution per author (lines)
I'm trying to print the per-line contribution of each author to a Git repository.
For that, I use the following command, adapted from [How to count total lines changed by a specific author in a Git repository?](https://stackoverflow.com/questions/1265040/how-to-count-total-lines-... | Okay, after more investigation I found this on SO.
> ```
> git ls-files -z | xargs -0n1 git blame -w | perl -n -e '/^.*?\((.*?)\s+[\d]{4}/; print $1,"\n"' | sort -f | uniq -c | sort -n
> ```
The answer came with support from [*Eric Z*](https://stackoverflow.com/users/816017/erik-z)
RESULT
> ```
> 234926 USER 1
... |
24669528 | Git - temporarily save current work | 14 | 2014-07-10 06:08:49 | <p>I'm adding a feature on master branch. After changing several files, I realize that I need to check the output without my changes.</p>
<p>The way I can think of is:</p>
<ol>
<li>Commit current changes</li>
<li>Check out and switch to a new branch</li>
<li>In the new branch: <code>git reset --hard HEAD^</code> so t... | 12,348 | 558,892 | 2014-07-10 06:13:31 | 24,669,565 | 15 | 2014-07-10 06:11:33 | 3,472,656 | 2014-07-10 06:11:33 | https://stackoverflow.com/q/24669528 | https://stackoverflow.com/a/24669565 | <p>You can simply use <code>git stash</code>, which will store away your change to the local working tree. Then do your things, and when you're done, <code>git stash pop</code> to get things back. See the <a href="http://git-scm.com/book/en/Git-Tools-Stashing" rel="noreferrer">documentation</a> about stashing.</p>
| <p>You can simply use <code>git stash</code>, which will store away your change to the local working tree. Then do your things, and when you're done, <code>git stash pop</code> to get things back. See the <a href="http://git-scm.com/book/en/Git-Tools-Stashing" rel="noreferrer">documentation</a> about stashing.</p> | 119 | git | <h1>Git - temporarily save current work</h1>
<p>I'm adding a feature on master branch. After changing several files, I realize that I need to check the output without my changes.</p>
<p>The way I can think of is:</p>
<ol>
<li>Commit current changes</li>
<li>Check out and switch to a new branch</li>
<li>In the new bra... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,885 | git | # Git - temporarily save current work
I'm adding a feature on master branch. After changing several files, I realize that I need to check the output without my changes.
The way I can think of is:
1. Commit current changes
2. Check out and switch to a new branch
3. In the new branch: `git reset --hard HEAD^` so that ... | You can simply use `git stash`, which will store away your change to the local working tree. Then do your things, and when you're done, `git stash pop` to get things back. See the [documentation](http://git-scm.com/book/en/Git-Tools-Stashing) about stashing. |
16543630 | Smartgit: Moving local changes from stash to branch | 14 | 2013-05-14 12:48:39 | <p>I have local changes which I have stored in stash. I have now (afterwards) created a new branch and want to push my changes from stash to this branch. SmartGit: Local > Apply stash.</p>
<p>When I try to SmartGit asks me: Restore Index (checkbox), what is this? Should I select it or not?</p>
<p><img src="https://i.... | 11,976 | 846,348 | 2013-05-14 12:56:12 | 16,543,794 | 15 | 2013-05-14 12:56:12 | 241,453 | 2013-05-14 12:56:12 | https://stackoverflow.com/q/16543630 | https://stackoverflow.com/a/16543794 | <p>The <strong>Restore Index</strong> option will result in a <code>git stash apply --index</code>. According to <a href="https://www.kernel.org/pub/software/scm/git/docs/git-stash.html">the git man page</a>, this means:</p>
<blockquote>
<p>If the --index option is used, then tries to reinstate not only the
workin... | <p>The <strong>Restore Index</strong> option will result in a <code>git stash apply --index</code>. According to <a href="https://www.kernel.org/pub/software/scm/git/docs/git-stash.html">the git man page</a>, this means:</p> <blockquote> <p>If the --index option is used, then tries to reinstate not only the workin... | 119, 65939 | git, smartgit | <h1>Smartgit: Moving local changes from stash to branch</h1>
<p>I have local changes which I have stored in stash. I have now (afterwards) created a new branch and want to push my changes from stash to this branch. SmartGit: Local > Apply stash.</p>
<p>When I try to SmartGit asks me: Restore Index (checkbox), what is ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,887 | git | # Smartgit: Moving local changes from stash to branch
I have local changes which I have stored in stash. I have now (afterwards) created a new branch and want to push my changes from stash to this branch. SmartGit: Local > Apply stash.
When I try to SmartGit asks me: Restore Index (checkbox), what is this? Should I s... | The **Restore Index** option will result in a `git stash apply --index`. According to [the git man page](https://www.kernel.org/pub/software/scm/git/docs/git-stash.html), this means:
> If the --index option is used, then tries to reinstate not only the
> working tree’s changes, but also the index’s ones. However, this... |
15020237 | How to save the current state of my staging area? | 14 | 2013-02-22 08:55:59 | <p><strong>Question:</strong><br>
I added some files to my staging area. I want to temporarily save this information. How to?</p>
<p><strong>Background:</strong><br>
Sometimes I perform some bigger refactorings. It only really makes sense to commit the complete result.<br>
During this refactoring, I also make some unr... | 7,848 | 572,644 | 2022-09-24 12:21:51 | 15,040,570 | 15 | 2013-02-23 12:32:53 | 390,363 | 2022-09-24 12:21:51 | https://stackoverflow.com/q/15020237 | https://stackoverflow.com/a/15040570 | <p>The following chain of commands should do the trick</p>
<pre><code>git commit -m "temporary" # save current stage are as an actual commit
git commit unrelated_files -m "The other feature"
git stash # hide the rest
git rebase -i HEAD~2 # change the order of two last commits
git reset --soft HEAD^ ... | <p>The following chain of commands should do the trick</p> <pre><code>git commit -m "temporary" # save current stage are as an actual commit git commit unrelated_files -m "The other feature" git stash # hide the rest git rebase -i HEAD~2 # change the order of two last commits git reset --soft HEAD^ ... | 119 | git | <h1>How to save the current state of my staging area?</h1>
<p><strong>Question:</strong><br>
I added some files to my staging area. I want to temporarily save this information. How to?</p>
<p><strong>Background:</strong><br>
Sometimes I perform some bigger refactorings. It only really makes sense to commit the complet... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,888 | git | # How to save the current state of my staging area?
**Question:**
I added some files to my staging area. I want to temporarily save this information. How to?
**Background:**
Sometimes I perform some bigger refactorings. It only really makes sense to commit the complete result.
During this refactoring, I also ma... | The following chain of commands should do the trick
```
git commit -m "temporary" # save current stage are as an actual commit
git commit unrelated_files -m "The other feature"
git stash # hide the rest
git rebase -i HEAD~2 # change the order of two last commits
git reset --soft HEAD^ # rollback the "temporary" commit... |
8560696 | git stash pop vs git rebase | 14 | 2011-12-19 11:33:41 | <p>I always use git rebase to sync my code, I found that <code>git stash</code> saves the current work and after fetching the latest code from master we can merge it with our code by using <code>git stash pop</code>.</p>
<p>Suppose the sequence is:</p>
<ul>
<li><code>git stash</code>, i.e. my current work is saved</l... | 9,817 | 824,217 | 2012-09-20 17:54:00 | 8,560,817 | 15 | 2011-12-19 11:44:30 | 216,074 | 2011-12-19 11:44:30 | https://stackoverflow.com/q/8560696 | https://stackoverflow.com/a/8560817 | <p>The stash is meant to store changes that are not meant to be commited yet. For example if you are working on something that isn't done yet, and you want to work on something else for a while without committing the unfinished work, then you use a stash to store it for later use.</p>
<p>If you however have actual com... | <p>The stash is meant to store changes that are not meant to be commited yet. For example if you are working on something that isn't done yet, and you want to work on something else for a while without committing the unfinished work, then you use a stash to store it for later use.</p> <p>If you however have actual com... | 119 | git | <h1>git stash pop vs git rebase</h1>
<p>I always use git rebase to sync my code, I found that <code>git stash</code> saves the current work and after fetching the latest code from master we can merge it with our code by using <code>git stash pop</code>.</p>
<p>Suppose the sequence is:</p>
<ul>
<li><code>git stash</co... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,889 | git | # git stash pop vs git rebase
I always use git rebase to sync my code, I found that `git stash` saves the current work and after fetching the latest code from master we can merge it with our code by using `git stash pop`.
Suppose the sequence is:
- `git stash`, i.e. my current work is saved
- `git checkout master`, ... | The stash is meant to store changes that are not meant to be commited yet. For example if you are working on something that isn't done yet, and you want to work on something else for a while without committing the unfinished work, then you use a stash to store it for later use.
If you however have actual commits, that... |
8451480 | "RA layer request failed: REPORT request failed" during git-svn | 14 | 2011-12-09 20:44:04 | <p>I've been trying to Git clone a Google Code SVN repository using the following command:</p>
<pre><code>git svn clone --stdlayout https://wtorrent-project.googlecode.com/svn/ wtorrent-git
</code></pre>
<p>It gets as far as r11, then gives the following error message:</p>
<pre><code>r11 = 6e04c0fb14aa3f6ab4d871eeed... | 11,822 | 21,322 | 2025-03-11 08:22:10 | 8,453,329 | 15 | 2011-12-10 00:18:57 | 526,535 | 2011-12-10 00:24:29 | https://stackoverflow.com/q/8451480 | https://stackoverflow.com/a/8453329 | <p>Revision 12 and hence 13, 14 are messed up ( someone added a branch trunk in branches, but later deleted it, and that confuses git-svn). You might want to do:</p>
<pre><code>git svn clone -r 1:11 --stdlayout https://wtorrent-project.googlecode.com/svn/ wtorrent-git
cd wtorrent-git
git svn fetch -r 15:HEAD
</code></... | <p>Revision 12 and hence 13, 14 are messed up ( someone added a branch trunk in branches, but later deleted it, and that confuses git-svn). You might want to do:</p> <pre><code>git svn clone -r 1:11 --stdlayout https://wtorrent-project.googlecode.com/svn/ wtorrent-git cd wtorrent-git git svn fetch -r 15:HEAD </code></... | 63, 119, 6452 | git, git-svn, svn | <h1>"RA layer request failed: REPORT request failed" during git-svn</h1>
<p>I've been trying to Git clone a Google Code SVN repository using the following command:</p>
<pre><code>git svn clone --stdlayout https://wtorrent-project.googlecode.com/svn/ wtorrent-git
</code></pre>
<p>It gets as far as r11, then gives the ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,890 | git | # "RA layer request failed: REPORT request failed" during git-svn
I've been trying to Git clone a Google Code SVN repository using the following command:
```
git svn clone --stdlayout https://wtorrent-project.googlecode.com/svn/ wtorrent-git
```
It gets as far as r11, then gives the following error message:
```
r11... | Revision 12 and hence 13, 14 are messed up ( someone added a branch trunk in branches, but later deleted it, and that confuses git-svn). You might want to do:
```
git svn clone -r 1:11 --stdlayout https://wtorrent-project.googlecode.com/svn/ wtorrent-git
cd wtorrent-git
git svn fetch -r 15:HEAD
``` |
6631337 | Are there different meanings to the concept of 'tracking' in git? | 14 | 2011-07-08 22:48:30 | <p>I run 'git branch -r' and get</p>
<blockquote>
<p>origin/branch1</p>
<p>origin/branch2</p>
</blockquote>
<p>From the man page, the -r option will "list or delete (if used with -d) the remote-tracking branches". So origin/branch1 and origin/branch2 are known as remote-tracking branches. However, you can't... | 839 | 836,203 | 2017-11-10 15:50:00 | 6,631,524 | 15 | 2011-07-08 23:18:01 | 223,092 | 2011-07-08 23:24:48 | https://stackoverflow.com/q/6631337 | https://stackoverflow.com/a/6631524 | <p>This is a good question about a particularly annoying bit of git terminology, albeit one that the project seems to be slowly fixing.</p>
<p>Basically, "track" means something very different in the expressions (a) "remote-tracking branch" and (b) "<code>branch1</code> set up to track remote branch <code>branch1</cod... | <p>This is a good question about a particularly annoying bit of git terminology, albeit one that the project seems to be slowly fixing.</p> <p>Basically, "track" means something very different in the expressions (a) "remote-tracking branch" and (b) "<code>branch1</code> set up to track remote branch <code>branch1</cod... | 119, 1879, 2892, 37230 | branch, git, git-checkout, tracking | <h1>Are there different meanings to the concept of 'tracking' in git?</h1>
<p>I run 'git branch -r' and get</p>
<blockquote>
<p>origin/branch1</p>
<p>origin/branch2</p>
</blockquote>
<p>From the man page, the -r option will "list or delete (if used with -d) the remote-tracking branches". So origin/branch1 an... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,891 | git | # Are there different meanings to the concept of 'tracking' in git?
I run 'git branch -r' and get
> origin/branch1
>
> origin/branch2
From the man page, the -r option will "list or delete (if used with -d) the remote-tracking branches". So origin/branch1 and origin/branch2 are known as remote-tracking branches. Howe... | This is a good question about a particularly annoying bit of git terminology, albeit one that the project seems to be slowly fixing.
Basically, "track" means something very different in the expressions (a) "remote-tracking branch" and (b) "`branch1` set up to track remote branch `branch1` from `origin`". Here's a quic... |
6018256 | export a file from a different git branch | 14 | 2011-05-16 13:37:05 | <p>Is there a simple way to export a single file from different git branch (local or remote) without checking out that branch?</p>
| 1,689 | 300,079 | 2011-05-16 13:59:46 | 6,018,314 | 15 | 2011-05-16 13:41:43 | 223,092 | 2011-05-16 13:41:43 | https://stackoverflow.com/q/6018256 | https://stackoverflow.com/a/6018314 | <p>You can do the following:</p>
<pre><code> git show experiment:docs/README.txt > /tmp/exported-README.txt
</code></pre>
<p>... for a local branch <code>experiment</code>. For a branch that's in the repository you're referring to with the remote <code>origin</code>, you can do the following, similarly:</p>
<pre... | <p>You can do the following:</p> <pre><code> git show experiment:docs/README.txt > /tmp/exported-README.txt </code></pre> <p>... for a local branch <code>experiment</code>. For a branch that's in the repository you're referring to with the remote <code>origin</code>, you can do the following, similarly:</p> <pre... | 119 | git | <h1>export a file from a different git branch</h1>
<p>Is there a simple way to export a single file from different git branch (local or remote) without checking out that branch?</p>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,892 | git | # export a file from a different git branch
Is there a simple way to export a single file from different git branch (local or remote) without checking out that branch? | You can do the following:
```
git show experiment:docs/README.txt > /tmp/exported-README.txt
```
... for a local branch `experiment`. For a branch that's in the repository you're referring to with the remote `origin`, you can do the following, similarly:
```
git fetch origin
git show origin/other-experiment:docs/... |
5574566 | How do I preserve tags when filtering a repository? | 14 | 2011-04-07 00:36:31 | <p>Is there a way to move a repository, <strong>and all its tags</strong>, to be a subdirectory of another repository in an automated fashion?</p>
<p>For reasons, a project was split into multiple repositories. Now we see that wasn't such a hot idea and want to bring it back together again. Submodules were considere... | 3,622 | 14,660 | 2011-04-07 01:25:06 | 5,574,694 | 15 | 2011-04-07 00:58:00 | 14,660 | 2011-04-07 01:25:06 | https://stackoverflow.com/q/5574566 | https://stackoverflow.com/a/5574694 | <p>I think I can answer my own question. Adding <code>--tag-name-filter cat</code> to the <code>git-filter-branch</code> call. <code>-- --all</code> does all the branches and tags at once speeding up the conversion considerably. Here's the full call.</p>
<pre><code> git filter-branch --tree-filter 'move-to-subdir $... | <p>I think I can answer my own question. Adding <code>--tag-name-filter cat</code> to the <code>git-filter-branch</code> call. <code>-- --all</code> does all the branches and tags at once speeding up the conversion considerably. Here's the full call.</p> <pre><code> git filter-branch --tree-filter 'move-to-subdir $... | 119, 46509 | git, git-filter-branch | <h1>How do I preserve tags when filtering a repository?</h1>
<p>Is there a way to move a repository, <strong>and all its tags</strong>, to be a subdirectory of another repository in an automated fashion?</p>
<p>For reasons, a project was split into multiple repositories. Now we see that wasn't such a hot idea and wan... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,893 | git | # How do I preserve tags when filtering a repository?
Is there a way to move a repository, **and all its tags**, to be a subdirectory of another repository in an automated fashion?
For reasons, a project was split into multiple repositories. Now we see that wasn't such a hot idea and want to bring it back together ag... | I think I can answer my own question. Adding `--tag-name-filter cat` to the `git-filter-branch` call. `-- --all` does all the branches and tags at once speeding up the conversion considerably. Here's the full call.
```
git filter-branch --tree-filter 'move-to-subdir $subdir' --prune-empty --tag-name-filter cat -- --a... |
64372092 | how to find commits in a given file containing a specific text? | 13 | 2020-10-15 12:56:27 | <p>There is a file in my git repo which was changed a lot of times. I want to know the revisions in which a specific text was present in this file.</p>
<p>Is there a git command to get this information?</p>
<p>Something like:</p>
<pre><code>git find "specific_text" -- /frequently/modified/file
</code></pre>
<... | 1,977 | 383,638 | 2022-10-27 19:50:18 | 64,372,715 | 15 | 2020-10-15 13:32:06 | 86,072 | 2022-10-27 19:50:18 | https://stackoverflow.com/q/64372092 | https://stackoverflow.com/a/64372715 | <p><code>git grep <pattern></code> will search <em>only one commit</em>.</p>
<p>If you want to search <em>all of git's history</em>, use one of the pickaxe options :</p>
<pre><code>git log -G "specific_text" -- frequently/modified/file
# or :
git log -S "specific_text" -- frequently/modified/f... | <p><code>git grep <pattern></code> will search <em>only one commit</em>.</p> <p>If you want to search <em>all of git's history</em>, use one of the pickaxe options :</p> <pre><code>git log -G "specific_text" -- frequently/modified/file # or : git log -S "specific_text" -- frequently/modified/f... | 119 | git | <h1>how to find commits in a given file containing a specific text?</h1>
<p>There is a file in my git repo which was changed a lot of times. I want to know the revisions in which a specific text was present in this file.</p>
<p>Is there a git command to get this information?</p>
<p>Something like:</p>
<pre><code>git fi... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,894 | git | # how to find commits in a given file containing a specific text?
There is a file in my git repo which was changed a lot of times. I want to know the revisions in which a specific text was present in this file.
Is there a git command to get this information?
Something like:
```
git find "specific_text" -- /frequent... | `git grep <pattern>` will search *only one commit*.
If you want to search *all of git's history*, use one of the pickaxe options :
```
git log -G "specific_text" -- frequently/modified/file
# or :
git log -S "specific_text" -- frequently/modified/file
```
The difference between the two is [explained in the docs](htt... |
64001471 | Pylint with pre-commit and EsLlint with husky | 13 | 2020-09-22 00:22:54 | <p>I have a project with a frontend in JS and backend in Python.
Frontend had been configured with husky pre-commit hook.
Today I've configured Pylint with pre-commit library but husky hooks had been overwritten by that move.
Is it possible to combine pre-commit and husky libraries?
If not... what's the best way to sol... | 9,724 | 7,248,743 | 2021-08-26 22:39:31 | 64,002,300 | 15 | 2020-09-22 02:35:20 | 812,183 | 2020-09-22 02:35:20 | https://stackoverflow.com/q/64001471 | https://stackoverflow.com/a/64002300 | <p>pre-commit has a "migration mode" for running other existing hook frameworks. It seems that husky is slightly too clever in their hook implementation for detecting what hook you're running -- they base it on the filename that's being executed</p>
<p>the way pre-commit's migration mode works is it takes an... | <p>pre-commit has a "migration mode" for running other existing hook frameworks. It seems that husky is slightly too clever in their hook implementation for detecting what hook you're running -- they base it on the filename that's being executed</p> <p>the way pre-commit's migration mode works is it takes an... | 119, 8046, 94800, 130301, 139402 | eslint, git, git-husky, pre-commit.com, pylint | <h1>Pylint with pre-commit and EsLlint with husky</h1>
<p>I have a project with a frontend in JS and backend in Python.
Frontend had been configured with husky pre-commit hook.
Today I've configured Pylint with pre-commit library but husky hooks had been overwritten by that move.
Is it possible to combine pre-commit an... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,895 | git | # Pylint with pre-commit and EsLlint with husky
I have a project with a frontend in JS and backend in Python.
Frontend had been configured with husky pre-commit hook.
Today I've configured Pylint with pre-commit library but husky hooks had been overwritten by that move.
Is it possible to combine pre-commit and husky l... | pre-commit has a "migration mode" for running other existing hook frameworks. It seems that husky is slightly too clever in their hook implementation for detecting what hook you're running -- they base it on the filename that's being executed
the way pre-commit's migration mode works is it takes any existing hook scri... |
46611465 | git combining two files into one with history preserved | 13 | 2017-10-06 17:59:27 | <p>Imagine that you have two files in a git repository, say <code>A.txt</code> and <code>B.txt</code>.</p>
<p>Is it possible to concat the two files into a third one <code>A+B.txt</code>, removing the original <code>A.txt</code> and <code>B.txt</code> and committing it all, so the history is still preserved?</p>
<p>Tha... | 5,930 | 2,007,760 | 2022-08-07 22:07:11 | 58,702,049 | 15 | 2019-11-04 22:34:28 | 1,366,033 | 2021-01-26 02:02:29 | https://stackoverflow.com/q/46611465 | https://stackoverflow.com/a/58702049 | <p>The long answer is 'yes'!</p>
<p>Full credit to Raymond Chen's article <a href="https://devblogs.microsoft.com/oldnewthing/20190514-00/?p=102493" rel="noreferrer"><strong>Combining two files into one while preserving line history</strong></a>:</p>
<p>Imagine you had two files: <code>fruits</code> & <code>veggies... | <p>The long answer is 'yes'!</p> <p>Full credit to Raymond Chen's article <a href="https://devblogs.microsoft.com/oldnewthing/20190514-00/?p=102493" rel="noreferrer"><strong>Combining two files into one while preserving line history</strong></a>:</p> <p>Imagine you had two files: <code>fruits</code> & <code>veggies... | 119, 717, 5310 | file, git, merge | <h1>git combining two files into one with history preserved</h1>
<p>Imagine that you have two files in a git repository, say <code>A.txt</code> and <code>B.txt</code>.</p>
<p>Is it possible to concat the two files into a third one <code>A+B.txt</code>, removing the original <code>A.txt</code> and <code>B.txt</code> and... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,897 | git | # git combining two files into one with history preserved
Imagine that you have two files in a git repository, say `A.txt` and `B.txt`.
Is it possible to concat the two files into a third one `A+B.txt`, removing the original `A.txt` and `B.txt` and committing it all, so the history is still preserved?
That is, if I ... | The long answer is 'yes'!
Full credit to Raymond Chen's article [**Combining two files into one while preserving line history**](https://devblogs.microsoft.com/oldnewthing/20190514-00/?p=102493):
Imagine you had two files: `fruits` & `veggies`
[. </p>
<p>I have found some code to rename - </p>
<pre><code>git filter-branch --env-filter '
OLD_EMAIL="old@gmail.com"
CORRECT_NAME="name"
CORRECT_EMAIL="new@gmail.com"
if [ "$GIT_COM... | 9,014 | 6,025,646 | 2023-09-16 13:57:41 | 39,235,609 | 15 | 2016-08-30 19:27:16 | 3,987,705 | 2016-08-30 19:27:16 | https://stackoverflow.com/q/39232800 | https://stackoverflow.com/a/39235609 | <p>You can do it like this:</p>
<ol>
<li><p>Create a new branch based on the commit you want to start with:</p>
<pre><code>git checkout -b <branch-name> <base-commit>
</code></pre></li>
<li><p>Cherry-pick all commits that don’t have the matching author:</p>
<pre><code>git log --author "<name>" --in... | <p>You can do it like this:</p> <ol> <li><p>Create a new branch based on the commit you want to start with:</p> <pre><code>git checkout -b <branch-name> <base-commit> </code></pre></li> <li><p>Cherry-pick all commits that don’t have the matching author:</p> <pre><code>git log --author "<name>" --in... | 119, 108991 | git, git-filter | <h1>Remove all commits by author</h1>
<p>How do I remove all commits by certain author (committed by mistake - such an author should not be visible in the commits history). </p>
<p>I have found some code to rename - </p>
<pre><code>git filter-branch --env-filter '
OLD_EMAIL="old@gmail.com"
CORRECT_NAME="name"
CORREC... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,900 | git | # Remove all commits by author
How do I remove all commits by certain author (committed by mistake - such an author should not be visible in the commits history).
I have found some code to rename -
```
git filter-branch --env-filter '
OLD_EMAIL="old@gmail.com"
CORRECT_NAME="name"
CORRECT_EMAIL="new@gmail.com"
if [ "... | You can do it like this:
1. Create a new branch based on the commit you want to start with:
```
git checkout -b <branch-name> <base-commit>
```
2. Cherry-pick all commits that don’t have the matching author:
```
git log --author "<name>" --invert-grep --reverse --format="format:%H" HEAD..master | xarg... |
33008916 | Expected Committer Name Git Push Issue | 13 | 2015-10-08 07:08:26 | <p>I'm trying to commit/Push some code to GIT, but when I tried to commit the code using SourceTree it gave me an error: </p>
<pre><code>remote: Push rejected.[K
remote:
remote: refs/heads/Branch Details: 6a5d6d4cdd53db591e53db78c51225a619af487f: expected committer name 'Your Name Complete' but found 'Your Name'[K
re... | 49,876 | 1,410,342 | 2022-03-20 20:00:16 | 33,009,142 | 15 | 2015-10-08 07:20:38 | 6,309 | 2015-11-24 15:56:53 | https://stackoverflow.com/q/33008916 | https://stackoverflow.com/a/33009142 | <p>Following the example of <a href="http://www.mattshelton.net/2015/08/12/changing-the-author-of-a-single-tag-in-git/" rel="noreferrer">this blog post</a> (it was for a tag, in your case it is for a branch HEAD), you would need to amend at least just the branch HEAD you want to push:</p>
<pre><code>git commit --amend... | <p>Following the example of <a href="http://www.mattshelton.net/2015/08/12/changing-the-author-of-a-single-tag-in-git/" rel="noreferrer">this blog post</a> (it was for a tag, in your case it is for a branch HEAD), you would need to amend at least just the branch HEAD you want to push:</p> <pre><code>git commit --amend... | 119, 4236 | git, push | <h1>Expected Committer Name Git Push Issue</h1>
<p>I'm trying to commit/Push some code to GIT, but when I tried to commit the code using SourceTree it gave me an error: </p>
<pre><code>remote: Push rejected.[K
remote:
remote: refs/heads/Branch Details: 6a5d6d4cdd53db591e53db78c51225a619af487f: expected committer name... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,902 | git | # Expected Committer Name Git Push Issue
I'm trying to commit/Push some code to GIT, but when I tried to commit the code using SourceTree it gave me an error:
```
remote: Push rejected.[K
remote:
remote: refs/heads/Branch Details: 6a5d6d4cdd53db591e53db78c51225a619af487f: expected committer name 'Your Name Complete'... | Following the example of [this blog post](http://www.mattshelton.net/2015/08/12/changing-the-author-of-a-single-tag-in-git/) (it was for a tag, in your case it is for a branch HEAD), you would need to amend at least just the branch HEAD you want to push:
```
git commit --amend --allow-empty --author="LastName, FirstNa... |
27771979 | How can I quickly check the value of ORIG_HEAD? | 13 | 2015-01-05 00:37:37 | <p>I would just like to echo the value of ORIG_HEAD at the command line -- how can I do this? To no avail I tried:</p>
<pre><code>$ echo $ORIG_HEAD
</code></pre>
<p>and</p>
<pre><code>$ git echo $ORIG_HEAD
</code></pre>
| 3,041 | 1,701,170 | 2022-04-19 20:48:36 | 27,771,992 | 15 | 2015-01-05 00:40:23 | 1,565,862 | 2015-01-05 00:40:23 | https://stackoverflow.com/q/27771979 | https://stackoverflow.com/a/27771992 | <p>You can see what commit <code>ORIG_HEAD</code> points to by using the <code>log</code> command of git:</p>
<pre><code>git log -1 ORIG_HEAD
</code></pre>
<hr>
<p>What you tried, <code>$ORIG_HEAD</code> is parsed by your shell, treating it as a variable that was probably not set so effectively running </p>
<pre><c... | <p>You can see what commit <code>ORIG_HEAD</code> points to by using the <code>log</code> command of git:</p> <pre><code>git log -1 ORIG_HEAD </code></pre> <hr> <p>What you tried, <code>$ORIG_HEAD</code> is parsed by your shell, treating it as a variable that was probably not set so effectively running </p> <pre><c... | 119 | git | <h1>How can I quickly check the value of ORIG_HEAD?</h1>
<p>I would just like to echo the value of ORIG_HEAD at the command line -- how can I do this? To no avail I tried:</p>
<pre><code>$ echo $ORIG_HEAD
</code></pre>
<p>and</p>
<pre><code>$ git echo $ORIG_HEAD
</code></pre>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,906 | git | # How can I quickly check the value of ORIG_HEAD?
I would just like to echo the value of ORIG_HEAD at the command line -- how can I do this? To no avail I tried:
```
$ echo $ORIG_HEAD
```
and
```
$ git echo $ORIG_HEAD
``` | You can see what commit `ORIG_HEAD` points to by using the `log` command of git:
```
git log -1 ORIG_HEAD
```
---
What you tried, `$ORIG_HEAD` is parsed by your shell, treating it as a variable that was probably not set so effectively running
```
echo
git echo
```
Where `git echo` is an invalid git command. |
25416808 | How to make a temporary checkpoint (not a commit)? | 13 | 2014-08-21 01:04:27 | <p>I am working on a project and I am about to do something experimental.</p>
<p>I am not ready to make a commit however.</p>
<p>Is it possible to make a checkpoint that I can revert to? Git stash does not appear to be appropriate in this case as I want to work on the same branch.</p>
| 10,671 | 1,500,199 | 2025-08-28 03:58:13 | 25,416,852 | 15 | 2014-08-21 01:10:16 | 240,443 | 2025-08-28 03:58:13 | https://stackoverflow.com/q/25416808 | https://stackoverflow.com/a/25416852 | <p>Why do you want to work on the same branch? Make a new branch, say <code>git checkout -b feature/ni_shrubbery</code>, commit on it, then either merge it back or don't. You can always get back to your <code>master</code> or <code>develop</code> or <code>feature/shrubbery</code>, whatever you're developing on. Branche... | <p>Why do you want to work on the same branch? Make a new branch, say <code>git checkout -b feature/ni_shrubbery</code>, commit on it, then either merge it back or don't. You can always get back to your <code>master</code> or <code>develop</code> or <code>feature/shrubbery</code>, whatever you're developing on. Branche... | 119 | git | <h1>How to make a temporary checkpoint (not a commit)?</h1>
<p>I am working on a project and I am about to do something experimental.</p>
<p>I am not ready to make a commit however.</p>
<p>Is it possible to make a checkpoint that I can revert to? Git stash does not appear to be appropriate in this case as I want to w... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,907 | git | # How to make a temporary checkpoint (not a commit)?
I am working on a project and I am about to do something experimental.
I am not ready to make a commit however.
Is it possible to make a checkpoint that I can revert to? Git stash does not appear to be appropriate in this case as I want to work on the same branch. | Why do you want to work on the same branch? Make a new branch, say `git checkout -b feature/ni_shrubbery`, commit on it, then either merge it back or don't. You can always get back to your `master` or `develop` or `feature/shrubbery`, whatever you're developing on. Branches exist *exactly* for this scenario. Just don't... |
23748973 | Is it neccessary to update git branch before merging it to develop / master? | 13 | 2014-05-19 23:57:07 | <p>Consider a scenario in which I have created a branch from master called "Feature 1". My friend also created a branch from master called "Feature 2". He finished his code changes and merged "Feature 2" branch back to master.</p>
<p>Now I have completed my changes in "Feature 1" branch and want to merge back to maste... | 13,219 | 3,654,598 | 2014-05-20 00:37:17 | 23,749,066 | 15 | 2014-05-20 00:10:20 | 172,363 | 2014-05-20 00:37:17 | https://stackoverflow.com/q/23748973 | https://stackoverflow.com/a/23749066 | <p>It's not necessary to update your master branch before you merge your feature branch into it. However, that is not the best practice. You are better off doing the following:</p>
<ol>
<li>Pull master branch and sure it is up to date with your remote.</li>
<li>Merge/rebase your master branch into your feature branc... | <p>It's not necessary to update your master branch before you merge your feature branch into it. However, that is not the best practice. You are better off doing the following:</p> <ol> <li>Pull master branch and sure it is up to date with your remote.</li> <li>Merge/rebase your master branch into your feature branc... | 119, 28897 | git, git-merge | <h1>Is it neccessary to update git branch before merging it to develop / master?</h1>
<p>Consider a scenario in which I have created a branch from master called "Feature 1". My friend also created a branch from master called "Feature 2". He finished his code changes and merged "Feature 2" branch back to master.</p>
<p... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,908 | git | # Is it neccessary to update git branch before merging it to develop / master?
Consider a scenario in which I have created a branch from master called "Feature 1". My friend also created a branch from master called "Feature 2". He finished his code changes and merged "Feature 2" branch back to master.
Now I have comp... | It's not necessary to update your master branch before you merge your feature branch into it. However, that is not the best practice. You are better off doing the following:
1. Pull master branch and sure it is up to date with your remote.
2. Merge/rebase your master branch into your feature branch
3. Fix any merge co... |
21011749 | Making git output full (un-abbreviated) hashes for all commands? | 13 | 2014-01-09 04:44:41 | <h1>Question Update</h1>
<p>(n.b. I've accepted Roland's answer, as it is indeed the correct (and
simplest) solution starting from git 1.7.4.4, but please consider this question
open regarding earlier versions of git down to 1.7.0.4.)</p>
<p>This question is a bit rambling (primarily due to the edits resulting from m... | 1,687 | 324,105 | 2024-08-04 04:55:19 | 23,322,762 | 15 | 2014-04-27 11:23:32 | 1,219,295 | 2014-05-04 10:40:20 | https://stackoverflow.com/q/21011749 | https://stackoverflow.com/a/23322762 | <p>Using <code>git -c core.abbrev=40 <command></code> is supposed to work on all commands because it "will override whatever is defined in the config files".</p>
<p>It seems to have been introduced in <a href="https://github.com/git/git/commit/8b1fa778676ae94f7a6d4113fa90947b548154dd" rel="nofollow"><code>8b1fa7... | <p>Using <code>git -c core.abbrev=40 <command></code> is supposed to work on all commands because it "will override whatever is defined in the config files".</p> <p>It seems to have been introduced in <a href="https://github.com/git/git/commit/8b1fa778676ae94f7a6d4113fa90947b548154dd" rel="nofollow"><code>8b1fa7... | 119 | git | <h1>Making git output full (un-abbreviated) hashes for all commands?</h1>
<h1>Question Update</h1>
<p>(n.b. I've accepted Roland's answer, as it is indeed the correct (and
simplest) solution starting from git 1.7.4.4, but please consider this question
open regarding earlier versions of git down to 1.7.0.4.)</p>
<p>Th... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,909 | git | # Making git output full (un-abbreviated) hashes for all commands?
# Question Update
(n.b. I've accepted Roland's answer, as it is indeed the correct (and
simplest) solution starting from git 1.7.4.4, but please consider this question
open regarding earlier versions of git down to 1.7.0.4.)
This question is a bit ra... | Using `git -c core.abbrev=40 <command>` is supposed to work on all commands because it "will override whatever is defined in the config files".
It seems to have been introduced in [`8b1fa778676ae94f7a6d4113fa90947b548154dd`](https://github.com/git/git/commit/8b1fa778676ae94f7a6d4113fa90947b548154dd) (landed in version... |
12318336 | Problems with git reset --hard after adding .gitattribute -- local changes that should not be there | 13 | 2012-09-07 12:41:02 | <p>I have observed CRLF problems after merging bundles from my colleague. Sometimes lines with LF were mixed into the sources, probably the ones that were merged into. Therefore, we have decided to add the <code>.gitattributes</code> file with the following content (comments removed):</p>
<pre><code>*.cpp text
*.h tex... | 4,118 | 1,346,705 | 2015-03-03 09:55:38 | 22,098,996 | 15 | 2014-02-28 15:19:12 | 2,883,328 | 2014-03-18 18:36:13 | https://stackoverflow.com/q/12318336 | https://stackoverflow.com/a/22098996 | <h2>The Cause</h2>
<p>It is <code>* text=auto</code> setting in <code>.gitattributes</code> that causes this issue. You can remove it and live happily ever after, but you may have files with non-repo-default line encodings, or even files with several different line ending encoding (i.e. both LF and CRLF, and even CR!... | <h2>The Cause</h2> <p>It is <code>* text=auto</code> setting in <code>.gitattributes</code> that causes this issue. You can remove it and live happily ever after, but you may have files with non-repo-default line encodings, or even files with several different line ending encoding (i.e. both LF and CRLF, and even CR!... | 64, 119, 56102 | git, gitattributes, windows | <h1>Problems with git reset --hard after adding .gitattribute -- local changes that should not be there</h1>
<p>I have observed CRLF problems after merging bundles from my colleague. Sometimes lines with LF were mixed into the sources, probably the ones that were merged into. Therefore, we have decided to add the <code... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,910 | git | # Problems with git reset --hard after adding .gitattribute -- local changes that should not be there
I have observed CRLF problems after merging bundles from my colleague. Sometimes lines with LF were mixed into the sources, probably the ones that were merged into. Therefore, we have decided to add the `.gitattribute... | ## The Cause
It is `* text=auto` setting in `.gitattributes` that causes this issue. You can remove it and live happily ever after, but you may have files with non-repo-default line encodings, or even files with several different line ending encoding (i.e. both LF and CRLF, and even CR!) in your repo.
## Why This Hap... |
19488902 | Ignore parent directory in Git version control | 13 | 2013-10-21 07:52:38 | <p>How to ignore parent directory in <code>.gitignore</code>?
I tried this patterns, but seems they are don't work:</p>
<pre><code>/../*
../
../*
</code></pre>
| 24,439 | 921,193 | 2021-11-27 23:38:19 | 19,489,007 | 15 | 2013-10-21 07:58:30 | 6,309 | 2013-10-21 07:58:30 | https://stackoverflow.com/q/19488902 | https://stackoverflow.com/a/19489007 | <p>You can't, if you want your <code>.gitignore</code> to be versioned.</p>
<p>And if it is versioned, that means elements of the parent folder is versioned as well (and cannot be ignored without removing from the index all of its content).<br>
<a href="https://stackoverflow.com/users/421223/kingcrunch">Kingcrunch</a>... | <p>You can't, if you want your <code>.gitignore</code> to be versioned.</p> <p>And if it is versioned, that means elements of the parent folder is versioned as well (and cannot be ignored without removing from the index all of its content).<br> <a href="https://stackoverflow.com/users/421223/kingcrunch">Kingcrunch</a>... | 119, 25056 | git, gitignore | <h1>Ignore parent directory in Git version control</h1>
<p>How to ignore parent directory in <code>.gitignore</code>?
I tried this patterns, but seems they are don't work:</p>
<pre><code>/../*
../
../*
</code></pre>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,912 | git | # Ignore parent directory in Git version control
How to ignore parent directory in `.gitignore`?
I tried this patterns, but seems they are don't work:
```
/../*
../
../*
``` | You can't, if you want your `.gitignore` to be versioned.
And if it is versioned, that means elements of the parent folder is versioned as well (and cannot be ignored without removing from the index all of its content).
[Kingcrunch](https://stackoverflow.com/users/421223/kingcrunch) [comments](https://stackoverflow.... |
17224778 | Sourcetree and GitFlow - not showing color branches | 13 | 2013-06-20 22:14:58 | <p>Code base getting large. Decided to get better at GIT...</p>
<p>I am using xCode and decided to move away from xcode git and to SourceTree. I am keeping my code local on my machine but would like to get into the git flow habit. I opened Sourcetree and imported my project. All looks good. </p>
<p>I did a final comm... | 4,763 | 659,463 | 2014-03-16 16:03:47 | 17,230,616 | 15 | 2013-06-21 08:19:26 | 477,037 | 2013-06-21 08:19:26 | https://stackoverflow.com/q/17224778 | https://stackoverflow.com/a/17230616 | <p>You're getting a flat graph because you have a flat history:</p>
<p><img src="https://i.sstatic.net/KkXek.png" width="300" height="88" alt="" /></p>
<p>As soon as you're committing to another branch, the difference is shown:</p>
<pre><code>git checkout develop
# make some changes
git commit -m "Changes to develop... | <p>You're getting a flat graph because you have a flat history:</p> <p><img src="https://i.sstatic.net/KkXek.png" width="300" height="88" alt="" /></p> <p>As soon as you're committing to another branch, the difference is shown:</p> <pre><code>git checkout develop # make some changes git commit -m "Changes to develop... | 119, 64339, 90056 | atlassian-sourcetree, git, git-flow | <h1>Sourcetree and GitFlow - not showing color branches</h1>
<p>Code base getting large. Decided to get better at GIT...</p>
<p>I am using xCode and decided to move away from xcode git and to SourceTree. I am keeping my code local on my machine but would like to get into the git flow habit. I opened Sourcetree and imp... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,914 | git | # Sourcetree and GitFlow - not showing color branches
Code base getting large. Decided to get better at GIT...
I am using xCode and decided to move away from xcode git and to SourceTree. I am keeping my code local on my machine but would like to get into the git flow habit. I opened Sourcetree and imported my project... | You're getting a flat graph because you have a flat history:

As soon as you're committing to another branch, the difference is shown:
```
git checkout develop
# make some changes
git commit -m "Changes to develop"
```

Starting and committing... |
17050810 | How can I tell Emacs my git branch has changed? | 13 | 2013-06-11 18:07:54 | <p>At the bottom of my Emacs 23 editor, I notice that Emacs is aware that I am working in a directory that is under version control, what that version control system is, and what branch I am currently on. Pretty cool! But say I am on the master branch, and from the command line I do a <code>git commit</code>, followed ... | 3,155 | 1,579,724 | 2014-02-26 00:35:27 | 17,050,846 | 15 | 2013-06-11 18:10:01 | 2,442,087 | 2014-02-26 00:35:27 | https://stackoverflow.com/q/17050810 | https://stackoverflow.com/a/17050846 | <p><kbd>M-x</kbd> <code>revert-buffer</code> but I suggest you to use <a href="http://www.emacswiki.org/emacs/Magit"><code>magit-mode</code></a> to manage your git repos in Emacs.</p>
<p>For the record, I use to bind <code>revert-buffer</code> to <kbd>F5</kbd>:</p>
<pre class="lang-lisp prettyprint-override"><code>(g... | <p><kbd>M-x</kbd> <code>revert-buffer</code> but I suggest you to use <a href="http://www.emacswiki.org/emacs/Magit"><code>magit-mode</code></a> to manage your git repos in Emacs.</p> <p>For the record, I use to bind <code>revert-buffer</code> to <kbd>F5</kbd>:</p> <pre class="lang-lisp prettyprint-override"><code>(g... | 119, 371, 456, 3346 | dvcs, emacs, git, version-control | <h1>How can I tell Emacs my git branch has changed?</h1>
<p>At the bottom of my Emacs 23 editor, I notice that Emacs is aware that I am working in a directory that is under version control, what that version control system is, and what branch I am currently on. Pretty cool! But say I am on the master branch, and from t... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,915 | git | # How can I tell Emacs my git branch has changed?
At the bottom of my Emacs 23 editor, I notice that Emacs is aware that I am working in a directory that is under version control, what that version control system is, and what branch I am currently on. Pretty cool! But say I am on the master branch, and from the comman... | `M-x` `revert-buffer` but I suggest you to use [`magit-mode`](http://www.emacswiki.org/emacs/Magit) to manage your git repos in Emacs.
For the record, I use to bind `revert-buffer` to `F5`:
```
(global-set-key [f5] 'revert-buffer)
``` |
14483705 | What is the optimal range for number of live branches? | 13 | 2013-01-23 15:52:56 | <p>Let's say a project is:</p>
<ul>
<li><code>1</code> product</li>
<li>built over <code>Y</code> years</li>
<li>comprising <code>M</code> modules</li>
<li>written in <code>L</code> [1..3] languages</li>
<li>developed by total of <code>D</code> developers</li>
</ul>
<p>At what point does a project contain too many or... | 15,165 | 705,086 | 2015-07-15 12:51:04 | 14,561,469 | 15 | 2013-01-28 11:53:51 | 1,047,741 | 2013-01-28 12:14:34 | https://stackoverflow.com/q/14483705 | https://stackoverflow.com/a/14561469 | <blockquote>
<p>What is the rule of thumb to determine that RCS (svn or git) contains too many branches?</p>
</blockquote>
<p>How about <code>rule of 3</code>:</p>
<ul>
<li>One branch for stable code — main trunk;</li>
<li>One branch for unstable — upcoming release development;</li>
<li>And one more for maintenance... | <blockquote> <p>What is the rule of thumb to determine that RCS (svn or git) contains too many branches?</p> </blockquote> <p>How about <code>rule of 3</code>:</p> <ul> <li>One branch for stable code — main trunk;</li> <li>One branch for unstable — upcoming release development;</li> <li>And one more for maintenance... | 63, 119, 1879, 16207 | branch, git, rcs, svn | <h1>What is the optimal range for number of live branches?</h1>
<p>Let's say a project is:</p>
<ul>
<li><code>1</code> product</li>
<li>built over <code>Y</code> years</li>
<li>comprising <code>M</code> modules</li>
<li>written in <code>L</code> [1..3] languages</li>
<li>developed by total of <code>D</code> developers... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,916 | git | # What is the optimal range for number of live branches?
Let's say a project is:
- `1` product
- built over `Y` years
- comprising `M` modules
- written in `L` [1..3] languages
- developed by total of `D` developers
At what point does a project contain too many or too few live branches?
I know it is a hard question... | > What is the rule of thumb to determine that RCS (svn or git) contains too many branches?
How about `rule of 3`:
- One branch for stable code — main trunk;
- One branch for unstable — upcoming release development;
- And one more for maintenance — previous release's bug-fixes;
Many git-hosted projects use only two b... |
10016707 | Git rebase branch with merged children | 13 | 2012-04-04 17:59:53 | <p>Today I faced with one problem. My teammate created branch from master. He developed one feature in this branch and after that developed two subfeatures in subfeature's branches. At last he did two refactoring commit of the entire thing. So...</p>
<pre><code> C--D E--F | subfeatures
/ \ /... | 9,153 | 573,991 | 2020-03-21 19:10:35 | 13,473,457 | 15 | 2012-11-20 12:42:34 | 6,309 | 2020-03-21 19:10:35 | https://stackoverflow.com/q/10016707 | https://stackoverflow.com/a/13473457 | <p>Note that you need a git1.7.6+ for <code>git rebase --preserve-merges</code> to work properly.</p>
<ul>
<li>a <code>rebase --preserve-merges --onto</code> didn't work before ("<a href="https://stackoverflow.com/questions/9521422/git-rebase-preserve-merges-onto-doesnt-preserve-merges"><code>git rebase --preserve-mer... | <p>Note that you need a git1.7.6+ for <code>git rebase --preserve-merges</code> to work properly.</p> <ul> <li>a <code>rebase --preserve-merges --onto</code> didn't work before ("<a href="https://stackoverflow.com/questions/9521422/git-rebase-preserve-merges-onto-doesnt-preserve-merges"><code>git rebase --preserve-mer... | 119, 717, 1879, 8974 | branch, git, merge, rebase | <h1>Git rebase branch with merged children</h1>
<p>Today I faced with one problem. My teammate created branch from master. He developed one feature in this branch and after that developed two subfeatures in subfeature's branches. At last he did two refactoring commit of the entire thing. So...</p>
<pre><code> C--D... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,917 | git | # Git rebase branch with merged children
Today I faced with one problem. My teammate created branch from master. He developed one feature in this branch and after that developed two subfeatures in subfeature's branches. At last he did two refactoring commit of the entire thing. So...
```
C--D E--F ... | Note that you need a git1.7.6+ for `git rebase --preserve-merges` to work properly.
- a `rebase --preserve-merges --onto` didn't work before ("[`git rebase --preserve-merges --onto` doesn't preserve merges](https://stackoverflow.com/questions/9521422/git-rebase-preserve-merges-onto-doesnt-preserve-merges)")
- a `rebas... |
10268940 | Git pull deleted uncommitted changes | 13 | 2012-04-22 14:48:34 | <p>I just made a new repository on github. Starting with a folder full of files, the steps I did were:</p>
<pre><code>git init
git add -A
git remote add origin ...
#Now pull in the first commit that github made
git pull origin master
#Check everything is OK
ls
</code></pre>
<p>Eek! All my files have disappeared! Wh... | 20,696 | 102,441 | 2025-03-15 23:44:46 | 10,270,385 | 15 | 2012-04-22 17:40:40 | 1,290,731 | 2012-04-22 17:40:40 | https://stackoverflow.com/q/10268940 | https://stackoverflow.com/a/10270385 | <p>You can get them back. Even though the only thing pointing to it was the index, <code>git add</code> still put the added content in the repo. I'd start with a <code>git fsck</code> to find "dangling" (git's slightly quirky spelling of "unreferenced") blobs and <code>git cat-file -p</code> those blobs, if there's to... | <p>You can get them back. Even though the only thing pointing to it was the index, <code>git add</code> still put the added content in the repo. I'd start with a <code>git fsck</code> to find "dangling" (git's slightly quirky spelling of "unreferenced") blobs and <code>git cat-file -p</code> those blobs, if there's to... | 119 | git | <h1>Git pull deleted uncommitted changes</h1>
<p>I just made a new repository on github. Starting with a folder full of files, the steps I did were:</p>
<pre><code>git init
git add -A
git remote add origin ...
#Now pull in the first commit that github made
git pull origin master
#Check everything is OK
ls
</code></p... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,918 | git | # Git pull deleted uncommitted changes
I just made a new repository on github. Starting with a folder full of files, the steps I did were:
```
git init
git add -A
git remote add origin ...
#Now pull in the first commit that github made
git pull origin master
#Check everything is OK
ls
```
Eek! All my files have di... | You can get them back. Even though the only thing pointing to it was the index, `git add` still put the added content in the repo. I'd start with a `git fsck` to find "dangling" (git's slightly quirky spelling of "unreferenced") blobs and `git cat-file -p` those blobs, if there's too many I'd do something like `find .g... |
8353988 | How to upload a git repo to gerrit? | 13 | 2011-12-02 09:06:48 | <p>I installed the gerrit service on a ubuntu server,and my PC as client.
I created a git repo on my PC(with msysgit),and the question is :how can I upload the git repo to the Ubuntu server?Should I do some work on Ubuntu server first(i just installed gerrit and git service )?</p>
| 10,698 | 1,077,031 | 2011-12-02 09:11:22 | 8,354,053 | 15 | 2011-12-02 09:11:22 | 893 | 2011-12-02 09:11:22 | https://stackoverflow.com/q/8353988 | https://stackoverflow.com/a/8354053 | <p>First, you need to create the project on the Gerrit server using <a href="http://gerrit.googlecode.com/svn/documentation/2.0/cmd-create-project.html"><code>gerrit create-project</code></a>.</p>
<p>Next, edit the project permissions if necessary to add the following for your user (Administrators group, probably):</p... | <p>First, you need to create the project on the Gerrit server using <a href="http://gerrit.googlecode.com/svn/documentation/2.0/cmd-create-project.html"><code>gerrit create-project</code></a>.</p> <p>Next, edit the project permissions if necessary to add the following for your user (Administrators group, probably):</p... | 58, 119, 21628, 52272 | gerrit, git, linux, msysgit | <h1>How to upload a git repo to gerrit?</h1>
<p>I installed the gerrit service on a ubuntu server,and my PC as client.
I created a git repo on my PC(with msysgit),and the question is :how can I upload the git repo to the Ubuntu server?Should I do some work on Ubuntu server first(i just installed gerrit and git service ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,919 | git | # How to upload a git repo to gerrit?
I installed the gerrit service on a ubuntu server,and my PC as client.
I created a git repo on my PC(with msysgit),and the question is :how can I upload the git repo to the Ubuntu server?Should I do some work on Ubuntu server first(i just installed gerrit and git service )? | First, you need to create the project on the Gerrit server using [`gerrit create-project`](http://gerrit.googlecode.com/svn/documentation/2.0/cmd-create-project.html).
Next, edit the project permissions if necessary to add the following for your user (Administrators group, probably):
- Create reference
- Forge commit... |
6315430 | fetch remote branch with the same name | 13 | 2011-06-11 10:42:53 | <p>I want to fetch a branch from a remote, but my branch name does not start with remote name, for example:</p>
<pre><code>git checkout -b BRANCH origin/BRANCH
</code></pre>
<p>It work in some cases, but in some cases I get this error:</p>
<pre><code>fatal: git checkout: updating paths is incompatible with switching... | 24,915 | 495,838 | 2011-06-11 12:45:13 | 6,315,973 | 15 | 2011-06-11 12:39:34 | 19,563 | 2011-06-11 12:45:13 | https://stackoverflow.com/q/6315430 | https://stackoverflow.com/a/6315973 | <p>This is why you are getting the error message that you are.</p>
<p><code>git checkout</code> can do one of two things. If you just specify a branch and don't specify any paths then it will switch your current branch to the branch that you specified.</p>
<pre><code>git checkout mybranch # switch to branch 'my bra... | <p>This is why you are getting the error message that you are.</p> <p><code>git checkout</code> can do one of two things. If you just specify a branch and don't specify any paths then it will switch your current branch to the branch that you specified.</p> <pre><code>git checkout mybranch # switch to branch 'my bra... | 119, 31678 | git, remote-branch | <h1>fetch remote branch with the same name</h1>
<p>I want to fetch a branch from a remote, but my branch name does not start with remote name, for example:</p>
<pre><code>git checkout -b BRANCH origin/BRANCH
</code></pre>
<p>It work in some cases, but in some cases I get this error:</p>
<pre><code>fatal: git checkou... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,920 | git | # fetch remote branch with the same name
I want to fetch a branch from a remote, but my branch name does not start with remote name, for example:
```
git checkout -b BRANCH origin/BRANCH
```
It work in some cases, but in some cases I get this error:
```
fatal: git checkout: updating paths is incompatible with switc... | This is why you are getting the error message that you are.
`git checkout` can do one of two things. If you just specify a branch and don't specify any paths then it will switch your current branch to the branch that you specified.
```
git checkout mybranch # switch to branch 'my branch'
```
If you supply some pat... |
5805786 | Git Branch newbie - How to reverse? | 13 | 2011-04-27 14:32:30 | <p>Not sure if this is a proper way to work with branches.</p>
<ul>
<li>I had this application on structure A.</li>
<li>I created a branch Z while I was on that structure A (but I kept my self on the master branch working).</li>
<li>While working (on the master branch), I changed that structure and I end up messing th... | 37,564 | 378,170 | 2011-04-27 19:22:50 | 5,805,903 | 15 | 2011-04-27 14:40:11 | 135,108 | 2011-04-27 18:44:22 | https://stackoverflow.com/q/5805786 | https://stackoverflow.com/a/5805903 | <p>If you created a separate branch that got messed up, all you need to do is switch back to the one you were on before: <code>git checkout A</code> (assuming <code>A</code> is the name of the branch you were on... or maybe it's <code>master</code>).</p>
<p>You can delete the bad branch later, if you want, with <code>... | <p>If you created a separate branch that got messed up, all you need to do is switch back to the one you were on before: <code>git checkout A</code> (assuming <code>A</code> is the name of the branch you were on... or maybe it's <code>master</code>).</p> <p>You can delete the bad branch later, if you want, with <code>... | 119, 34403, 76220 | git, git-branch, git-revert | <h1>Git Branch newbie - How to reverse?</h1>
<p>Not sure if this is a proper way to work with branches.</p>
<ul>
<li>I had this application on structure A.</li>
<li>I created a branch Z while I was on that structure A (but I kept my self on the master branch working).</li>
<li>While working (on the master branch), I c... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,922 | git | # Git Branch newbie - How to reverse?
Not sure if this is a proper way to work with branches.
- I had this application on structure A.
- I created a branch Z while I was on that structure A (but I kept my self on the master branch working).
- While working (on the master branch), I changed that structure and I end up... | If you created a separate branch that got messed up, all you need to do is switch back to the one you were on before: `git checkout A` (assuming `A` is the name of the branch you were on... or maybe it's `master`).
You can delete the bad branch later, if you want, with `git branch -d <branchname>` and maybe throw in a... |
5013894 | Finding the size of a push | 13 | 2011-02-16 08:00:09 | <p>I have a series of commits that I'd want to push to my remote repository, but I'm using an internet connection that's data capped and I'd like to know how big the commit is to decide whether to push it now or later when I'm on a connection with a larger data cap.</p>
<p>You can see how big a push is when you're in ... | 5,956 | null | 2011-02-16 13:41:39 | 5,017,160 | 15 | 2011-02-16 13:41:39 | 230,575 | 2011-02-16 13:41:39 | https://stackoverflow.com/q/5013894 | https://stackoverflow.com/a/5017160 | <p>It's <em>kind</em> of possible. Via <code>bash</code>, and assuming <code>origin/master</code> is your target branch:</p>
<pre><code>$ echo $(git merge-base HEAD origin/master)..HEAD | git pack-objects --revs --thin --stdout --all-progress-implied > packfile
</code></pre>
<p>Inspecting the size of the resulting... | <p>It's <em>kind</em> of possible. Via <code>bash</code>, and assuming <code>origin/master</code> is your target branch:</p> <pre><code>$ echo $(git merge-base HEAD origin/master)..HEAD | git pack-objects --revs --thin --stdout --all-progress-implied > packfile </code></pre> <p>Inspecting the size of the resulting... | 119 | git | <h1>Finding the size of a push</h1>
<p>I have a series of commits that I'd want to push to my remote repository, but I'm using an internet connection that's data capped and I'd like to know how big the commit is to decide whether to push it now or later when I'm on a connection with a larger data cap.</p>
<p>You can s... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,923 | git | # Finding the size of a push
I have a series of commits that I'd want to push to my remote repository, but I'm using an internet connection that's data capped and I'd like to know how big the commit is to decide whether to push it now or later when I'm on a connection with a larger data cap.
You can see how big a pus... | It's *kind* of possible. Via `bash`, and assuming `origin/master` is your target branch:
```
$ echo $(git merge-base HEAD origin/master)..HEAD | git pack-objects --revs --thin --stdout --all-progress-implied > packfile
```
Inspecting the size of the resulting `packfile` will give you an idea of how much data you need... |
2897669 | Git undo last commit | 13 | 2010-05-24 14:24:38 | <p>I merged the wrong way between two branches. I then ran the following:</p>
<pre><code>git reset --hard HEAD^
</code></pre>
<p>I am now back at the previous commit (which is where I want to be). Was that the correct thing to do?</p>
<p>The bad commit is still in the repository, is that okay or should I do somethin... | 5,333 | 321,061 | 2013-07-18 19:13:45 | 2,897,679 | 15 | 2010-05-24 14:26:07 | 27,206 | 2010-05-24 14:26:07 | https://stackoverflow.com/q/2897669 | https://stackoverflow.com/a/2897679 | <p>That's the right thing to do.</p>
<p>You can do a <code>git gc</code> to garbage collect disconnected commits, but it's not necessary.</p>
| <p>That's the right thing to do.</p> <p>You can do a <code>git gc</code> to garbage collect disconnected commits, but it's not necessary.</p> | 119 | git | <h1>Git undo last commit</h1>
<p>I merged the wrong way between two branches. I then ran the following:</p>
<pre><code>git reset --hard HEAD^
</code></pre>
<p>I am now back at the previous commit (which is where I want to be). Was that the correct thing to do?</p>
<p>The bad commit is still in the repository, is tha... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,924 | git | # Git undo last commit
I merged the wrong way between two branches. I then ran the following:
```
git reset --hard HEAD^
```
I am now back at the previous commit (which is where I want to be). Was that the correct thing to do?
The bad commit is still in the repository, is that okay or should I do something else to ... | That's the right thing to do.
You can do a `git gc` to garbage collect disconnected commits, but it's not necessary. |
1597278 | What git gotchas have you been caught by? | 13 | 2009-10-20 21:00:37 | <p>The worst one I've been caught by was with git submodules. I had a submodule for a project on github. The project was unmaintained, and I wanted to submit patches, but couldn't, so I forked. Now the submodule was pointing at the original library, and I needed it to point at the fork instead. So I deleted the old... | 6,529 | 90,723 | 2014-04-20 15:44:32 | 1,597,322 | 15 | 2009-10-20 21:09:14 | 6,309 | 2009-10-20 21:09:14 | https://stackoverflow.com/q/1597278 | https://stackoverflow.com/a/1597322 | <p>The usual trailing slash when <a href="http://august.lilleaas.net/git_submodules" rel="noreferrer">adding a submodule</a>:</p>
<blockquote>
<p>When you use git add on a submodule, make sure you don’t have a tailing slash.</p>
</blockquote>
<pre><code>> git add local/path
-- adds the submodule
> git add ... | <p>The usual trailing slash when <a href="http://august.lilleaas.net/git_submodules" rel="noreferrer">adding a submodule</a>:</p> <blockquote> <p>When you use git add on a submodule, make sure you don’t have a tailing slash.</p> </blockquote> <pre><code>> git add local/path -- adds the submodule > git add ... | 119, 456 | git, version-control | <h1>What git gotchas have you been caught by?</h1>
<p>The worst one I've been caught by was with git submodules. I had a submodule for a project on github. The project was unmaintained, and I wanted to submit patches, but couldn't, so I forked. Now the submodule was pointing at the original library, and I needed it ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,925 | git | # What git gotchas have you been caught by?
The worst one I've been caught by was with git submodules. I had a submodule for a project on github. The project was unmaintained, and I wanted to submit patches, but couldn't, so I forked. Now the submodule was pointing at the original library, and I needed it to point at ... | The usual trailing slash when [adding a submodule](http://august.lilleaas.net/git_submodules):
> When you use git add on a submodule, make sure you don’t have a tailing slash.
```
> git add local/path
-- adds the submodule
> git add local/path/
-- adds all the files in the submodule directly into your repository... |
50071841 | How to push local files to github using python? (or post a commit via Python) | 12 | 2018-04-28 00:59:07 | <h2>What options are there for commiting and pushing files to github from python?</h2>
<p>Here are three methods I thought should be feasible so attempted in order:</p>
<ol>
<li><p><strong>Use <a href="https://github.com/PyGithub/PyGithub" rel="noreferrer">pygithub</a>:</strong> (Github's python API) to send push reque... | 35,296 | 2,217,801 | 2024-01-17 10:58:16 | 50,072,113 | 15 | 2018-04-28 01:54:29 | 2,217,801 | 2021-03-11 23:57:46 | https://stackoverflow.com/q/50071841 | https://stackoverflow.com/a/50072113 | <p><a href="https://stackoverflow.com/questions/38594717/how-do-i-push-new-files-to-github">How do I push new files to GitHub?</a></p>
<p>A very similar question who's code I was able to modify to make multiple file pushes to github via python:</p>
<pre><code>import base64
from github import Github
from github import ... | <p><a href="https://stackoverflow.com/questions/38594717/how-do-i-push-new-files-to-github">How do I push new files to GitHub?</a></p> <p>A very similar question who's code I was able to modify to make multiple file pushes to github via python:</p> <pre><code>import base64 from github import Github from github import ... | 16, 119, 2348, 9696 | git, popen, python, subprocess | <h1>How to push local files to github using python? (or post a commit via Python)</h1>
<h2>What options are there for commiting and pushing files to github from python?</h2>
<p>Here are three methods I thought should be feasible so attempted in order:</p>
<ol>
<li><p><strong>Use <a href="https://github.com/PyGithub/PyG... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,926 | git | # How to push local files to github using python? (or post a commit via Python)
## What options are there for commiting and pushing files to github from python?
Here are three methods I thought should be feasible so attempted in order:
1. **Use [pygithub](https://github.com/PyGithub/PyGithub):** (Github's python API... | [How do I push new files to GitHub?](https://stackoverflow.com/questions/38594717/how-do-i-push-new-files-to-github)
A very similar question who's code I was able to modify to make multiple file pushes to github via python:
```
import base64
from github import Github
from github import InputGitTreeElement
user = "Gi... |
48666950 | Which language can I use to write a hook script in Git? | 12 | 2018-02-07 15:03:09 | <p>I would like to know the script languages that you can use inside hook script in Git. </p>
<p>I have been reading about how to use Git hooks but I have not seen anywhere the language that can be used, I have seen some examples that look they are written in Perl but I am not sure of that since I have never programme... | 4,297 | 7,985,378 | 2020-11-19 14:01:57 | 48,667,177 | 15 | 2018-02-07 15:14:03 | 4,265,352 | 2020-11-19 14:01:57 | https://stackoverflow.com/q/48666950 | https://stackoverflow.com/a/48667177 | <p>Any language, compiled or interpreted can be used (as long as the appropriate interpreter is available on the system).</p>
<p>The only requirement for hooks that run before events (e.g. <code>pre-commit</code>, <code>pre-rebase</code>, <code>pre-push</code> etc) and are allowed to block the event processing is to re... | <p>Any language, compiled or interpreted can be used (as long as the appropriate interpreter is available on the system).</p> <p>The only requirement for hooks that run before events (e.g. <code>pre-commit</code>, <code>pre-rebase</code>, <code>pre-push</code> etc) and are allowed to block the event processing is to re... | 43087 | githooks | <h1>Which language can I use to write a hook script in Git?</h1>
<p>I would like to know the script languages that you can use inside hook script in Git. </p>
<p>I have been reading about how to use Git hooks but I have not seen anywhere the language that can be used, I have seen some examples that look they are writt... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,927 | git | # Which language can I use to write a hook script in Git?
I would like to know the script languages that you can use inside hook script in Git.
I have been reading about how to use Git hooks but I have not seen anywhere the language that can be used, I have seen some examples that look they are written in Perl but I ... | Any language, compiled or interpreted can be used (as long as the appropriate interpreter is available on the system).
The only requirement for hooks that run before events (e.g. `pre-commit`, `pre-rebase`, `pre-push` etc) and are allowed to block the event processing is to return the exit code `0` for success (let th... |
41596550 | Create git branch without changing working copy | 12 | 2017-01-11 16:59:42 | <p>I just created a new repository and added a remote:</p>
<pre><code>git init
git remote add foo something
</code></pre>
<p>Now I want git to be on the most recent commit of <code>foo/master</code>. Usually, that would just be:</p>
<pre><code>git checkout master
</code></pre>
<p>Git is clever enough to use <code>f... | 19,416 | 2,361,979 | 2017-01-11 17:16:00 | 41,596,843 | 15 | 2017-01-11 17:16:00 | 1,256,452 | 2017-01-11 17:16:00 | https://stackoverflow.com/q/41596550 | https://stackoverflow.com/a/41596843 | <p>If you have just done <code>git init</code> in a new repository (as opposed to re-<code>init</code>-ing an existing repository), and have not yet run <code>git commit</code>, you are currently on an <em>unborn branch</em> (normally <code>master</code>-as-unborn-branch). What this means is that <code>HEAD</code> con... | <p>If you have just done <code>git init</code> in a new repository (as opposed to re-<code>init</code>-ing an existing repository), and have not yet run <code>git commit</code>, you are currently on an <em>unborn branch</em> (normally <code>master</code>-as-unborn-branch). What this means is that <code>HEAD</code> con... | 119 | git | <h1>Create git branch without changing working copy</h1>
<p>I just created a new repository and added a remote:</p>
<pre><code>git init
git remote add foo something
</code></pre>
<p>Now I want git to be on the most recent commit of <code>foo/master</code>. Usually, that would just be:</p>
<pre><code>git checkout mas... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,929 | git | # Create git branch without changing working copy
I just created a new repository and added a remote:
```
git init
git remote add foo something
```
Now I want git to be on the most recent commit of `foo/master`. Usually, that would just be:
```
git checkout master
```
Git is clever enough to use `foo/master` these... | If you have just done `git init` in a new repository (as opposed to re-`init`-ing an existing repository), and have not yet run `git commit`, you are currently on an *unborn branch* (normally `master`-as-unborn-branch). What this means is that `HEAD` contains the *name* `master`, while the branch named `master` does no... |
27101510 | Git branching strategy for Agile project | 12 | 2014-11-24 09:27:57 | <p>I have a project that is located in Git Stash Repository. The code will be deployed in four environments(Dev, Test, Stage and Prod). We follow Agile methodology. So dev team works for both Release activities and Non Release( Future Release) activities. I have to create branches based on this requirement. Below is my... | 22,095 | 4,121,012 | 2021-10-12 19:49:00 | 27,102,381 | 15 | 2014-11-24 10:14:54 | 430,885 | 2014-11-24 10:23:33 | https://stackoverflow.com/q/27101510 | https://stackoverflow.com/a/27102381 | <p>it sounds to me like, you are very close to choosing <a href="http://nvie.com/posts/a-successful-git-branching-model/" rel="noreferrer">Git Flow</a>. Actually, if I'm not mistaken, this is already your base from the strategy, you describe. Which is great.</p>
<p>I'm hearing your main concern is, that you want a non... | <p>it sounds to me like, you are very close to choosing <a href="http://nvie.com/posts/a-successful-git-branching-model/" rel="noreferrer">Git Flow</a>. Actually, if I'm not mistaken, this is already your base from the strategy, you describe. Which is great.</p> <p>I'm hearing your main concern is, that you want a non... | 119, 1879 | branch, git | <h1>Git branching strategy for Agile project</h1>
<p>I have a project that is located in Git Stash Repository. The code will be deployed in four environments(Dev, Test, Stage and Prod). We follow Agile methodology. So dev team works for both Release activities and Non Release( Future Release) activities. I have to crea... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,930 | git | # Git branching strategy for Agile project
I have a project that is located in Git Stash Repository. The code will be deployed in four environments(Dev, Test, Stage and Prod). We follow Agile methodology. So dev team works for both Release activities and Non Release( Future Release) activities. I have to create branch... | it sounds to me like, you are very close to choosing [Git Flow](http://nvie.com/posts/a-successful-git-branching-model/). Actually, if I'm not mistaken, this is already your base from the strategy, you describe. Which is great.
I'm hearing your main concern is, that you want a non-release "develop" branch, sort of lik... |
25286726 | Vim Fugitive: Gblame reblame options | 12 | 2014-08-13 12:52:06 | <p>I've been using Fugitive's Gblame recently but don't quite understand what "reblame" does.</p>
<p>Can someone describe a little more clearly what these options do:</p>
<pre><code> - reblame at commit
~ reblame at [count]th first grandparent
P reblame at [count]th parent (like HEAD^[count])
</code></p... | 5,052 | 2,295,034 | 2016-03-18 18:08:47 | 25,288,991 | 15 | 2014-08-13 14:34:34 | 438,329 | 2014-08-13 14:34:34 | https://stackoverflow.com/q/25286726 | https://stackoverflow.com/a/25288991 | <p>Think of reblame as navigating to a commit and then running blame on your file or <code>git blame <commit> -- <file></code></p>
<ul>
<li><code>-</code> the simplest case. Use the commit in question under your cursor and reblame the file.</li>
<li><code>~</code> Is equivalent to running <code>git blame ... | <p>Think of reblame as navigating to a commit and then running blame on your file or <code>git blame <commit> -- <file></code></p> <ul> <li><code>-</code> the simplest case. Use the commit in question under your cursor and reblame the file.</li> <li><code>~</code> Is equivalent to running <code>git blame ... | 119, 370, 88389, 105902 | git, git-blame, vim, vim-fugitive | <h1>Vim Fugitive: Gblame reblame options</h1>
<p>I've been using Fugitive's Gblame recently but don't quite understand what "reblame" does.</p>
<p>Can someone describe a little more clearly what these options do:</p>
<pre><code> - reblame at commit
~ reblame at [count]th first grandparent
P reblame at [... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,931 | git | # Vim Fugitive: Gblame reblame options
I've been using Fugitive's Gblame recently but don't quite understand what "reblame" does.
Can someone describe a little more clearly what these options do:
```
- reblame at commit
~ reblame at [count]th first grandparent
P reblame at [count]th parent (like HEAD^... | Think of reblame as navigating to a commit and then running blame on your file or `git blame <commit> -- <file>`
- `-` the simplest case. Use the commit in question under your cursor and reblame the file.
- `~` Is equivalent to running `git blame <rev>~[count] -- <file>`
- `P` Is equivalent to running `git blame <rev>... |
25240634 | How to change HEAD of git submodule | 12 | 2014-08-11 10:02:13 | <p>The Project is having one sub module and is pointing to one particular SHA (ex <code>62726c</code>) of that submodule.</p>
<p>So each time on running <code>git submodule update --init</code> the submodule directory is showing the changes of that SHA (<code>62726c</code>) only.</p>
<p>Recently I made change to the ... | 9,433 | 2,264,881 | 2014-08-11 10:38:42 | 25,240,761 | 15 | 2014-08-11 10:08:25 | 11,343 | 2014-08-11 10:08:25 | https://stackoverflow.com/q/25240634 | https://stackoverflow.com/a/25240761 | <p>When doing <code>git submodule update --init</code>, you checkout the submodule to the revision registered by the project, which hasn't been updated, that's why you always see it reverted.</p>
<p>To change the revision of the submodule for the super project, check out the submodule to the SHA1 you want:</p>
<pre><... | <p>When doing <code>git submodule update --init</code>, you checkout the submodule to the revision registered by the project, which hasn't been updated, that's why you always see it reverted.</p> <p>To change the revision of the submodule for the super project, check out the submodule to the SHA1 you want:</p> <pre><... | 119, 41612 | git, git-submodules | <h1>How to change HEAD of git submodule</h1>
<p>The Project is having one sub module and is pointing to one particular SHA (ex <code>62726c</code>) of that submodule.</p>
<p>So each time on running <code>git submodule update --init</code> the submodule directory is showing the changes of that SHA (<code>62726c</code>)... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,932 | git | # How to change HEAD of git submodule
The Project is having one sub module and is pointing to one particular SHA (ex `62726c`) of that submodule.
So each time on running `git submodule update --init` the submodule directory is showing the changes of that SHA (`62726c`) only.
Recently I made change to the submodule a... | When doing `git submodule update --init`, you checkout the submodule to the revision registered by the project, which hasn't been updated, that's why you always see it reverted.
To change the revision of the submodule for the super project, check out the submodule to the SHA1 you want:
```
git checkout f81611
```
Fr... |
14368093 | Simpler way to stage only modified files in Git (not deleted) | 12 | 2013-01-16 21:23:46 | <p>I have a bunch of deleted files in my working branch that I'm not sure I want to commit yet. I need to commit my modified files as needed though. </p>
<p>This is what I came up with: </p>
<pre><code>git add `git status | grep modified | cut -f2 | cut -f4 -d' '`
</code></pre>
<p>This answer does something similar... | 5,210 | 1,204,112 | 2017-06-09 06:01:40 | 14,368,373 | 15 | 2013-01-16 21:40:17 | 582 | 2017-06-09 06:01:40 | https://stackoverflow.com/q/14368093 | https://stackoverflow.com/a/14368373 | <p>Just use <code>git add --no-all .</code> (Git v. 2.0+) or <code>git add .</code> (Git v. 1.x). This will pick up any files it can find by traversing the current directory, which naturally won't include deleted files.</p>
<p>Of course, this also picks up any untracked files too. If you need to avoid those, then you ... | <p>Just use <code>git add --no-all .</code> (Git v. 2.0+) or <code>git add .</code> (Git v. 1.x). This will pick up any files it can find by traversing the current directory, which naturally won't include deleted files.</p> <p>Of course, this also picks up any untracked files too. If you need to avoid those, then you ... | 119 | git | <h1>Simpler way to stage only modified files in Git (not deleted)</h1>
<p>I have a bunch of deleted files in my working branch that I'm not sure I want to commit yet. I need to commit my modified files as needed though. </p>
<p>This is what I came up with: </p>
<pre><code>git add `git status | grep modified | cut -f... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,935 | git | # Simpler way to stage only modified files in Git (not deleted)
I have a bunch of deleted files in my working branch that I'm not sure I want to commit yet. I need to commit my modified files as needed though.
This is what I came up with:
```
git add `git status | grep modified | cut -f2 | cut -f4 -d' '`
```
This a... | Just use `git add --no-all .` (Git v. 2.0+) or `git add .` (Git v. 1.x). This will pick up any files it can find by traversing the current directory, which naturally won't include deleted files.
Of course, this also picks up any untracked files too. If you need to avoid those, then you can use a more complicated expre... |
12270357 | Really flatten a git merge | 12 | 2012-09-04 19:47:13 | <p>There're few question about "flattening merge" on StackOverflow, with an answer usually being "git rebase". These answers though miss one crucial point - order of commits.</p>
<p>Suppose there's a branch A with commits of Jun 1 and Aug 1, and branch B with commit of Jul 1 (<strong>UPDATE</strong> to reinstate the u... | 3,234 | 496,009 | 2017-09-19 07:18:33 | 12,395,245 | 15 | 2012-09-12 19:47:34 | 496,009 | 2012-09-15 17:21:44 | https://stackoverflow.com/q/12270357 | https://stackoverflow.com/a/12395245 | <p>After some thinking, I figured out how to do <a href="https://stackoverflow.com/questions/12394166/git-rebase-interactive-in-non-interative-manner">How do I run git rebase --interactive in non-interactive manner?</a> , which also provides completely scripted solution for this question.</p>
<p><strong>1.</strong> Br... | <p>After some thinking, I figured out how to do <a href="https://stackoverflow.com/questions/12394166/git-rebase-interactive-in-non-interative-manner">How do I run git rebase --interactive in non-interactive manner?</a> , which also provides completely scripted solution for this question.</p> <p><strong>1.</strong> Br... | 119, 717, 8974, 91259 | git, git-rewrite-history, merge, rebase | <h1>Really flatten a git merge</h1>
<p>There're few question about "flattening merge" on StackOverflow, with an answer usually being "git rebase". These answers though miss one crucial point - order of commits.</p>
<p>Suppose there's a branch A with commits of Jun 1 and Aug 1, and branch B with commit of Jul 1 (<stron... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,936 | git | # Really flatten a git merge
There're few question about "flattening merge" on StackOverflow, with an answer usually being "git rebase". These answers though miss one crucial point - order of commits.
Suppose there's a branch A with commits of Jun 1 and Aug 1, and branch B with commit of Jul 1 (**UPDATE** to reinstat... | After some thinking, I figured out how to do [How do I run git rebase --interactive in non-interactive manner?](https://stackoverflow.com/questions/12394166/git-rebase-interactive-in-non-interative-manner) , which also provides completely scripted solution for this question.
**1.** Bring 2 branches from different repo... |
8873169 | Is the SHA-1 of commits calculated based only on the content of the tree? | 12 | 2012-01-15 20:36:16 | <p>For the sake of an experiment, lets say your <code>git log</code> identifies the following commits</p>
<pre><code>commit 16bc8486fb34cf9a6faf0f7df606ae72ad9ea438 // added 2nd file
commit 9188f9a25b045f130b08888bc3f638099fa7f212 // initial commit
</code></pre>
<p>After committing, <code>.git/refs/heads/master</co... | 4,592 | 359,862 | 2016-05-17 10:31:31 | 8,873,188 | 15 | 2012-01-15 20:39:15 | 421,223 | 2013-06-11 13:15:26 | https://stackoverflow.com/q/8873169 | https://stackoverflow.com/a/8873188 | <p>Question 1: Because the hash is generated taking everything into account including the commit meta data (which itself contains the date and time).</p>
<p>Question 2: <code>git log</code> shows the log of the current branch. The commit <code>16bc8486</code> is not part of it. As far as I know (I'm not completely sur... | <p>Question 1: Because the hash is generated taking everything into account including the commit meta data (which itself contains the date and time).</p> <p>Question 2: <code>git log</code> shows the log of the current branch. The commit <code>16bc8486</code> is not part of it. As far as I know (I'm not completely sur... | 119, 10188 | git, sha | <h1>Is the SHA-1 of commits calculated based only on the content of the tree?</h1>
<p>For the sake of an experiment, lets say your <code>git log</code> identifies the following commits</p>
<pre><code>commit 16bc8486fb34cf9a6faf0f7df606ae72ad9ea438 // added 2nd file
commit 9188f9a25b045f130b08888bc3f638099fa7f212 // ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,937 | git | # Is the SHA-1 of commits calculated based only on the content of the tree?
For the sake of an experiment, lets say your `git log` identifies the following commits
```
commit 16bc8486fb34cf9a6faf0f7df606ae72ad9ea438 // added 2nd file
commit 9188f9a25b045f130b08888bc3f638099fa7f212 // initial commit
```
After commi... | Question 1: Because the hash is generated taking everything into account including the commit meta data (which itself contains the date and time).
Question 2: `git log` shows the log of the current branch. The commit `16bc8486` is not part of it. As far as I know (I'm not completely sure) the garbage collector will ta... |
4740985 | Overwriting and Pushing a Git Branch | 12 | 2011-01-19 21:29:15 | <p>In merging my changes against an upstream master, I frequently find myself doing the following:</p>
<pre><code>git checkout somefeature
git checkout -b integration
git rebase master # resolving conflicts along the way
git checkout somefeature
git merge integration # or rebase, doesn't matter in this example
</code>... | 15,056 | 582,122 | 2011-01-19 21:43:40 | 4,741,105 | 15 | 2011-01-19 21:40:57 | 260,593 | 2011-01-19 21:40:57 | https://stackoverflow.com/q/4740985 | https://stackoverflow.com/a/4741105 | <p>The problem is caused because <code>git rebase</code> generates a new series of commits that aren't descended from the <code>somefeature</code> branch, then when you try and merge them back into <code>somefeature</code> the conflict resolution done during the rebase doesn't apply. If you were to just merge instead ... | <p>The problem is caused because <code>git rebase</code> generates a new series of commits that aren't descended from the <code>somefeature</code> branch, then when you try and merge them back into <code>somefeature</code> the conflict resolution done during the rebase doesn't apply. If you were to just merge instead ... | 119 | git | <h1>Overwriting and Pushing a Git Branch</h1>
<p>In merging my changes against an upstream master, I frequently find myself doing the following:</p>
<pre><code>git checkout somefeature
git checkout -b integration
git rebase master # resolving conflicts along the way
git checkout somefeature
git merge integration # or ... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,938 | git | # Overwriting and Pushing a Git Branch
In merging my changes against an upstream master, I frequently find myself doing the following:
```
git checkout somefeature
git checkout -b integration
git rebase master # resolving conflicts along the way
git checkout somefeature
git merge integration # or rebase, doesn't matt... | The problem is caused because `git rebase` generates a new series of commits that aren't descended from the `somefeature` branch, then when you try and merge them back into `somefeature` the conflict resolution done during the rebase doesn't apply. If you were to just merge instead of rebase then this would work as the... |
65244300 | How to add work item to commit in new git experience interface in new Visual Studio 2019 | 11 | 2020-12-11 00:45:04 | <p>Quick Question for Visual Studio 2019 Version 16.8.3, How do you connect the work item to the commit in the new git changes tab? I am having a really hard time using this new git experience thing. I can see my work item in team explorer but no idea how to add this work item to the commit in this new interface. Usual... | 12,123 | 1,712,016 | 2021-12-03 14:23:05 | 65,248,002 | 15 | 2020-12-11 08:29:23 | 6,309 | 2020-12-11 08:29:23 | https://stackoverflow.com/q/65244300 | https://stackoverflow.com/a/65248002 | <blockquote>
<p>it look like you can just use hashtag '#' in commit message,</p>
</blockquote>
<p>That is the recommended syntax.<br />
Example:</p>
<pre><code>Fix a bug #1234
</code></pre>
<p>That would <a href="https://learn.microsoft.com/de-de/azure/devops/repos/git/resolution-mentions?view=azure-devops" rel="norefe... | <blockquote> <p>it look like you can just use hashtag '#' in commit message,</p> </blockquote> <p>That is the recommended syntax.<br /> Example:</p> <pre><code>Fix a bug #1234 </code></pre> <p>That would <a href="https://learn.microsoft.com/de-de/azure/devops/repos/git/resolution-mentions?view=azure-devops" rel="norefe... | 110, 119, 4361, 135964 | git, ide, visual-studio-2019, workitem | <h1>How to add work item to commit in new git experience interface in new Visual Studio 2019</h1>
<p>Quick Question for Visual Studio 2019 Version 16.8.3, How do you connect the work item to the commit in the new git changes tab? I am having a really hard time using this new git experience thing. I can see my work item... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,941 | git | # How to add work item to commit in new git experience interface in new Visual Studio 2019
Quick Question for Visual Studio 2019 Version 16.8.3, How do you connect the work item to the commit in the new git changes tab? I am having a really hard time using this new git experience thing. I can see my work item in team ... | > it look like you can just use hashtag '#' in commit message,
That is the recommended syntax.
Example:
```
Fix a bug #1234
```
That would [actually close the work item](https://learn.microsoft.com/de-de/azure/devops/repos/git/resolution-mentions?view=azure-devops)
See more at "[Drive Git development from a work ... |
43978823 | How to squash commits in one branch? | 11 | 2017-05-15 11:52:40 | <p>I made a branch of trunk and been submitting/committing lots of changes. Every so often I would update the branch by merging from trunk (eg. 20 commits, then a merge-update, 20 more commits then a merge-update, etc).</p>
<p>Now I would like to squash everything in my branch. How can I do this (using either Git Exte... | 30,283 | 1,693,881 | 2020-09-30 16:43:51 | 43,979,391 | 15 | 2017-05-15 12:20:15 | 5,670,873 | 2018-01-07 20:29:38 | https://stackoverflow.com/q/43978823 | https://stackoverflow.com/a/43979391 | <p>To rebase all commits made since branching out from <code>master</code> you might use the following command:</p>
<pre><code>git rebase -i `git merge-base HEAD master`
</code></pre>
<p><a href="https://git-scm.com/docs/git-merge-base" rel="noreferrer"><code>git merge-base</code></a> finds the closest common ancesto... | <p>To rebase all commits made since branching out from <code>master</code> you might use the following command:</p> <pre><code>git rebase -i `git merge-base HEAD master` </code></pre> <p><a href="https://git-scm.com/docs/git-merge-base" rel="noreferrer"><code>git merge-base</code></a> finds the closest common ancesto... | 119, 456, 8974, 28897 | git, git-merge, rebase, version-control | <h1>How to squash commits in one branch?</h1>
<p>I made a branch of trunk and been submitting/committing lots of changes. Every so often I would update the branch by merging from trunk (eg. 20 commits, then a merge-update, 20 more commits then a merge-update, etc).</p>
<p>Now I would like to squash everything in my br... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,944 | git | # How to squash commits in one branch?
I made a branch of trunk and been submitting/committing lots of changes. Every so often I would update the branch by merging from trunk (eg. 20 commits, then a merge-update, 20 more commits then a merge-update, etc).
Now I would like to squash everything in my branch. How can I ... | To rebase all commits made since branching out from `master` you might use the following command:
```
git rebase -i `git merge-base HEAD master`
```
[`git merge-base`](https://git-scm.com/docs/git-merge-base) finds the closest common ancestor between your current branch and the master (i.e. the last commit that is av... |
37344763 | Difference in the output of git log --decorate: (HEAD -> master) vs (HEAD, master) | 11 | 2016-05-20 10:50:07 | <p>When I get the log of a GIT repo:</p>
<pre><code>git log --oneline --decorate --graph
</code></pre>
<p>the output is like this:</p>
<pre><code>* 44025ed (HEAD -> master) second commit
* adf2dbb first commmit
</code></pre>
<p>In another repo, when I <code>git log</code>, I get:</p>
<pre><code>* 435b61d (HEAD,... | 4,664 | 4,820,341 | 2021-05-26 04:56:53 | 37,344,886 | 15 | 2016-05-20 10:56:06 | 2,541,573 | 2021-05-26 04:56:53 | https://stackoverflow.com/q/37344763 | https://stackoverflow.com/a/37344886 | <h1>The arrow points to the current branch</h1>
<p>An arrow to the right of <code>HEAD</code>, in the output of <code>git log --oneline --decorate --graph</code>, indicates which branch (if any) is the current one.</p>
<pre><code>* 44025ed (HEAD -> master) second commit
</code></pre>
<p>means that the symbolic refer... | <h1>The arrow points to the current branch</h1> <p>An arrow to the right of <code>HEAD</code>, in the output of <code>git log --oneline --decorate --graph</code>, indicates which branch (if any) is the current one.</p> <pre><code>* 44025ed (HEAD -> master) second commit </code></pre> <p>means that the symbolic refer... | 119, 47913 | git, git-log | <h1>Difference in the output of git log --decorate: (HEAD -> master) vs (HEAD, master)</h1>
<p>When I get the log of a GIT repo:</p>
<pre><code>git log --oneline --decorate --graph
</code></pre>
<p>the output is like this:</p>
<pre><code>* 44025ed (HEAD -> master) second commit
* adf2dbb first commmit
</code></pr... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,946 | git | # Difference in the output of git log --decorate: (HEAD -> master) vs (HEAD, master)
When I get the log of a GIT repo:
```
git log --oneline --decorate --graph
```
the output is like this:
```
* 44025ed (HEAD -> master) second commit
* adf2dbb first commmit
```
In another repo, when I `git log`, I get:
```
* 435b... | # The arrow points to the current branch
An arrow to the right of `HEAD`, in the output of `git log --oneline --decorate --graph`, indicates which branch (if any) is the current one.
```
* 44025ed (HEAD -> master) second commit
```
means that the symbolic reference `HEAD` currently points to the `master` branch; in ... |
30476240 | Why does "git status" show way too much untracked files? | 11 | 2015-05-27 07:49:28 | <p><strong>Answer in the bottom.</strong></p>
<p>I am trying to see the <code>status</code> of my files in the <code>git_test2</code> directory which contains 3 files named <code>test1.txt</code>, <code>test2.txt</code> and <code>test3.txt</code>.</p>
<p>This is what I typed into Terminal:</p>
<pre><code>cd Desktop
... | 12,543 | 4,040,194 | 2019-01-17 04:10:14 | 30,485,085 | 15 | 2015-05-27 14:13:02 | 2,790,048 | 2019-01-17 04:10:14 | https://stackoverflow.com/q/30476240 | https://stackoverflow.com/a/30485085 | <h3>Why are there so many files?</h3>
<p>A git repository is just a <code>.git/</code> directory (folder) located in your project's directory. Like this: <code>myproject/.git/</code>.</p>
<p>If there's no git repository in your current directory, git <strong>searches in the parent directory, then in parent's parent a... | <h3>Why are there so many files?</h3> <p>A git repository is just a <code>.git/</code> directory (folder) located in your project's directory. Like this: <code>myproject/.git/</code>.</p> <p>If there's no git repository in your current directory, git <strong>searches in the parent directory, then in parent's parent a... | 119, 54839 | git, git-status | <h1>Why does "git status" show way too much untracked files?</h1>
<p><strong>Answer in the bottom.</strong></p>
<p>I am trying to see the <code>status</code> of my files in the <code>git_test2</code> directory which contains 3 files named <code>test1.txt</code>, <code>test2.txt</code> and <code>test3.txt</code>.</p>
... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,947 | git | # Why does "git status" show way too much untracked files?
**Answer in the bottom.**
I am trying to see the `status` of my files in the `git_test2` directory which contains 3 files named `test1.txt`, `test2.txt` and `test3.txt`.
This is what I typed into Terminal:
```
cd Desktop
cd git_test2
git status
```
Everyth... | ### Why are there so many files?
A git repository is just a `.git/` directory (folder) located in your project's directory. Like this: `myproject/.git/`.
If there's no git repository in your current directory, git **searches in the parent directory, then in parent's parent and up to top**.
As your path was `/Users/i... |
24619007 | git: push deleted branch to remote | 11 | 2014-07-07 20:13:19 | <p><strong>Aim : To delete a remote branch named 'branchname'</strong></p>
<p>Steps I used to do was: <strong>[first approach]</strong></p>
<ol>
<li>git branch -d branchname</li>
<li>git push origin :branchname</li>
</ol>
<p>Today I tried to delete using the same above steps, but encountered an issue as mentioned b... | 13,245 | 3,250,087 | 2014-07-07 21:30:49 | 24,620,222 | 15 | 2014-07-07 21:30:49 | 1,306,923 | 2014-07-07 21:30:49 | https://stackoverflow.com/q/24619007 | https://stackoverflow.com/a/24620222 | <p>In your first example, the reason why the push failed is because you did</p>
<pre><code>git push origin branchname
</code></pre>
<p>instead of</p>
<pre><code>git push origin :branchname
</code></pre>
<p>The colon is significant; it's the difference between pushing a branch and deleting a branch. The one-characte... | <p>In your first example, the reason why the push failed is because you did</p> <pre><code>git push origin branchname </code></pre> <p>instead of</p> <pre><code>git push origin :branchname </code></pre> <p>The colon is significant; it's the difference between pushing a branch and deleting a branch. The one-characte... | 119 | git | <h1>git: push deleted branch to remote</h1>
<p><strong>Aim : To delete a remote branch named 'branchname'</strong></p>
<p>Steps I used to do was: <strong>[first approach]</strong></p>
<ol>
<li>git branch -d branchname</li>
<li>git push origin :branchname</li>
</ol>
<p>Today I tried to delete using the same above st... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,949 | git | # git: push deleted branch to remote
**Aim : To delete a remote branch named 'branchname'**
Steps I used to do was: **[first approach]**
1. git branch -d branchname
2. git push origin :branchname
Today I tried to delete using the same above steps, but encountered an issue as mentioned below:
```
$ git branch -d br... | In your first example, the reason why the push failed is because you did
```
git push origin branchname
```
instead of
```
git push origin :branchname
```
The colon is significant; it's the difference between pushing a branch and deleting a branch. The one-character difference here is why `git push origin --delete ... |
24428536 | GPG sign all git commits without stash | 11 | 2014-06-26 10:51:56 | <p>git 2.0 has the config option <code>commit.gpgsign</code> which will sign all commits.</p>
<p>This will also apply for <code>git stash</code> and will ask for the password of my gpg key.</p>
<p>Is ther a way to automatically sign all commits, tags,... but exclude stashes?</p>
| 756 | 376,998 | 2016-10-15 22:02:47 | 24,429,205 | 15 | 2014-06-26 11:22:23 | 1,290,731 | 2014-06-26 11:22:23 | https://stackoverflow.com/q/24428536 | https://stackoverflow.com/a/24429205 | <p>This is alias territory:</p>
<pre><code>git config --global alias.stashq '-c commit.gpgsign=false stash'
</code></pre>
| <p>This is alias territory:</p> <pre><code>git config --global alias.stashq '-c commit.gpgsign=false stash' </code></pre> | 119, 5254, 6735, 13091 | git, git-stash, gnupg, sign | <h1>GPG sign all git commits without stash</h1>
<p>git 2.0 has the config option <code>commit.gpgsign</code> which will sign all commits.</p>
<p>This will also apply for <code>git stash</code> and will ask for the password of my gpg key.</p>
<p>Is ther a way to automatically sign all commits, tags,... but exclude sta... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,950 | git | # GPG sign all git commits without stash
git 2.0 has the config option `commit.gpgsign` which will sign all commits.
This will also apply for `git stash` and will ask for the password of my gpg key.
Is ther a way to automatically sign all commits, tags,... but exclude stashes? | This is alias territory:
```
git config --global alias.stashq '-c commit.gpgsign=false stash'
``` |
21652242 | git: re-checkout files after creating smudge filter | 11 | 2014-02-08 21:52:38 | <p>Situation: I've just cloned a git repo, and then I configure the smudge filter for the repo. There are <code>.gitattributes</code> files scattered around the repo that specify the filter that should be used on the files at checkout. But since I setup the filter after the checkout (clone), none of the files were proc... | 4,677 | 486,035 | 2016-10-18 09:36:21 | 21,653,524 | 15 | 2014-02-09 00:18:36 | 6,309 | 2016-10-18 09:36:21 | https://stackoverflow.com/q/21652242 | https://stackoverflow.com/a/21653524 | <p>Simply re-checkout everything.</p>
<pre><code>cd /path/to/your/repo
git stash save
rm .git/index
git checkout HEAD -- "$(git rev-parse --show-toplevel)"
git stash pop
</code></pre>
<p>The smudge filter will be applied at that new checkout.</p>
<p>Note, as seen in <a href="https://stackoverflow.com/a/39762768/6309... | <p>Simply re-checkout everything.</p> <pre><code>cd /path/to/your/repo git stash save rm .git/index git checkout HEAD -- "$(git rev-parse --show-toplevel)" git stash pop </code></pre> <p>The smudge filter will be applied at that new checkout.</p> <p>Note, as seen in <a href="https://stackoverflow.com/a/39762768/6309... | 119 | git | <h1>git: re-checkout files after creating smudge filter</h1>
<p>Situation: I've just cloned a git repo, and then I configure the smudge filter for the repo. There are <code>.gitattributes</code> files scattered around the repo that specify the filter that should be used on the files at checkout. But since I setup the f... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,951 | git | # git: re-checkout files after creating smudge filter
Situation: I've just cloned a git repo, and then I configure the smudge filter for the repo. There are `.gitattributes` files scattered around the repo that specify the filter that should be used on the files at checkout. But since I setup the filter after the chec... | Simply re-checkout everything.
```
cd /path/to/your/repo
git stash save
rm .git/index
git checkout HEAD -- "$(git rev-parse --show-toplevel)"
git stash pop
```
The smudge filter will be applied at that new checkout.
Note, as seen in [this answer](https://stackoverflow.com/a/39762768/6309), you need to remove the ind... |
18329821 | How to clone from a github repo and then run npm install on puppet | 11 | 2013-08-20 07:59:21 | <p>I have worked out how to fire up a vagrant box and <code>apt-get install</code> packages</p>
<p>I now want to <code>git clone</code> a node.js repo from github before running <code>npm install</code> and running the app with <code>node app.js</code></p>
<p>I expected to be able to achieve this by issuing BASH comm... | 11,044 | 54,086 | 2013-08-20 09:51:49 | 18,331,402 | 15 | 2013-08-20 09:21:19 | 151,692 | 2013-08-20 09:51:49 | https://stackoverflow.com/q/18329821 | https://stackoverflow.com/a/18331402 | <p>You can use the puppet-nodejs module to manage npm packages. Take a look at <a href="https://forge.puppetlabs.com/puppetlabs/nodejs" rel="noreferrer">https://forge.puppetlabs.com/puppetlabs/nodejs</a></p>
<p>Otherwise, this article should explain how to clone a git repo. <a href="http://livecipher.blogspot.com.au/... | <p>You can use the puppet-nodejs module to manage npm packages. Take a look at <a href="https://forge.puppetlabs.com/puppetlabs/nodejs" rel="noreferrer">https://forge.puppetlabs.com/puppetlabs/nodejs</a></p> <p>Otherwise, this article should explain how to clone a git repo. <a href="http://livecipher.blogspot.com.au/... | 119, 10429, 46426, 61387, 66981 | git, node.js, npm, puppet, vagrant | <h1>How to clone from a github repo and then run npm install on puppet</h1>
<p>I have worked out how to fire up a vagrant box and <code>apt-get install</code> packages</p>
<p>I now want to <code>git clone</code> a node.js repo from github before running <code>npm install</code> and running the app with <code>node app.... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,952 | git | # How to clone from a github repo and then run npm install on puppet
I have worked out how to fire up a vagrant box and `apt-get install` packages
I now want to `git clone` a node.js repo from github before running `npm install` and running the app with `node app.js`
I expected to be able to achieve this by issuing ... | You can use the puppet-nodejs module to manage npm packages. Take a look at <https://forge.puppetlabs.com/puppetlabs/nodejs>
Otherwise, this article should explain how to clone a git repo. <http://livecipher.blogspot.com.au/2013/01/deploy-code-from-git-using-puppet.html>
More info can be found at <https://github.com/... |
17887825 | git subtree push and split adding "-n<newline>" to commit messages | 11 | 2013-07-26 17:50:37 | <p>Whenever I split a subdirectory into a branch via <code>git subtree split</code> or (consequently?) when I push a subtree upstream, the commit messages in the new branch/upstream commits have "-n" and a newline prepended to them.</p>
<p>It's easiest to demonstrate with split:</p>
<pre><code>git init repo
cd repo
m... | 1,216 | 145,080 | 2015-06-24 14:45:38 | 17,891,139 | 15 | 2013-07-26 21:14:19 | 145,080 | 2015-06-24 14:45:38 | https://stackoverflow.com/q/17887825 | https://stackoverflow.com/a/17891139 | <p>It turns out it's a bug in git, introduced in 1.8.3.3.</p>
<p>Specifically, <a href="https://github.com/git/git/commit/779fd737d79a3e19a1aa420c33cf1195c7e20dd7#contrib/subtree/git-subtree.sh" rel="nofollow noreferrer">this merge</a> made subtree run via <code>sh</code> instead of <code>bash</code>, which breaks <a ... | <p>It turns out it's a bug in git, introduced in 1.8.3.3.</p> <p>Specifically, <a href="https://github.com/git/git/commit/779fd737d79a3e19a1aa420c33cf1195c7e20dd7#contrib/subtree/git-subtree.sh" rel="nofollow noreferrer">this merge</a> made subtree run via <code>sh</code> instead of <code>bash</code>, which breaks <a ... | 119, 68200 | git, git-subtree | <h1>git subtree push and split adding "-n<newline>" to commit messages</h1>
<p>Whenever I split a subdirectory into a branch via <code>git subtree split</code> or (consequently?) when I push a subtree upstream, the commit messages in the new branch/upstream commits have "-n" and a newline prepended to them.</p>
<p>It'... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,953 | git | # git subtree push and split adding "-n" to commit messages
Whenever I split a subdirectory into a branch via `git subtree split` or (consequently?) when I push a subtree upstream, the commit messages in the new branch/upstream commits have "-n" and a newline prepended to them.
It's easiest to demonstrate with split:... | It turns out it's a bug in git, introduced in 1.8.3.3.
Specifically, [this merge](https://github.com/git/git/commit/779fd737d79a3e19a1aa420c33cf1195c7e20dd7#contrib/subtree/git-subtree.sh) made subtree run via `sh` instead of `bash`, which breaks [this line](https://github.com/git/git/blob/779fd737d79a3e19a1aa420c33cf... |
16969373 | Summary of changes between two commits of branches in Git | 11 | 2013-06-06 18:23:19 | <p>What command can I use to know how many files are different between two branches, just a summary, not the actual files. Something like:</p>
<pre><code>51 Modified
3 Deleted
4 New files
</code></pre>
| 4,743 | 435,394 | 2020-03-02 09:17:57 | 16,969,612 | 15 | 2013-06-06 18:36:02 | 340,947 | 2013-06-06 18:36:02 | https://stackoverflow.com/q/16969373 | https://stackoverflow.com/a/16969612 | <p>Try <code>git diff --stat</code>. And there's the even shorter <code>--shortstat</code>. </p>
<p>e.g. on branch <code>master</code> type <code>git diff --stat otherbranchname</code></p>
| <p>Try <code>git diff --stat</code>. And there's the even shorter <code>--shortstat</code>. </p> <p>e.g. on branch <code>master</code> type <code>git diff --stat otherbranchname</code></p> | 119 | git | <h1>Summary of changes between two commits of branches in Git</h1>
<p>What command can I use to know how many files are different between two branches, just a summary, not the actual files. Something like:</p>
<pre><code>51 Modified
3 Deleted
4 New files
</code></pre>
| q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,954 | git | # Summary of changes between two commits of branches in Git
What command can I use to know how many files are different between two branches, just a summary, not the actual files. Something like:
```
51 Modified
3 Deleted
4 New files
``` | Try `git diff --stat`. And there's the even shorter `--shortstat`.
e.g. on branch `master` type `git diff --stat otherbranchname` |
6728397 | Joining various commits in one without merging | 11 | 2011-07-18 03:32:20 | <p>Is it possible to join various commits?</p>
<p>This is my case:</p>
<p>My app runst in OSX 10.6 and 10.7 so
I have fixed some stuff for 10.6 then committed,
changed to 10.7 and fixed the fixes again so they are compatible, then commit again.
then went back to 10.6 and check it again and make a small commit again,... | 2,744 | 149,008 | 2013-01-25 13:57:39 | 6,728,433 | 15 | 2011-07-18 03:40:31 | 839,646 | 2011-07-19 02:35:18 | https://stackoverflow.com/q/6728397 | https://stackoverflow.com/a/6728433 | <p>A nice, interactive way is with <code>git rebase -i</code>. Check out a branch, look at the history, and pick a commit that's before the first commit you want to "join" (it's called squashing). Then</p>
<pre><code>git rebase -i <the commit>
</code></pre>
<p>In an editor, you'll be shown a list of commits fro... | <p>A nice, interactive way is with <code>git rebase -i</code>. Check out a branch, look at the history, and pick a commit that's before the first commit you want to "join" (it's called squashing). Then</p> <pre><code>git rebase -i <the commit> </code></pre> <p>In an editor, you'll be shown a list of commits fro... | 119 | git | <h1>Joining various commits in one without merging</h1>
<p>Is it possible to join various commits?</p>
<p>This is my case:</p>
<p>My app runst in OSX 10.6 and 10.7 so
I have fixed some stuff for 10.6 then committed,
changed to 10.7 and fixed the fixes again so they are compatible, then commit again.
then went back t... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,956 | git | # Joining various commits in one without merging
Is it possible to join various commits?
This is my case:
My app runst in OSX 10.6 and 10.7 so
I have fixed some stuff for 10.6 then committed,
changed to 10.7 and fixed the fixes again so they are compatible, then commit again.
then went back to 10.6 and check it agai... | A nice, interactive way is with `git rebase -i`. Check out a branch, look at the history, and pick a commit that's before the first commit you want to "join" (it's called squashing). Then
```
git rebase -i <the commit>
```
In an editor, you'll be shown a list of commits from the one right after the one you chose to t... |
6100578 | git: how to "retrack" untracked file | 11 | 2011-05-23 17:17:55 | <p>I'm fairly new to git...</p>
<p>I untracked a file doing:</p>
<p><code>git update-index --assume-unchanged filename</code></p>
<p>Now I want to commit a change on this file, but I can't figure out how to remove the untrack.
I tried <code>git add filename</code> and <code>git update-index --add filename</code> thi... | 7,118 | 206,808 | 2011-05-23 17:22:03 | 6,100,626 | 15 | 2011-05-23 17:22:03 | 526,535 | 2011-05-23 17:22:03 | https://stackoverflow.com/q/6100578 | https://stackoverflow.com/a/6100626 | <p>Simple:</p>
<pre><code>git update-index --no-assume-unchanged filename
</code></pre>
<p>I don't know where you were looking, but both the flags are grouped together in the documentation:</p>
<p><a href="http://www.kernel.org/pub/software/scm/git/docs/git-update-index.html">http://www.kernel.org/pub/software/scm/... | <p>Simple:</p> <pre><code>git update-index --no-assume-unchanged filename </code></pre> <p>I don't know where you were looking, but both the flags are grouped together in the documentation:</p> <p><a href="http://www.kernel.org/pub/software/scm/git/docs/git-update-index.html">http://www.kernel.org/pub/software/scm/... | 119 | git | <h1>git: how to "retrack" untracked file</h1>
<p>I'm fairly new to git...</p>
<p>I untracked a file doing:</p>
<p><code>git update-index --assume-unchanged filename</code></p>
<p>Now I want to commit a change on this file, but I can't figure out how to remove the untrack.
I tried <code>git add filename</code> and <c... | q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10 | 21,957 | git | # git: how to "retrack" untracked file
I'm fairly new to git...
I untracked a file doing:
`git update-index --assume-unchanged filename`
Now I want to commit a change on this file, but I can't figure out how to remove the untrack.
I tried `git add filename` and `git update-index --add filename` thinking it was the ... | Simple:
```
git update-index --no-assume-unchanged filename
```
I don't know where you were looking, but both the flags are grouped together in the documentation:
<http://www.kernel.org/pub/software/scm/git/docs/git-update-index.html> |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.