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
40675151
What do line colors in git log --graph mean?
37
2016-11-18 10:47:48
<p>I'm curious what do line colors mean in <code>git log --graph</code>? </p> <p>Yes, I'm asking about lines <code>|</code> <code>/</code> <code>\</code> which connect commits <code>*</code> at the left edge of console output. </p> <p><a href="https://i.sstatic.net/SIQUe.png" rel="noreferrer"><img src="https://i.ss...
15,662
6,834,680
2019-10-21 16:04:45
40,684,479
18
2016-11-18 19:16:48
1,256,452
2017-05-16 23:04:40
https://stackoverflow.com/q/40675151
https://stackoverflow.com/a/40684479
<p>The colors are merely meant to help you view the lines as distinct from other lines. To answer question #1, they are assigned not pseudo-randomly, but rather <em>sequentially</em>, each time <code>git log --graph</code> picks a new "column number". Unfortunately there are two issues I know of. Both tie into your ...
<p>The colors are merely meant to help you view the lines as distinct from other lines. To answer question #1, they are assigned not pseudo-randomly, but rather <em>sequentially</em>, each time <code>git log --graph</code> picks a new "column number". Unfortunately there are two issues I know of. Both tie into your ...
119, 5382, 47913
git, git-log, graph
<h1>What do line colors in git log --graph mean?</h1> <p>I'm curious what do line colors mean in <code>git log --graph</code>? </p> <p>Yes, I'm asking about lines <code>|</code> <code>/</code> <code>\</code> which connect commits <code>*</code> at the left edge of console output. </p> <p><a href="https://i.sstatic....
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,949
git
# What do line colors in git log --graph mean? I'm curious what do line colors mean in `git log --graph`? Yes, I'm asking about lines `|` `/` `\` which connect commits `*` at the left edge of console output. [![part of git log --graph output](https://i.sstatic.net/SIQUe.png)](https://i.sstatic.net/SIQUe.png) **Ques...
The colors are merely meant to help you view the lines as distinct from other lines. To answer question #1, they are assigned not pseudo-randomly, but rather *sequentially*, each time `git log --graph` picks a new "column number". Unfortunately there are two issues I know of. Both tie into your question #2. [Here is t...
21518074
Permission denied (publickey,gssapi-keyex,gssapi-with-mic) on openshift
37
2014-02-03 00:21:23
<p>I am having issues with committing changes to my gear. I have tried to run rhc setup, I also deleted my .ssh folder and executed rhc setup again but that also didnt work. </p> <p>Not sure what changed but it worked couple of hours ago. </p> <pre><code>&gt;git push -u &lt;GEAR_NAME&gt; master Permission denied (pub...
170,093
162,345
2024-03-05 00:09:25
21,832,369
18
2014-02-17 15:01:02
162,345
2014-02-17 15:01:02
https://stackoverflow.com/q/21518074
https://stackoverflow.com/a/21832369
<p>Remove the keys: rhc sshkey-remove You can also delete them from the management console, by going to <a href="https://openshift.redhat.com/app/console/settings">https://openshift.redhat.com/app/console/settings</a></p> <p>Once done, upload the public key (copy the content of your id_rsa.pub to management console) ...
<p>Remove the keys: rhc sshkey-remove You can also delete them from the management console, by going to <a href="https://openshift.redhat.com/app/console/settings">https://openshift.redhat.com/app/console/settings</a></p> <p>Once done, upload the public key (copy the content of your id_rsa.pub to management console) ...
119, 28898, 57931, 77738
git, git-push, openshift, public-key
<h1>Permission denied (publickey,gssapi-keyex,gssapi-with-mic) on openshift</h1> <p>I am having issues with committing changes to my gear. I have tried to run rhc setup, I also deleted my .ssh folder and executed rhc setup again but that also didnt work. </p> <p>Not sure what changed but it worked couple of hours ago....
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,950
git
# Permission denied (publickey,gssapi-keyex,gssapi-with-mic) on openshift I am having issues with committing changes to my gear. I have tried to run rhc setup, I also deleted my .ssh folder and executed rhc setup again but that also didnt work. Not sure what changed but it worked couple of hours ago. ``` >git push -...
Remove the keys: rhc sshkey-remove You can also delete them from the management console, by going to <https://openshift.redhat.com/app/console/settings> Once done, upload the public key (copy the content of your id_rsa.pub to management console) : <https://openshift.redhat.com/app/console/keys/new> Save it. After thi...
12177576
How to use "git log --graph --oneline --all" only on my local branches?
37
2012-08-29 12:09:15
<p>I would like to see all my local branches, but none of the remote tracking refs like <code>origin/master</code></p> <p>This command shows me a nice graph decorated with all my local and remote tracking branches:</p> <pre><code>git log --oneline --graph --decorate --all </code></pre> <p>What flag should I add/remove ...
14,362
1,031,417
2022-11-10 09:28:28
12,177,943
18
2012-08-29 12:26:42
981,284
2014-05-12 20:10:29
https://stackoverflow.com/q/12177576
https://stackoverflow.com/a/12177943
<p>Ain't sure what you need but how about something like:</p> <p><code>git log --graph --oneline --branches --not --remotes=*</code></p> <p><em>Note that it may filter out the whole log</em> (e.g. in the case when you have an up-to-date branch so there is nothing you have only locally). Please consult <code>git help...
<p>Ain't sure what you need but how about something like:</p> <p><code>git log --graph --oneline --branches --not --remotes=*</code></p> <p><em>Note that it may filter out the whole log</em> (e.g. in the case when you have an up-to-date branch so there is nothing you have only locally). Please consult <code>git help...
119
git
<h1>How to use "git log --graph --oneline --all" only on my local branches?</h1> <p>I would like to see all my local branches, but none of the remote tracking refs like <code>origin/master</code></p> <p>This command shows me a nice graph decorated with all my local and remote tracking branches:</p> <pre><code>git log -...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,951
git
# How to use "git log --graph --oneline --all" only on my local branches? I would like to see all my local branches, but none of the remote tracking refs like `origin/master` This command shows me a nice graph decorated with all my local and remote tracking branches: ``` git log --oneline --graph --decorate --all ``...
Ain't sure what you need but how about something like: `git log --graph --oneline --branches --not --remotes=*` *Note that it may filter out the whole log* (e.g. in the case when you have an up-to-date branch so there is nothing you have only locally). Please consult `git help log` for the details. If you need only ...
19224476
How does "index f2e4113..d4b9bfc 100644" in git diff correspond to SHA1 ID in gitk?
36
2013-10-07 12:06:06
<p>What does 'index f2e4113..d4b9bfc 100644' mean in the output from git diff? Till now I have assumed that these SHA1 ID's are from_version..to_version, but I can't find them in gitk.</p> <pre><code>$ git --version git version 1.8.3.4 $ git diff ae1fdc1 diff --git a/README b/README index f2e4113..d4b9bfc 100644 --- a...
10,584
2,795,675
2015-10-12 06:28:46
19,225,374
18
2013-10-07 12:48:54
271,129
2015-10-12 06:28:46
https://stackoverflow.com/q/19224476
https://stackoverflow.com/a/19225374
<p>edit: @wiswit has pointed to <a href="http://www.git-tower.com/learn/git/ebook/command-line/advanced-topics/diffs" rel="noreferrer">this</a> good explanation.</p> <p><code>f2e4113</code> and <code>d4b9bfc</code> are file-indexes. With <code>git show f2e4113</code> you see the file before the commit and <code>git sh...
<p>edit: @wiswit has pointed to <a href="http://www.git-tower.com/learn/git/ebook/command-line/advanced-topics/diffs" rel="noreferrer">this</a> good explanation.</p> <p><code>f2e4113</code> and <code>d4b9bfc</code> are file-indexes. With <code>git show f2e4113</code> you see the file before the commit and <code>git sh...
119, 30785
git, gitk
<h1>How does "index f2e4113..d4b9bfc 100644" in git diff correspond to SHA1 ID in gitk?</h1> <p>What does 'index f2e4113..d4b9bfc 100644' mean in the output from git diff? Till now I have assumed that these SHA1 ID's are from_version..to_version, but I can't find them in gitk.</p> <pre><code>$ git --version git versio...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,953
git
# How does "index f2e4113..d4b9bfc 100644" in git diff correspond to SHA1 ID in gitk? What does 'index f2e4113..d4b9bfc 100644' mean in the output from git diff? Till now I have assumed that these SHA1 ID's are from_version..to_version, but I can't find them in gitk. ``` $ git --version git version 1.8.3.4 $ git diff...
edit: @wiswit has pointed to [this](http://www.git-tower.com/learn/git/ebook/command-line/advanced-topics/diffs) good explanation. `f2e4113` and `d4b9bfc` are file-indexes. With `git show f2e4113` you see the file before the commit and `git show d4b9bfc` shows the file after the commit. The *combined diff format* is ...
45293263
Git: "Updates were rejected because the tip of your current branch is behind.." but how to see differences?
34
2017-07-25 03:11:32
<p>I just finished working on a piece of code and when I went to push the changes, I got the already famous:</p> <pre class="lang-none prettyprint-override"><code>hint: Updates were rejected because the tip of your current branch is behind hint: its remote counterpart. Integrate the remote changes (e.g. hint: 'git pul...
115,827
169,252
2023-08-18 02:53:43
45,293,644
18
2017-07-25 03:54:54
402,668
2017-07-25 03:54:54
https://stackoverflow.com/q/45293263
https://stackoverflow.com/a/45293644
<p>in order to see the differences, first you need to fetch the commits from the origin repository:</p> <p><code>git fetch origin</code></p> <p>Now you can see the diffs (Assuming you are on the master branch) <code>git diff HEAD..origin/master</code></p> <p>Now you are armed with the knowledge you seek to decide to...
<p>in order to see the differences, first you need to fetch the commits from the origin repository:</p> <p><code>git fetch origin</code></p> <p>Now you can see the diffs (Assuming you are on the master branch) <code>git diff HEAD..origin/master</code></p> <p>Now you are armed with the knowledge you seek to decide to...
119
git
<h1>Git: "Updates were rejected because the tip of your current branch is behind.." but how to see differences?</h1> <p>I just finished working on a piece of code and when I went to push the changes, I got the already famous:</p> <pre class="lang-none prettyprint-override"><code>hint: Updates were rejected because the ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,954
git
# Git: "Updates were rejected because the tip of your current branch is behind.." but how to see differences? I just finished working on a piece of code and when I went to push the changes, I got the already famous: ``` hint: Updates were rejected because the tip of your current branch is behind hint: its remote coun...
in order to see the differences, first you need to fetch the commits from the origin repository: `git fetch origin` Now you can see the diffs (Assuming you are on the master branch) `git diff HEAD..origin/master` Now you are armed with the knowledge you seek to decide to `merge` or `rebase` before `push`ing your cha...
38495989
How to get git parent branch name from current branch?
34
2016-07-21 05:59:15
<p>Currently I am in a feature branch, but I don't know whether it was created from my develop or release branch.</p> <p>Can anyone please tell me how I can get the parent branch name from the current git branch.</p>
61,800
1,121,225
2025-11-28 18:51:09
38,499,630
18
2016-07-21 09:01:31
3,987,705
2016-07-21 09:01:31
https://stackoverflow.com/q/38495989
https://stackoverflow.com/a/38499630
<p>Given that Git uses a directed acyclic graph and usually a repo only has one root, all your branches point back to one initial commit. So what you actually want is the branch that shares <em>the largest part</em> of its history with your branch.</p> <p>You cannot just look for a branch whose HEAD is contained in yo...
<p>Given that Git uses a directed acyclic graph and usually a repo only has one root, all your branches point back to one initial commit. So what you actually want is the branch that shares <em>the largest part</em> of its history with your branch.</p> <p>You cannot just look for a branch whose HEAD is contained in yo...
119, 1879, 76220
branch, git, git-branch
<h1>How to get git parent branch name from current branch?</h1> <p>Currently I am in a feature branch, but I don't know whether it was created from my develop or release branch.</p> <p>Can anyone please tell me how I can get the parent branch name from the current git branch.</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,955
git
# How to get git parent branch name from current branch? Currently I am in a feature branch, but I don't know whether it was created from my develop or release branch. Can anyone please tell me how I can get the parent branch name from the current git branch.
Given that Git uses a directed acyclic graph and usually a repo only has one root, all your branches point back to one initial commit. So what you actually want is the branch that shares *the largest part* of its history with your branch. You cannot just look for a branch whose HEAD is contained in your current branch...
3511057
Git receive/update hooks and new branches
34
2010-08-18 10:23:24
<p>I have a problem with the 'update' hook. In the case of a new branch, it gets a 0000000000000000000000000000000000000000 as the 'oldrev'. And I don't know how to handle that case.</p> <p>We have the requirement, that every commit message references a valid Jira issue. So I have installed an "update" hook on our cen...
13,120
410,713
2014-06-19 17:15:51
3,512,275
18
2010-08-18 12:55:42
119,963
2013-01-11 09:11:31
https://stackoverflow.com/q/3511057
https://stackoverflow.com/a/3512275
<p>The term "right answer" is a bit ambiguous in this case. I actually think that "all revs reachable from newrev but nowhere else" is completely correct. This is true even if there was a merge - in that case, you should see the commits unique to the new ref, and the merge commit, but not the commits that were merged.<...
<p>The term "right answer" is a bit ambiguous in this case. I actually think that "all revs reachable from newrev but nowhere else" is completely correct. This is true even if there was a merge - in that case, you should see the commits unique to the new ref, and the merge commit, but not the commits that were merged.<...
119, 28898, 43087
git, githooks, git-push
<h1>Git receive/update hooks and new branches</h1> <p>I have a problem with the 'update' hook. In the case of a new branch, it gets a 0000000000000000000000000000000000000000 as the 'oldrev'. And I don't know how to handle that case.</p> <p>We have the requirement, that every commit message references a valid Jira iss...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,956
git
# Git receive/update hooks and new branches I have a problem with the 'update' hook. In the case of a new branch, it gets a 0000000000000000000000000000000000000000 as the 'oldrev'. And I don't know how to handle that case. We have the requirement, that every commit message references a valid Jira issue. So I have in...
The term "right answer" is a bit ambiguous in this case. I actually think that "all revs reachable from newrev but nowhere else" is completely correct. This is true even if there was a merge - in that case, you should see the commits unique to the new ref, and the merge commit, but not the commits that were merged. So...
1969740
GIT undo a commit that isn't the most recent, rebase all commits since
33
2009-12-28 14:36:42
<p>Earlier on, I committed some code which at the time seemed like a good idea, but in fact it made things worse. I'd like to remove the change from the history as it is not helpful, and rebase all commits since - they should all merge without issues.</p> <p>I tried creating a new branch (called <code>newMaster</code>...
126,472
3,408
2012-12-17 16:55:13
1,969,827
18
2009-12-28 14:51:02
69,755
2009-12-28 14:51:02
https://stackoverflow.com/q/1969740
https://stackoverflow.com/a/1969827
<p><code>git rebase -i</code> is the right command, but you want to do it from the branch with the latest changes, and pass in the revision that is the "base" of the rebase operation (the revision immediately before the bad commit). So, if you have created a branch <code>last-good-commit</code> that points to the last ...
<p><code>git rebase -i</code> is the right command, but you want to do it from the branch with the latest changes, and pass in the revision that is the "base" of the rebase operation (the revision immediately before the bad commit). So, if you have created a branch <code>last-good-commit</code> that points to the last ...
119, 29934
git, git-rebase
<h1>GIT undo a commit that isn't the most recent, rebase all commits since</h1> <p>Earlier on, I committed some code which at the time seemed like a good idea, but in fact it made things worse. I'd like to remove the change from the history as it is not helpful, and rebase all commits since - they should all merge with...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,959
git
# GIT undo a commit that isn't the most recent, rebase all commits since Earlier on, I committed some code which at the time seemed like a good idea, but in fact it made things worse. I'd like to remove the change from the history as it is not helpful, and rebase all commits since - they should all merge without issue...
`git rebase -i` is the right command, but you want to do it from the branch with the latest changes, and pass in the revision that is the "base" of the rebase operation (the revision immediately before the bad commit). So, if you have created a branch `last-good-commit` that points to the last good commit, you would wa...
27356915
How to update npm modules, ignoring a git repo
32
2014-12-08 11:24:33
<p>I forked one of npm modules and now it is a git repo.</p> <p>So my package.json:</p> <pre><code>"dependencies": { "some-module": "git+https://github.com/my-name/some-module.git", } </code></pre> <p>Forked repo is synchronized by fetching upstream and merging. But when I try to update other npm modules it give...
15,827
3,401,897
2024-04-02 06:18:29
36,129,219
18
2016-03-21 10:58:49
3,005,251
2016-03-21 10:58:49
https://stackoverflow.com/q/27356915
https://stackoverflow.com/a/36129219
<p>npm checks all directories for the existance of a <code>.git</code> directory, and throws the <code>EISGIT</code> error if it exists, so there is no way to ignore it or skip it.</p> <p>The <a href="https://github.com/npm/npm/blob/f2ae3baf9e4b48282bcfceb94ce861b9221450d0/lib/install/validate-tree.js#L24" rel="norefe...
<p>npm checks all directories for the existance of a <code>.git</code> directory, and throws the <code>EISGIT</code> error if it exists, so there is no way to ignore it or skip it.</p> <p>The <a href="https://github.com/npm/npm/blob/f2ae3baf9e4b48282bcfceb94ce861b9221450d0/lib/install/validate-tree.js#L24" rel="norefe...
119, 61387
git, npm
<h1>How to update npm modules, ignoring a git repo</h1> <p>I forked one of npm modules and now it is a git repo.</p> <p>So my package.json:</p> <pre><code>"dependencies": { "some-module": "git+https://github.com/my-name/some-module.git", } </code></pre> <p>Forked repo is synchronized by fetching upstream and mer...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,961
git
# How to update npm modules, ignoring a git repo I forked one of npm modules and now it is a git repo. So my package.json: ``` "dependencies": { "some-module": "git+https://github.com/my-name/some-module.git", } ``` Forked repo is synchronized by fetching upstream and merging. But when I try to update other npm...
npm checks all directories for the existance of a `.git` directory, and throws the `EISGIT` error if it exists, so there is no way to ignore it or skip it. The [code](https://github.com/npm/npm/blob/f2ae3baf9e4b48282bcfceb94ce861b9221450d0/lib/install/validate-tree.js#L24) does however check if it's a link: ``` mod.p...
8887708
Alias git stash poop to pop?
32
2012-01-16 23:23:21
<p>This is an admittedly silly question, but I honestly don't know if this is possible.</p> <p>I often mistype "git stash pop" (never-mind why). Can I map/shortcut/alias my typo to what it's supposed to be?</p>
3,693
916,604
2018-05-31 16:52:27
8,887,761
18
2012-01-16 23:29:39
306,042
2012-01-16 23:34:45
https://stackoverflow.com/q/8887708
https://stackoverflow.com/a/8887761
<pre><code>git config --global alias.sp 'stash pop' </code></pre> <p>then <code>git sp</code> expands to <code>git stash pop</code></p>
<pre><code>git config --global alias.sp 'stash pop' </code></pre> <p>then <code>git sp</code> expands to <code>git stash pop</code></p>
119, 1231, 11225
command-line, command-line-interface, git
<h1>Alias git stash poop to pop?</h1> <p>This is an admittedly silly question, but I honestly don't know if this is possible.</p> <p>I often mistype "git stash pop" (never-mind why). Can I map/shortcut/alias my typo to what it's supposed to be?</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,963
git
# Alias git stash poop to pop? This is an admittedly silly question, but I honestly don't know if this is possible. I often mistype "git stash pop" (never-mind why). Can I map/shortcut/alias my typo to what it's supposed to be?
``` git config --global alias.sp 'stash pop' ``` then `git sp` expands to `git stash pop`
12129148
Incremental backups with git bundle, for all branches
29
2012-08-26 09:50:58
<p>What is the easiest way to do incremental backups of a git repository with <code>git bundle</code>?</p> <p>If I just wanted to backup a single branch, I could do something along these lines:</p> <pre><code>git bundle create foo last-backup..master git tag -f last-backup master </code></pre> <p>But what if I want ...
12,414
383,299
2013-03-02 08:22:19
12,216,898
18
2012-08-31 13:58:33
1,061,656
2012-08-31 13:58:33
https://stackoverflow.com/q/12129148
https://stackoverflow.com/a/12216898
<p>(We discussed this problem with Jukka, this is the outcome.)</p> <p>Preliminaries:</p> <ol> <li>Have the last backup available as <code>backup.bundle</code></li> <li>Have a remote <code>backup</code> that points at <code>backup.bundle</code></li> </ol> <p>Making a backup:</p> <ol> <li><code>git fetch backup</cod...
<p>(We discussed this problem with Jukka, this is the outcome.)</p> <p>Preliminaries:</p> <ol> <li>Have the last backup available as <code>backup.bundle</code></li> <li>Have a remote <code>backup</code> that points at <code>backup.bundle</code></li> </ol> <p>Making a backup:</p> <ol> <li><code>git fetch backup</cod...
119, 493
backup, git
<h1>Incremental backups with git bundle, for all branches</h1> <p>What is the easiest way to do incremental backups of a git repository with <code>git bundle</code>?</p> <p>If I just wanted to backup a single branch, I could do something along these lines:</p> <pre><code>git bundle create foo last-backup..master git ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,964
git
# Incremental backups with git bundle, for all branches What is the easiest way to do incremental backups of a git repository with `git bundle`? If I just wanted to backup a single branch, I could do something along these lines: ``` git bundle create foo last-backup..master git tag -f last-backup master ``` But wha...
(We discussed this problem with Jukka, this is the outcome.) Preliminaries: 1. Have the last backup available as `backup.bundle` 2. Have a remote `backup` that points at `backup.bundle` Making a backup: 1. `git fetch backup` – just to make sure we're up to date 2. `git bundle create newbackup.bundle ^backup/A ^back...
21259585
Other consequences of `git push --force`?
28
2014-01-21 13:29:28
<p>Questions and answers about forcing a <code>git push</code> aren't hard to find (<a href="https://stackoverflow.com/questions/11184267/how-to-push-to-repo-after-doing-git-commit-amend">here</a> are <a href="https://stackoverflow.com/questions/5509543/how-to-properly-force-a-git-push">two</a>). The standard answer go...
18,722
77,047
2014-01-21 15:32:12
21,260,403
18
2014-01-21 14:06:30
1,256,452
2014-01-21 14:17:29
https://stackoverflow.com/q/21259585
https://stackoverflow.com/a/21260403
<p>A force-push merely tells the remote to move the given label(s) even if the move is not a fast-forward operation.<sup>1</sup> A non-fast-forward can (does not necessarily) result in "abandoned" commits: commits that are no longer reachable from some reference.</p> <p>(It does <em>not</em> do this when the label mo...
<p>A force-push merely tells the remote to move the given label(s) even if the move is not a fast-forward operation.<sup>1</sup> A non-fast-forward can (does not necessarily) result in "abandoned" commits: commits that are no longer reachable from some reference.</p> <p>(It does <em>not</em> do this when the label mo...
119, 456
git, version-control
<h1>Other consequences of `git push --force`?</h1> <p>Questions and answers about forcing a <code>git push</code> aren't hard to find (<a href="https://stackoverflow.com/questions/11184267/how-to-push-to-repo-after-doing-git-commit-amend">here</a> are <a href="https://stackoverflow.com/questions/5509543/how-to-properly...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,965
git
# Other consequences of `git push --force`? Questions and answers about forcing a `git push` aren't hard to find ([here](https://stackoverflow.com/questions/11184267/how-to-push-to-repo-after-doing-git-commit-amend) are [two](https://stackoverflow.com/questions/5509543/how-to-properly-force-a-git-push)). The standard ...
A force-push merely tells the remote to move the given label(s) even if the move is not a fast-forward operation.1 A non-fast-forward can (does not necessarily) result in "abandoned" commits: commits that are no longer reachable from some reference. (It does *not* do this when the label motion occurs on a part of the ...
14332320
Git no space left on device
28
2013-01-15 06:35:41
<p>I did <strong>git pull --rebase</strong> and I got following error:</p> <pre><code> error: file write error (No space left on device) fatal: unable to write sha1 file fatal: unpack-objects failed </code></pre> <p>I have lot of space on my device. Don't know why it is showing this error. </p> <p>First time I go...
79,728
1,133,674
2023-01-23 05:27:21
14,332,342
18
2013-01-15 06:37:49
53,139
2013-01-15 06:43:05
https://stackoverflow.com/q/14332320
https://stackoverflow.com/a/14332342
<p>You're out of drive space. Delete some <em>unused</em> files from anywhere on your machine. After you've done some housecleaning, you may think about running <code>git gc</code> to have git garbage collect your repository; if you've made lots of changes to git's objects recently - like can happen with a rebase - you...
<p>You're out of drive space. Delete some <em>unused</em> files from anywhere on your machine. After you've done some housecleaning, you may think about running <code>git gc</code> to have git garbage collect your repository; if you've made lots of changes to git's objects recently - like can happen with a rebase - you...
119, 28896, 29934
git, git-pull, git-rebase
<h1>Git no space left on device</h1> <p>I did <strong>git pull --rebase</strong> and I got following error:</p> <pre><code> error: file write error (No space left on device) fatal: unable to write sha1 file fatal: unpack-objects failed </code></pre> <p>I have lot of space on my device. Don't know why it is showing...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,966
git
# Git no space left on device I did **git pull --rebase** and I got following error: ``` error: file write error (No space left on device) fatal: unable to write sha1 file fatal: unpack-objects failed ``` I have lot of space on my device. Don't know why it is showing this error. First time I got this error.
You're out of drive space. Delete some *unused* files from anywhere on your machine. After you've done some housecleaning, you may think about running `git gc` to have git garbage collect your repository; if you've made lots of changes to git's objects recently - like can happen with a rebase - you can reclaim signific...
1408381
Combine local Git commits into one commit for git-svn
28
2009-09-11 00:07:24
<p>Currently, when I run <code>git svn dcommit</code> git creates a separate commit in SVN for every local commit I've made since last syncing with SVN. Is there any way for <code>dcommit</code> to instead combine all my recent local commits into one commit for SVN?</p>
8,728
83,679
2012-04-02 13:29:16
1,408,402
18
2009-09-11 00:18:33
null
2010-04-14 20:44:31
https://stackoverflow.com/q/1408381
https://stackoverflow.com/a/1408402
<pre><code>git rebase remotes/trunk --interactive </code></pre> <p>should bring you to the menu where you can pick commits or squash them all into 1 commit in order to avoid polluting your svn repository. <a href="http://orestis.gr/blog/2008/08/23/git-svn-tutorial/" rel="noreferrer">This</a> is a really good (but sh...
<pre><code>git rebase remotes/trunk --interactive </code></pre> <p>should bring you to the menu where you can pick commits or squash them all into 1 commit in order to avoid polluting your svn repository. <a href="http://orestis.gr/blog/2008/08/23/git-svn-tutorial/" rel="noreferrer">This</a> is a really good (but sh...
5597, 6452, 38432
commit, dcommit, git-svn
<h1>Combine local Git commits into one commit for git-svn</h1> <p>Currently, when I run <code>git svn dcommit</code> git creates a separate commit in SVN for every local commit I've made since last syncing with SVN. Is there any way for <code>dcommit</code> to instead combine all my recent local commits into one commit...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,967
git
# Combine local Git commits into one commit for git-svn Currently, when I run `git svn dcommit` git creates a separate commit in SVN for every local commit I've made since last syncing with SVN. Is there any way for `dcommit` to instead combine all my recent local commits into one commit for SVN?
``` git rebase remotes/trunk --interactive ``` should bring you to the menu where you can pick commits or squash them all into 1 commit in order to avoid polluting your svn repository. [This](http://orestis.gr/blog/2008/08/23/git-svn-tutorial/) is a really good (but short) resource on working with git-svn.
70998844
Git warning "encountered old-style '/home/user/.gitignore' that should be '%(prefix)/home/user/.gitignore'"
27
2022-02-05 14:17:37
<p>Using git version 2.35.1.windows.2, all Git invocations include this warning at least once:</p> <pre><code>PS C:\Users\BoppreH\Desktop\source\keyboard&gt; git status warning: encountered old-style '/home/boppreh/.gitignore' that should be '%(prefix)/home/boppreh/.gitignore' On branch new_core Your branch is up to da...
21,862
252,218
2023-04-20 07:32:35
71,913,531
18
2022-04-18 15:05:28
1,219,446
2022-04-18 15:05:28
https://stackoverflow.com/q/70998844
https://stackoverflow.com/a/71913531
<p>For the latest <code>git</code> releases for Windows, prepending <code>%(prefix)</code> on any root file-reference is suggested.</p> <p>Otherwise you will get the warning that you are referring to. The amount of times that you will get it depends on the <code>git</code> command that you are running. Which effectivel...
<p>For the latest <code>git</code> releases for Windows, prepending <code>%(prefix)</code> on any root file-reference is suggested.</p> <p>Otherwise you will get the warning that you are referring to. The amount of times that you will get it depends on the <code>git</code> command that you are running. Which effectivel...
119
git
<h1>Git warning "encountered old-style '/home/user/.gitignore' that should be '%(prefix)/home/user/.gitignore'"</h1> <p>Using git version 2.35.1.windows.2, all Git invocations include this warning at least once:</p> <pre><code>PS C:\Users\BoppreH\Desktop\source\keyboard&gt; git status warning: encountered old-style '/h...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,968
git
# Git warning "encountered old-style '/home/user/.gitignore' that should be '%(prefix)/home/user/.gitignore'" Using git version 2.35.1.windows.2, all Git invocations include this warning at least once: ``` PS C:\Users\BoppreH\Desktop\source\keyboard> git status warning: encountered old-style '/home/boppreh/.gitignore...
For the latest `git` releases for Windows, prepending `%(prefix)` on any root file-reference is suggested. Otherwise you will get the warning that you are referring to. The amount of times that you will get it depends on the `git` command that you are running. Which effectively reflects the number of times that such r...
44163307
Why does `git checkout <branch> <file>` stage the change?
27
2017-05-24 15:58:06
<p>If I start from a clean working tree and run <code>git checkout &lt;branch&gt; &lt;file&gt;</code>, where <code>&lt;branch&gt;</code> has a different version of this file, I end up with a staged rather than an unstaged change.</p> <p>What's the reason for this? Is this just for consistency with other commands like ...
5,883
378,418
2019-04-22 21:19:33
44,167,380
18
2017-05-24 19:54:48
1,256,452
2017-05-24 19:54:48
https://stackoverflow.com/q/44163307
https://stackoverflow.com/a/44167380
<p>It's really an implementation detail that the Git authors chose to let show through.</p> <p>Git cannot—or rather, at one point, <em>could</em> not—read files directly from the repository into the work-tree. It has (or had) to pass them through an intermediary first: it had to copy them, or at least their vital sta...
<p>It's really an implementation detail that the Git authors chose to let show through.</p> <p>Git cannot—or rather, at one point, <em>could</em> not—read files directly from the repository into the work-tree. It has (or had) to pass them through an intermediary first: it had to copy them, or at least their vital sta...
119, 1879, 37230, 76220
branch, git, git-branch, git-checkout
<h1>Why does `git checkout <branch> <file>` stage the change?</h1> <p>If I start from a clean working tree and run <code>git checkout &lt;branch&gt; &lt;file&gt;</code>, where <code>&lt;branch&gt;</code> has a different version of this file, I end up with a staged rather than an unstaged change.</p> <p>What's the reas...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,969
git
# Why does `git checkout ` stage the change? If I start from a clean working tree and run `git checkout <branch> <file>`, where `<branch>` has a different version of this file, I end up with a staged rather than an unstaged change. What's the reason for this? Is this just for consistency with other commands like `git...
It's really an implementation detail that the Git authors chose to let show through. Git cannot—or rather, at one point, *could* not—read files directly from the repository into the work-tree. It has (or had) to pass them through an intermediary first: it had to copy them, or at least their vital statistics,1 somewher...
34807971
Why does git diff-index HEAD result change for touched files after git diff or git status?
27
2016-01-15 09:28:27
<p>If I <code>touch</code> a file tracked in a git repo, and run <code>git diff-index HEAD</code>, it will print output with <code>M</code> indicating the file has been modified. For example,</p> <pre><code>$ touch foo $ git diff-index HEAD :100644 100644 257cc5642cb1a054f08cc83f2d943e56fd3ebe99 0000000000000000000000...
3,790
4,725,969
2016-01-15 09:47:59
34,808,299
18
2016-01-15 09:47:59
216,074
2016-01-15 09:47:59
https://stackoverflow.com/q/34807971
https://stackoverflow.com/a/34808299
<p>Let’s first take a look at what the output means:</p> <pre><code>:100644 100644 257cc5642cb1a054f08cc83f2d943e56fd3ebe99 0000000000000000000000000000000000000000 M foo </code></pre> <p><a href="http://git-scm.com/docs/git-diff-index" rel="noreferrer">The manual</a> says the following, from left to right:</p> <bl...
<p>Let’s first take a look at what the output means:</p> <pre><code>:100644 100644 257cc5642cb1a054f08cc83f2d943e56fd3ebe99 0000000000000000000000000000000000000000 M foo </code></pre> <p><a href="http://git-scm.com/docs/git-diff-index" rel="noreferrer">The manual</a> says the following, from left to right:</p> <bl...
119
git
<h1>Why does git diff-index HEAD result change for touched files after git diff or git status?</h1> <p>If I <code>touch</code> a file tracked in a git repo, and run <code>git diff-index HEAD</code>, it will print output with <code>M</code> indicating the file has been modified. For example,</p> <pre><code>$ touch foo ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,970
git
# Why does git diff-index HEAD result change for touched files after git diff or git status? If I `touch` a file tracked in a git repo, and run `git diff-index HEAD`, it will print output with `M` indicating the file has been modified. For example, ``` $ touch foo $ git diff-index HEAD :100644 100644 257cc5642cb1a054...
Let’s first take a look at what the output means: ``` :100644 100644 257cc5642cb1a054f08cc83f2d943e56fd3ebe99 0000000000000000000000000000000000000000 M foo ``` [The manual](http://git-scm.com/docs/git-diff-index) says the following, from left to right: > 1. a colon. > 2. mode for "src"; 000000 if creation or unmer...
26372569
Git: interactive rebase lists incorrect (too many) commits
27
2014-10-15 00:25:38
<p>When I run <code>git rebase -i HEAD~2</code>, it lists 11 commits instead of 2. Why?</p> <p>What I've done prior to this was:</p> <ol> <li>Checked out upstream/branchA</li> <li>Rebased my new local copy of branchA with master</li> <li>Tried to push my local branchA back to upstream <ul> <li>Git complained that the...
13,513
758,177
2020-05-14 10:25:03
26,372,773
18
2014-10-15 00:54:31
67,579
2014-10-15 16:42:26
https://stackoverflow.com/q/26372569
https://stackoverflow.com/a/26372773
<p>It depends on how your <code>git</code> tree looks like. A <em>"merge"</em> commit for instance can have two or more parents. Depending on this, your <em>commit</em> can have multiple grandparents.</p> <p>You probably need to rebase with</p> <pre><code>git rebase -i HEAD^1^2 git rebase -i HEAD^2^1 git rebase -i HE...
<p>It depends on how your <code>git</code> tree looks like. A <em>"merge"</em> commit for instance can have two or more parents. Depending on this, your <em>commit</em> can have multiple grandparents.</p> <p>You probably need to rebase with</p> <pre><code>git rebase -i HEAD^1^2 git rebase -i HEAD^2^1 git rebase -i HE...
119, 84381
git, git-interactive-rebase
<h1>Git: interactive rebase lists incorrect (too many) commits</h1> <p>When I run <code>git rebase -i HEAD~2</code>, it lists 11 commits instead of 2. Why?</p> <p>What I've done prior to this was:</p> <ol> <li>Checked out upstream/branchA</li> <li>Rebased my new local copy of branchA with master</li> <li>Tried to pus...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,971
git
# Git: interactive rebase lists incorrect (too many) commits When I run `git rebase -i HEAD~2`, it lists 11 commits instead of 2. Why? What I've done prior to this was: 1. Checked out upstream/branchA 2. Rebased my new local copy of branchA with master 3. Tried to push my local branchA back to upstream - Git comp...
It depends on how your `git` tree looks like. A *"merge"* commit for instance can have two or more parents. Depending on this, your *commit* can have multiple grandparents. You probably need to rebase with ``` git rebase -i HEAD^1^2 git rebase -i HEAD^2^1 git rebase -i HEAD^2^2 ``` (one of these three). See [here](...
18222728
What is the difference between push branch and merge to master then push?
27
2013-08-14 03:27:25
<p>One way:</p> <pre><code>git checkout myBranch git push origin myBranch:master </code></pre> <p>Another way:</p> <pre><code>git checkout master git merge myBranch git push </code></pre> <p>What is difference between these two?</p>
57,575
1,025,192
2013-08-14 06:20:57
18,222,813
18
2013-08-14 03:39:33
null
2013-08-14 06:20:57
https://stackoverflow.com/q/18222728
https://stackoverflow.com/a/18222813
<p>This:</p> <pre><code>git checkout myBranch git push origin myBranch:master </code></pre> <p>just attempts to do a fast-forward (i.e. non-forced update) push of <code>myBranch</code> to <code>master</code>. If <code>master</code> is reachable from <code>myBranch</code>, i.e. <code>master</code> doesn't contain any ...
<p>This:</p> <pre><code>git checkout myBranch git push origin myBranch:master </code></pre> <p>just attempts to do a fast-forward (i.e. non-forced update) push of <code>myBranch</code> to <code>master</code>. If <code>master</code> is reachable from <code>myBranch</code>, i.e. <code>master</code> doesn't contain any ...
119
git
<h1>What is the difference between push branch and merge to master then push?</h1> <p>One way:</p> <pre><code>git checkout myBranch git push origin myBranch:master </code></pre> <p>Another way:</p> <pre><code>git checkout master git merge myBranch git push </code></pre> <p>What is difference between these two?</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,972
git
# What is the difference between push branch and merge to master then push? One way: ``` git checkout myBranch git push origin myBranch:master ``` Another way: ``` git checkout master git merge myBranch git push ``` What is difference between these two?
This: ``` git checkout myBranch git push origin myBranch:master ``` just attempts to do a fast-forward (i.e. non-forced update) push of `myBranch` to `master`. If `master` is reachable from `myBranch`, i.e. `master` doesn't contain any commits that `myBranch` doesn't also have, then the push will succeed; otherwise, ...
13446842
How do I do git push with JGit?
27
2012-11-19 02:20:22
<p>I'm trying to build a Java application that allows users to use Git based repositories. I was able to do this from the command-line, using the following commands:</p> <pre><code>git init &lt;create some files&gt; git add . git commit git remote add &lt;remote repository name&gt; &lt;remote repository URI&gt; git pu...
33,598
476,077
2025-08-08 15:08:29
13,451,225
18
2012-11-19 09:48:15
6,309
2025-08-08 15:08:29
https://stackoverflow.com/q/13446842
https://stackoverflow.com/a/13451225
<p>You will find in <a href="https://github.com/eclipse-jgit/jgit/tree/master/org.eclipse.jgit.test" rel="nofollow noreferrer"><code>org.eclipse.jgit.test</code></a> all the example you need:</p> <ul> <li><p><a href="https://github.com/eclipse-jgit/jgit/blob/master/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/R...
<p>You will find in <a href="https://github.com/eclipse-jgit/jgit/tree/master/org.eclipse.jgit.test" rel="nofollow noreferrer"><code>org.eclipse.jgit.test</code></a> all the example you need:</p> <ul> <li><p><a href="https://github.com/eclipse-jgit/jgit/blob/master/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/R...
119, 61058
git, jgit
<h1>How do I do git push with JGit?</h1> <p>I'm trying to build a Java application that allows users to use Git based repositories. I was able to do this from the command-line, using the following commands:</p> <pre><code>git init &lt;create some files&gt; git add . git commit git remote add &lt;remote repository name...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,973
git
# How do I do git push with JGit? I'm trying to build a Java application that allows users to use Git based repositories. I was able to do this from the command-line, using the following commands: ``` git init <create some files> git add . git commit git remote add <remote repository name> <remote repository URI> git...
You will find in [`org.eclipse.jgit.test`](https://github.com/eclipse-jgit/jgit/tree/master/org.eclipse.jgit.test) all the example you need: - [`RemoteconfigTest.java`](https://github.com/eclipse-jgit/jgit/blob/master/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/RemoteConfigTest.java) uses [`Config`](https://g...
50158417
Git checkout file from branch without changing index
26
2018-05-03 15:11:16
<p>In my git development I am using the following checkout command structure to bring in solitary files from other branches into my working directory. </p> <pre><code>git checkout [&lt;tree-ish&gt;] [--] &lt;pathspec&gt;…​ </code></pre> <p>As per documentation, this also updates my index with the file as if I wanted ...
4,157
9,128,460
2025-05-13 09:43:26
50,158,600
18
2018-05-03 15:19:33
1,701,296
2018-05-03 15:19:33
https://stackoverflow.com/q/50158417
https://stackoverflow.com/a/50158600
<p>Another way would be </p> <pre><code>git show otherBranch:fileName &gt; fileName </code></pre> <p>This creates a new file with the content of the file in the other branch</p> <p>Anyway if your workflow requires this step to be done often, I would create an alias</p>
<p>Another way would be </p> <pre><code>git show otherBranch:fileName &gt; fileName </code></pre> <p>This creates a new file with the content of the file in the other branch</p> <p>Anyway if your workflow requires this step to be done often, I would create an alias</p>
119, 130914
git, vcs-checkout
<h1>Git checkout file from branch without changing index</h1> <p>In my git development I am using the following checkout command structure to bring in solitary files from other branches into my working directory. </p> <pre><code>git checkout [&lt;tree-ish&gt;] [--] &lt;pathspec&gt;…​ </code></pre> <p>As per documenta...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,974
git
# Git checkout file from branch without changing index In my git development I am using the following checkout command structure to bring in solitary files from other branches into my working directory. ``` git checkout [<tree-ish>] [--] <pathspec>…​ ``` As per documentation, this also updates my index with the file...
Another way would be ``` git show otherBranch:fileName > fileName ``` This creates a new file with the content of the file in the other branch Anyway if your workflow requires this step to be done often, I would create an alias
12544142
Git - error: RPC failed; result=22, HTTP code = 401 fatal: The remote end hung up unexpectedly
26
2012-09-22 13:21:46
<p>I am using ubuntu 11.10 machine. I have installed git of version 1.7.7.1. I am using git-cola to push and pull my code and I was able to commit and push my changes successfully.</p> <p>Now, I have changed my machine and my new system is with the same above configurations. (Ubuntu 11.10 machine and git version 1.7.7...
58,884
null
2020-09-19 16:43:11
12,544,382
18
2012-09-22 13:57:07
11,343
2012-09-22 13:57:07
https://stackoverflow.com/q/12544142
https://stackoverflow.com/a/12544382
<p>You must have made a mistake in the remote URL, double-check the output with <code>git remote -v</code> and fix it with </p> <pre><code> git remote set-url origin &lt;new-url&gt; </code></pre> <p>assuming the remote name is <code>origin</code></p>
<p>You must have made a mistake in the remote URL, double-check the output with <code>git remote -v</code> and fix it with </p> <pre><code> git remote set-url origin &lt;new-url&gt; </code></pre> <p>assuming the remote name is <code>origin</code></p>
119, 41346
git, git-remote
<h1>Git - error: RPC failed; result=22, HTTP code = 401 fatal: The remote end hung up unexpectedly</h1> <p>I am using ubuntu 11.10 machine. I have installed git of version 1.7.7.1. I am using git-cola to push and pull my code and I was able to commit and push my changes successfully.</p> <p>Now, I have changed my mach...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,975
git
# Git - error: RPC failed; result=22, HTTP code = 401 fatal: The remote end hung up unexpectedly I am using ubuntu 11.10 machine. I have installed git of version 1.7.7.1. I am using git-cola to push and pull my code and I was able to commit and push my changes successfully. Now, I have changed my machine and my new s...
You must have made a mistake in the remote URL, double-check the output with `git remote -v` and fix it with ``` git remote set-url origin <new-url> ``` assuming the remote name is `origin`
11158359
git cherry-pick -x default
26
2012-06-22 14:36:34
<p>In the <a href="https://git-scm.com/docs/git-cherry-pick#Documentation/git-cherry-pick.txt--x" rel="noreferrer">man page for</a> <code>git cherry-pick</code>:</p> <pre><code>... -x When recording the commit, append a line that says &quot;(cherry picked from commit …)&quot; to the original commit message in ...
6,710
718,180
2021-12-09 17:33:32
11,196,597
18
2012-06-25 20:10:12
718,180
2012-06-25 20:10:12
https://stackoverflow.com/q/11158359
https://stackoverflow.com/a/11196597
<p>Short of making an alias for <code>git cherry-pick -x</code>, no, this is not possible.</p> <p>(Fun fact: The default was changed in commit <a href="https://github.com/git/git/commit/abd6970acad5d758f48c13f7420367ae8216038e">abd6970</a>.)</p>
<p>Short of making an alias for <code>git cherry-pick -x</code>, no, this is not possible.</p> <p>(Fun fact: The default was changed in commit <a href="https://github.com/git/git/commit/abd6970acad5d758f48c13f7420367ae8216038e">abd6970</a>.)</p>
119, 3574, 36489
cherry-pick, config, git
<h1>git cherry-pick -x default</h1> <p>In the <a href="https://git-scm.com/docs/git-cherry-pick#Documentation/git-cherry-pick.txt--x" rel="noreferrer">man page for</a> <code>git cherry-pick</code>:</p> <pre><code>... -x When recording the commit, append a line that says &quot;(cherry picked from commit …)&quot...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,976
git
# git cherry-pick -x default In the [man page for](https://git-scm.com/docs/git-cherry-pick#Documentation/git-cherry-pick.txt--x) `git cherry-pick`: ``` ... -x When recording the commit, append a line that says "(cherry picked from commit …)" to the original commit message in order to indicate which comm...
Short of making an alias for `git cherry-pick -x`, no, this is not possible. (Fun fact: The default was changed in commit [abd6970](https://github.com/git/git/commit/abd6970acad5d758f48c13f7420367ae8216038e).)
15254480
Reverse a git fetch
25
2013-03-06 17:52:38
<p>I have a thorough understanding of git, and the difference between pull, fetch, and merge. I have a remote that I track, fetch, and merge with occasionally, let say it's origin/master. What I'm looking to do is reverse the behavior of a 'git fetch'. It sounds goofy, but I want to un-update where my remote trackin...
14,612
2,141,094
2019-08-22 10:05:18
15,254,892
18
2013-03-06 18:14:36
1,290,731
2013-03-06 18:14:36
https://stackoverflow.com/q/15254480
https://stackoverflow.com/a/15254892
<p>You want</p> <blockquote> <p><code>git update-ref refs/remotes/origin/master refs/remotes/origin/master@{1}</code></p> </blockquote> <p><code>update-ref</code> wants the full spell on the ref it's updating because it's (much) lower level than the commands that respect ref-naming conventions.</p>
<p>You want</p> <blockquote> <p><code>git update-ref refs/remotes/origin/master refs/remotes/origin/master@{1}</code></p> </blockquote> <p><code>update-ref</code> wants the full spell on the ref it's updating because it's (much) lower level than the commands that respect ref-naming conventions.</p>
119, 33720
git, git-fetch
<h1>Reverse a git fetch</h1> <p>I have a thorough understanding of git, and the difference between pull, fetch, and merge. I have a remote that I track, fetch, and merge with occasionally, let say it's origin/master. What I'm looking to do is reverse the behavior of a 'git fetch'. It sounds goofy, but I want to un-u...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,977
git
# Reverse a git fetch I have a thorough understanding of git, and the difference between pull, fetch, and merge. I have a remote that I track, fetch, and merge with occasionally, let say it's origin/master. What I'm looking to do is reverse the behavior of a 'git fetch'. It sounds goofy, but I want to un-update where ...
You want > `git update-ref refs/remotes/origin/master refs/remotes/origin/master@{1}` `update-ref` wants the full spell on the ref it's updating because it's (much) lower level than the commands that respect ref-naming conventions.
3214871
git push .git/description file
25
2010-07-09 16:58:56
<p>Is it possible to push the changes in the <code>.git</code> directory to a remote repository?</p> <p>I wish to have a common project <code>description</code> and not have to re-enter it for all the clones of my repository.</p> <p>It's strange that the project description is something that is not common to each clo...
10,466
84,399
2013-06-02 19:45:52
3,214,908
18
2010-07-09 17:04:43
28,804
2010-07-09 17:04:43
https://stackoverflow.com/q/3214871
https://stackoverflow.com/a/3214908
<p>You could store a <code>description</code> (or <code>.description</code>, if you don't want it to be visible) in the root of your repo, and then symlink <code>.git/description</code> to that in each repo, like so:</p> <pre><code>repo/ .description .git/ description -&gt; ../.description </code></pre> <p>Yo...
<p>You could store a <code>description</code> (or <code>.description</code>, if you don't want it to be visible) in the root of your repo, and then symlink <code>.git/description</code> to that in each repo, like so:</p> <pre><code>repo/ .description .git/ description -&gt; ../.description </code></pre> <p>Yo...
119, 31236
git, gitweb
<h1>git push .git/description file</h1> <p>Is it possible to push the changes in the <code>.git</code> directory to a remote repository?</p> <p>I wish to have a common project <code>description</code> and not have to re-enter it for all the clones of my repository.</p> <p>It's strange that the project description is ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,978
git
# git push .git/description file Is it possible to push the changes in the `.git` directory to a remote repository? I wish to have a common project `description` and not have to re-enter it for all the clones of my repository. It's strange that the project description is something that is not common to each clone.
You could store a `description` (or `.description`, if you don't want it to be visible) in the root of your repo, and then symlink `.git/description` to that in each repo, like so: ``` repo/ .description .git/ description -> ../.description ``` You'd have to set up the symlink manually in each of your repos, ...
20790014
Git: Copy source code to new branch without history
23
2013-12-26 19:17:31
<p>I have 2 branches in git repository: <code>common</code> and <code>myown</code>.</p> <p>I want to copy the source from one branch to another branch but I want to see in history of <code>common</code> branch only commits related to feature migration (from <code>myown</code> to <code>common</code>).</p> <p>Is it pos...
22,892
3,137,536
2022-06-22 13:16:44
20,871,312
18
2014-01-01 17:36:11
3,137,536
2022-06-22 13:16:44
https://stackoverflow.com/q/20790014
https://stackoverflow.com/a/20871312
<p>It looks that I have figured out how to do it. For example we have branch <code>myown</code>. And we need to create new one empty (without history):</p> <pre class="lang-bash prettyprint-override"><code>git checkout --orphan common </code></pre> <p>Now we need to add files:</p> <pre class="lang-bash prettyprint-over...
<p>It looks that I have figured out how to do it. For example we have branch <code>myown</code>. And we need to create new one empty (without history):</p> <pre class="lang-bash prettyprint-override"><code>git checkout --orphan common </code></pre> <p>Now we need to add files:</p> <pre class="lang-bash prettyprint-over...
119, 1879
branch, git
<h1>Git: Copy source code to new branch without history</h1> <p>I have 2 branches in git repository: <code>common</code> and <code>myown</code>.</p> <p>I want to copy the source from one branch to another branch but I want to see in history of <code>common</code> branch only commits related to feature migration (from ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,979
git
# Git: Copy source code to new branch without history I have 2 branches in git repository: `common` and `myown`. I want to copy the source from one branch to another branch but I want to see in history of `common` branch only commits related to feature migration (from `myown` to `common`). Is it possible to copy the...
It looks that I have figured out how to do it. For example we have branch `myown`. And we need to create new one empty (without history): ``` git checkout --orphan common ``` Now we need to add files: ``` git add . ``` And commit all: ``` git commit -m "Initial" ``` You can see in log only this commit (not all ma...
9199222
Git Commit after merge opens VIM
23
2012-02-08 18:26:11
<p>I did a merge of 2 files and now Im trying to commit but it opens VIM with the following data and now I'm completely lost. (I have no experience with VIM)</p> <pre><code>Merge branch 'master' of nodester.com:/node/git/lolcoder/****-****** Conflicts: .gitignore server.js # # It looks like you may be...
19,605
400,861
2020-06-16 05:36:44
9,199,316
18
2012-02-08 18:33:04
351,084
2012-02-08 18:40:11
https://stackoverflow.com/q/9199222
https://stackoverflow.com/a/9199316
<p>Git is opening vim because your environment variable EDITOR is set to vim, and Git believes you need to provide a commit message for the merge operation, therefore it is opening an editor for you to type one in.</p> <p>You can fix this by changing your environment's EDITOR variable to something you prefer, or by pr...
<p>Git is opening vim because your environment variable EDITOR is set to vim, and Git believes you need to provide a commit message for the merge operation, therefore it is opening an editor for you to type one in.</p> <p>You can fix this by changing your environment's EDITOR variable to something you prefer, or by pr...
119, 370
git, vim
<h1>Git Commit after merge opens VIM</h1> <p>I did a merge of 2 files and now Im trying to commit but it opens VIM with the following data and now I'm completely lost. (I have no experience with VIM)</p> <pre><code>Merge branch 'master' of nodester.com:/node/git/lolcoder/****-****** Conflicts: .gitignore ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,981
git
# Git Commit after merge opens VIM I did a merge of 2 files and now Im trying to commit but it opens VIM with the following data and now I'm completely lost. (I have no experience with VIM) ``` Merge branch 'master' of nodester.com:/node/git/lolcoder/****-****** Conflicts: .gitignore server.js # # It...
Git is opening vim because your environment variable EDITOR is set to vim, and Git believes you need to provide a commit message for the merge operation, therefore it is opening an editor for you to type one in. You can fix this by changing your environment's EDITOR variable to something you prefer, or by providing a ...
57632610
Can't resolve merge conflict with git submodule folder
22
2019-08-23 20:23:20
<p>I have two git branches, develop and redesign that I need to merge. I have a submodule called library where its updates are being tracked by develop. When I run '<code>git merge</code>' it says library has been modified by both even though I haven't touched the library submodule. When I click on library in VS Code t...
26,651
2,026,659
2025-12-22 03:54:11
57,732,716
18
2019-08-30 20:09:41
2,026,659
2019-08-30 20:09:41
https://stackoverflow.com/q/57632610
https://stackoverflow.com/a/57732716
<p>I solved the issue. I found the answer from this reply to similar StackOverflow question: <a href="https://stackoverflow.com/a/29971977/2026659">https://stackoverflow.com/a/29971977/2026659</a>. When I ran <code>'git add'</code> to library and committed it, the issue went away. Another developer on my team changed t...
<p>I solved the issue. I found the answer from this reply to similar StackOverflow question: <a href="https://stackoverflow.com/a/29971977/2026659">https://stackoverflow.com/a/29971977/2026659</a>. When I ran <code>'git add'</code> to library and committed it, the issue went away. Another developer on my team changed t...
119, 28897, 41612, 106113
git, git-merge, git-merge-conflict, git-submodules
<h1>Can't resolve merge conflict with git submodule folder</h1> <p>I have two git branches, develop and redesign that I need to merge. I have a submodule called library where its updates are being tracked by develop. When I run '<code>git merge</code>' it says library has been modified by both even though I haven't tou...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,982
git
# Can't resolve merge conflict with git submodule folder I have two git branches, develop and redesign that I need to merge. I have a submodule called library where its updates are being tracked by develop. When I run '`git merge`' it says library has been modified by both even though I haven't touched the library sub...
I solved the issue. I found the answer from this reply to similar StackOverflow question: <https://stackoverflow.com/a/29971977/2026659>. When I ran `'git add'` to library and committed it, the issue went away. Another developer on my team changed the hash associated with the library submodule.
9289731
git stable branch: find not cherry-picked commits
22
2012-02-15 07:59:32
<p>I have the following git history:</p> <pre><code>A --- B --- C --- D' --- E' [master] \ \ --- D --- E --- F [stable] </code></pre> <p>We have a policy to cherry-pick all changes from stable to master; D' and E' are cherry-picked commits from stable branch, F is not cherry-picked (has been forgotten).</p> <p>Ho...
4,050
781,662
2021-10-01 10:29:59
9,290,969
18
2012-02-15 09:40:52
201,725
2021-10-01 10:29:59
https://stackoverflow.com/q/9289731
https://stackoverflow.com/a/9290969
<p>That's exactly what the <a href="https://git-scm.com/docs/git-cherry" rel="nofollow noreferrer"><code>git cherry</code></a> command is for.</p> <p>It should never miss unpicked change, but it might occasionally list a change you consider picked if the pick involved conflict resolution.</p>
<p>That's exactly what the <a href="https://git-scm.com/docs/git-cherry" rel="nofollow noreferrer"><code>git cherry</code></a> command is for.</p> <p>It should never miss unpicked change, but it might occasionally list a change you consider picked if the pick involved conflict resolution.</p>
119, 606, 9033, 36489
cherry-pick, diff, git, git-diff
<h1>git stable branch: find not cherry-picked commits</h1> <p>I have the following git history:</p> <pre><code>A --- B --- C --- D' --- E' [master] \ \ --- D --- E --- F [stable] </code></pre> <p>We have a policy to cherry-pick all changes from stable to master; D' and E' are cherry-picked commits from stable bran...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,986
git
# git stable branch: find not cherry-picked commits I have the following git history: ``` A --- B --- C --- D' --- E' [master] \ \ --- D --- E --- F [stable] ``` We have a policy to cherry-pick all changes from stable to master; D' and E' are cherry-picked commits from stable branch, F is not cherry-picked (has b...
That's exactly what the [`git cherry`](https://git-scm.com/docs/git-cherry) command is for. It should never miss unpicked change, but it might occasionally list a change you consider picked if the pick involved conflict resolution.
36438333
How do I use git worktrees in IntelliJ IDEA 2016.1?
21
2016-04-05 22:40:14
<p>The newest version of IntelliJ says it has support for git worktrees, but I can't seem to find anywhere that says how to use it. I was expecting to see an entry in the Git Branches popup in the lower right, but I don't see it there.</p> <p>I also don't see any descriptions in:<br> <a href="https://blog.jetbrains.co...
14,887
94,390
2017-05-29 23:06:54
36,559,767
18
2016-04-11 21:40:54
43,356
2016-04-11 21:40:54
https://stackoverflow.com/q/36438333
https://stackoverflow.com/a/36559767
<p>As far as I can tell, "support" means that when you open a worktree in IntelliJ, all the VCS functions work properly. Based on the comments in the Youtrack link provided by max630, you could not view diffs, view history, or commit changes before 2016.1.</p> <p>With 2016.1, however, you can open the worktree as a ne...
<p>As far as I can tell, "support" means that when you open a worktree in IntelliJ, all the VCS functions work properly. Based on the comments in the Youtrack link provided by max630, you could not view diffs, view history, or commit changes before 2016.1.</p> <p>With 2016.1, however, you can open the worktree as a ne...
119, 8945, 117020
git, git-worktree, intellij-idea
<h1>How do I use git worktrees in IntelliJ IDEA 2016.1?</h1> <p>The newest version of IntelliJ says it has support for git worktrees, but I can't seem to find anywhere that says how to use it. I was expecting to see an entry in the Git Branches popup in the lower right, but I don't see it there.</p> <p>I also don't se...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,987
git
# How do I use git worktrees in IntelliJ IDEA 2016.1? The newest version of IntelliJ says it has support for git worktrees, but I can't seem to find anywhere that says how to use it. I was expecting to see an entry in the Git Branches popup in the lower right, but I don't see it there. I also don't see any descriptio...
As far as I can tell, "support" means that when you open a worktree in IntelliJ, all the VCS functions work properly. Based on the comments in the Youtrack link provided by max630, you could not view diffs, view history, or commit changes before 2016.1. With 2016.1, however, you can open the worktree as a new project ...
10816578
Can Git show history for selected lines?
21
2012-05-30 12:44:18
<p>I have a large file where, somewhere in the middle, there is a function that I know has been modified several times. <code>git annotate</code> or <code>blame</code> will show the most recent commit for each line but if I'm right, it will show <em>only</em> the most recent one, not a list of other commits that affect...
12,101
21,728
2022-04-19 15:11:04
10,816,928
18
2012-05-30 13:06:53
21,728
2012-05-30 13:06:53
https://stackoverflow.com/q/10816578
https://stackoverflow.com/a/10816928
<p>As suggested in one of the comments in <a href="https://stackoverflow.com/q/4781405/11343">Git - how do I view the change history of a method/function?</a>, doing</p> <pre><code>git gui blame &lt;file&gt; </code></pre> <p>and then right-clicking a line and selecting <em>Blame Parent Commit</em> does what I need.</...
<p>As suggested in one of the comments in <a href="https://stackoverflow.com/q/4781405/11343">Git - how do I view the change history of a method/function?</a>, doing</p> <pre><code>git gui blame &lt;file&gt; </code></pre> <p>and then right-clicking a line and selecting <em>Blame Parent Commit</em> does what I need.</...
119
git
<h1>Can Git show history for selected lines?</h1> <p>I have a large file where, somewhere in the middle, there is a function that I know has been modified several times. <code>git annotate</code> or <code>blame</code> will show the most recent commit for each line but if I'm right, it will show <em>only</em> the most r...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,989
git
# Can Git show history for selected lines? I have a large file where, somewhere in the middle, there is a function that I know has been modified several times. `git annotate` or `blame` will show the most recent commit for each line but if I'm right, it will show *only* the most recent one, not a list of other commits...
As suggested in one of the comments in [Git - how do I view the change history of a method/function?](https://stackoverflow.com/q/4781405/11343), doing ``` git gui blame <file> ``` and then right-clicking a line and selecting *Blame Parent Commit* does what I need.
69681452
How can I suppress or resolve "info: detecting host provider for..." in Git?
20
2021-10-22 18:16:22
<p>I'm getting the following output when executing a fetch / pull via a powershell script:</p> <blockquote> <p>info: detecting host provider for '[devops site address]'...</p> </blockquote> <p>Normally, this wouldn't be an issue, however, Azure DevOps sees this output as an error and labels the release stage as such. I...
19,730
9,146,061
2021-11-25 13:09:38
69,992,938
18
2021-11-16 16:39:18
6,309
2021-11-25 13:09:38
https://stackoverflow.com/q/69681452
https://stackoverflow.com/a/69992938
<p>This comes indeed from the GCM used by Git.<br /> You can either downgrade to Git 2.32, or wait for the recently released <a href="https://github.com/microsoft/Git-Credential-Manager-Core/releases/tag/v2.0.603" rel="noreferrer">Git-Credential-Manager-Core v2.0.603</a>, which does remove those messages.</p> <p>Said r...
<p>This comes indeed from the GCM used by Git.<br /> You can either downgrade to Git 2.32, or wait for the recently released <a href="https://github.com/microsoft/Git-Credential-Manager-Core/releases/tag/v2.0.603" rel="noreferrer">Git-Credential-Manager-Core v2.0.603</a>, which does remove those messages.</p> <p>Said r...
119, 116537, 132586
azure-devops, git, git-credential-manager
<h1>How can I suppress or resolve "info: detecting host provider for..." in Git?</h1> <p>I'm getting the following output when executing a fetch / pull via a powershell script:</p> <blockquote> <p>info: detecting host provider for '[devops site address]'...</p> </blockquote> <p>Normally, this wouldn't be an issue, howe...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,991
git
# How can I suppress or resolve "info: detecting host provider for..." in Git? I'm getting the following output when executing a fetch / pull via a powershell script: > info: detecting host provider for '[devops site address]'... Normally, this wouldn't be an issue, however, Azure DevOps sees this output as an error...
This comes indeed from the GCM used by Git. You can either downgrade to Git 2.32, or wait for the recently released [Git-Credential-Manager-Core v2.0.603](https://github.com/microsoft/Git-Credential-Manager-Core/releases/tag/v2.0.603), which does remove those messages. Said release is not yet packaged with the [late...
28027190
Copy git repository to offline machine and pushing/pulling via memory-stick
20
2015-01-19 14:43:52
<p>I need to work on an offline machine, where I cannot access my repository. Now I also don't want miss out on using Git altogether.</p> <p>Questions:</p> <ul> <li>What is the best way to copy my repository onto an offline machine via memory-stick?</li> <li>Is there a way to copy patches via the filesystem?</li> </u...
20,961
3,867,787
2019-08-22 01:46:55
28,027,693
18
2015-01-19 15:09:13
34,088
2015-01-19 15:09:13
https://stackoverflow.com/q/28027190
https://stackoverflow.com/a/28027693
<p>To copy a complete Git repo, you just have to copy the folder <code>.git</code>; it contains everything. Git uses safe file names and ignores time stamps inside of the repo, so this data is safe from the usual file system quirks.</p> <p>On the target machine, create a folder, copy the <code>.git</code> folder insid...
<p>To copy a complete Git repo, you just have to copy the folder <code>.git</code>; it contains everything. Git uses safe file names and ignores time stamps inside of the repo, so this data is safe from the usual file system quirks.</p> <p>On the target machine, create a folder, copy the <code>.git</code> folder insid...
119, 6936
git, offline-mode
<h1>Copy git repository to offline machine and pushing/pulling via memory-stick</h1> <p>I need to work on an offline machine, where I cannot access my repository. Now I also don't want miss out on using Git altogether.</p> <p>Questions:</p> <ul> <li>What is the best way to copy my repository onto an offline machine v...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,994
git
# Copy git repository to offline machine and pushing/pulling via memory-stick I need to work on an offline machine, where I cannot access my repository. Now I also don't want miss out on using Git altogether. Questions: - What is the best way to copy my repository onto an offline machine via memory-stick? - Is there...
To copy a complete Git repo, you just have to copy the folder `.git`; it contains everything. Git uses safe file names and ignores time stamps inside of the repo, so this data is safe from the usual file system quirks. On the target machine, create a folder, copy the `.git` folder inside. Now `git checkout <branch>` w...
14842127
How to use git repack -a -d --depth=250 --window=250
20
2013-02-12 21:25:39
<p>I've seen <code>git gc --aggressive --prune</code> and <code>git repack -a -d --depth=250 --window=250</code> recommended for reducing the size of your local .git folders where a long local history is not needed. From my reading it seems <code>git-repack</code> is preferred, can anyone comment on this?</p> <p>What ...
8,274
246,265
2014-01-07 19:48:18
14,842,444
18
2013-02-12 21:46:38
1,253,222
2013-02-12 21:46:38
https://stackoverflow.com/q/14842127
https://stackoverflow.com/a/14842444
<p>"Object window" - when repacking <code>git</code> compares each object (every version of every file, every directory tree object, every commit message, every tag...) against a certain number of other similar-ish objects to find one that creates the smallest delta - roughly speaking, the smallest patch that can creat...
<p>"Object window" - when repacking <code>git</code> compares each object (every version of every file, every directory tree object, every commit message, every tag...) against a certain number of other similar-ish objects to find one that creates the smallest delta - roughly speaking, the smallest patch that can creat...
119
git
<h1>How to use git repack -a -d --depth=250 --window=250</h1> <p>I've seen <code>git gc --aggressive --prune</code> and <code>git repack -a -d --depth=250 --window=250</code> recommended for reducing the size of your local .git folders where a long local history is not needed. From my reading it seems <code>git-repack<...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,995
git
# How to use git repack -a -d --depth=250 --window=250 I've seen `git gc --aggressive --prune` and `git repack -a -d --depth=250 --window=250` recommended for reducing the size of your local .git folders where a long local history is not needed. From my reading it seems `git-repack` is preferred, can anyone comment on...
"Object window" - when repacking `git` compares each object (every version of every file, every directory tree object, every commit message, every tag...) against a certain number of other similar-ish objects to find one that creates the smallest delta - roughly speaking, the smallest patch that can create this object ...
13190679
Error while applying a patch in git
20
2012-11-02 06:54:52
<p>I have a shallow clone, on which i made three commits. Here is the log: <br></p> <blockquote> <p>$ git log --oneline --graph --decorate --all <br> * <b>d3456fd (HEAD, master) patch 3 </b><br> * <b>9713822 patch 2 </b><br> * <b>6f380a6 patch 1 </b><br> * 8a1ce1e (origin/master, origin/HEAD) from full clone...
53,254
1,288,207
2022-12-03 16:32:44
13,190,929
18
2012-11-02 07:15:38
6,309
2012-11-02 08:42:22
https://stackoverflow.com/q/13190679
https://stackoverflow.com/a/13190929
<p>Note that one rationale for having to ignore whitespace was (<a href="http://git.661346.n2.nabble.com/PATCH-git-am-Ignore-whitespace-before-patches-td5059594.html" rel="noreferrer">June 2010</a>):</p> <blockquote> <p>What it does is enable the <code>GMail -&gt; download -&gt; git-am workflow</code>.<br> GMail (...
<p>Note that one rationale for having to ignore whitespace was (<a href="http://git.661346.n2.nabble.com/PATCH-git-am-Ignore-whitespace-before-patches-td5059594.html" rel="noreferrer">June 2010</a>):</p> <blockquote> <p>What it does is enable the <code>GMail -&gt; download -&gt; git-am workflow</code>.<br> GMail (...
119
git
<h1>Error while applying a patch in git</h1> <p>I have a shallow clone, on which i made three commits. Here is the log: <br></p> <blockquote> <p>$ git log --oneline --graph --decorate --all <br> * <b>d3456fd (HEAD, master) patch 3 </b><br> * <b>9713822 patch 2 </b><br> * <b>6f380a6 patch 1 </b><br> * 8a1ce1e...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,997
git
# Error while applying a patch in git I have a shallow clone, on which i made three commits. Here is the log: > $ git log --oneline --graph --decorate --all > * **d3456fd (HEAD, master) patch 3** > * **9713822 patch 2** > * **6f380a6 patch 1** > * 8a1ce1e (origin/master, origin/HEAD) from full clone > ...
Note that one rationale for having to ignore whitespace was ([June 2010](http://git.661346.n2.nabble.com/PATCH-git-am-Ignore-whitespace-before-patches-td5059594.html)): > What it does is enable the `GMail -> download -> git-am workflow`. > GMail (and doubtless countless other) E-Mail providers introduce whitespace a...
11863785
Make git pull --rebase preserve merge commits
20
2012-08-08 11:44:08
<p><code>git pull --rebase</code> removes unpushed merge commits. Is there a way to make it preserve them?</p> <p>Say my history looks like—</p> <pre><code>A | \ B H | | C G | | D F | / E </code></pre> <p>(<code>A</code> being the merge commit.)</p> <p>After a <code>git pull --rebase</code> it becomes—</p> <...
9,119
1,569,050
2021-04-12 22:42:50
11,863,842
18
2012-08-08 11:48:07
3,785
2017-09-03 15:26:29
https://stackoverflow.com/q/11863785
https://stackoverflow.com/a/11863842
<p>you can split your <code>pull</code> in a <code>fetch</code> and a <code>rebase</code></p> <pre><code>git fetch origin master git rebase origin master --preserve-merges </code></pre>
<p>you can split your <code>pull</code> in a <code>fetch</code> and a <code>rebase</code></p> <pre><code>git fetch origin master git rebase origin master --preserve-merges </code></pre>
119, 456
git, version-control
<h1>Make git pull --rebase preserve merge commits</h1> <p><code>git pull --rebase</code> removes unpushed merge commits. Is there a way to make it preserve them?</p> <p>Say my history looks like—</p> <pre><code>A | \ B H | | C G | | D F | / E </code></pre> <p>(<code>A</code> being the merge commit.)</p> <p>Af...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,999
git
# Make git pull --rebase preserve merge commits `git pull --rebase` removes unpushed merge commits. Is there a way to make it preserve them? Say my history looks like— ``` A | \ B H | | C G | | D F | / E ``` (`A` being the merge commit.) After a `git pull --rebase` it becomes— ``` H | G | F | X | B | C | D ...
you can split your `pull` in a `fetch` and a `rebase` ``` git fetch origin master git rebase origin master --preserve-merges ```
11271263
Completely remove commit from git database
20
2012-06-30 03:53:28
<p>I need a commit to no longer be in the git database of commits. I need to be able to remove commit <code>abc123...</code> such that <code>git checkout abc123...</code> returns <code>error: pathspec 'abc123...' did not match any file(s) known to git.</code></p> <p>The QA <a href="https://stackoverflow.com/questions/1...
9,082
762,175
2022-01-07 09:54:32
11,272,129
18
2012-06-30 06:51:56
6,236
2012-06-30 07:19:11
https://stackoverflow.com/q/11271263
https://stackoverflow.com/a/11272129
<ol> <li><p>List all branches that contain the commit:</p> <pre><code>git branch --contains COMMITSHA </code></pre></li> <li><p>Remove commit from these branches:</p> <pre><code>git checkout BRANCH git rebase -i COMMITSHA^ # delete line with commit and save </code></pre> <p>If a changed branch is tracked in any remo...
<ol> <li><p>List all branches that contain the commit:</p> <pre><code>git branch --contains COMMITSHA </code></pre></li> <li><p>Remove commit from these branches:</p> <pre><code>git checkout BRANCH git rebase -i COMMITSHA^ # delete line with commit and save </code></pre> <p>If a changed branch is tracked in any remo...
119
git
<h1>Completely remove commit from git database</h1> <p>I need a commit to no longer be in the git database of commits. I need to be able to remove commit <code>abc123...</code> such that <code>git checkout abc123...</code> returns <code>error: pathspec 'abc123...' did not match any file(s) known to git.</code></p> <p>T...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
21,000
git
# Completely remove commit from git database I need a commit to no longer be in the git database of commits. I need to be able to remove commit `abc123...` such that `git checkout abc123...` returns `error: pathspec 'abc123...' did not match any file(s) known to git.` The QA [Delete commits from a branch in Git](http...
1. List all branches that contain the commit: ``` git branch --contains COMMITSHA ``` 2. Remove commit from these branches: ``` git checkout BRANCH git rebase -i COMMITSHA^ # delete line with commit and save ``` If a changed branch is tracked in any remote, push it there with override: ...
8686691
What does the ".git" mean in a git URL?
20
2011-12-31 06:16:54
<p>I setup a git repo in foo</p> <pre><code>cd mkdir foo cd foo git init </code></pre> <p>Now I want to reference that remotely</p> <pre><code>git clone git+ssh://me@somemachine/home/me/foo.git fatal: git remote error '/home/me/foo.git' does not appear to be a git repository </code></pre> <p>So I take .git off and...
6,715
null
2022-03-23 02:00:56
8,686,727
18
2011-12-31 06:25:01
1,122,135
2011-12-31 06:25:01
https://stackoverflow.com/q/8686691
https://stackoverflow.com/a/8686727
<h2>What does that ".git" mean?</h2> <p><code>.git</code> at the end of a git repository folder is just a naming convention that usually means that the folder is a server and not a client. I believe it's determined by the repository being bare or not (bare repositories have no working directory). The clone URL just po...
<h2>What does that ".git" mean?</h2> <p><code>.git</code> at the end of a git repository folder is just a naming convention that usually means that the folder is a server and not a client. I believe it's determined by the repository being bare or not (bare repositories have no working directory). The clone URL just po...
119
git
<h1>What does the ".git" mean in a git URL?</h1> <p>I setup a git repo in foo</p> <pre><code>cd mkdir foo cd foo git init </code></pre> <p>Now I want to reference that remotely</p> <pre><code>git clone git+ssh://me@somemachine/home/me/foo.git fatal: git remote error '/home/me/foo.git' does not appear to be a git re...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
21,001
git
# What does the ".git" mean in a git URL? I setup a git repo in foo ``` cd mkdir foo cd foo git init ``` Now I want to reference that remotely ``` git clone git+ssh://me@somemachine/home/me/foo.git fatal: git remote error '/home/me/foo.git' does not appear to be a git repository ``` So I take .git off and it work...
## What does that ".git" mean? `.git` at the end of a git repository folder is just a naming convention that usually means that the folder is a server and not a client. I believe it's determined by the repository being bare or not (bare repositories have no working directory). The clone URL just points to a folder, if...
4052788
Git says local branch is ahead of remote after having pulled from remote
20
2010-10-29 14:31:03
<p>I’m sorry if the title isn’t clear, but this is a weird problem.</p> <p>I <code>git checkout</code> to my "stage" branch and <code>git pull</code> to get my partner’s latest changes (which he pushed last night to the "stage" branch on the remote repository), and sure enough, they merge to my local "stage" branch. <...
21,723
411,967
2020-08-06 08:07:54
4,052,810
18
2010-10-29 14:33:46
88,442
2010-10-29 14:33:46
https://stackoverflow.com/q/4052788
https://stackoverflow.com/a/4052810
<p>Try this command:</p> <pre><code>git log origin/stage..stage </code></pre> <p>This show you what you are ahead of the remote. Do a <code>git rebase origin/stage</code> / <code>git push</code> as appropriate. </p> <p>If it doesn't help, see this question : <a href="https://stackoverflow.com/questions/1741143/git-g...
<p>Try this command:</p> <pre><code>git log origin/stage..stage </code></pre> <p>This show you what you are ahead of the remote. Do a <code>git rebase origin/stage</code> / <code>git push</code> as appropriate. </p> <p>If it doesn't help, see this question : <a href="https://stackoverflow.com/questions/1741143/git-g...
119, 5597, 28896
commit, git, git-pull
<h1>Git says local branch is ahead of remote after having pulled from remote</h1> <p>I’m sorry if the title isn’t clear, but this is a weird problem.</p> <p>I <code>git checkout</code> to my "stage" branch and <code>git pull</code> to get my partner’s latest changes (which he pushed last night to the "stage" branch on...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
21,002
git
# Git says local branch is ahead of remote after having pulled from remote I’m sorry if the title isn’t clear, but this is a weird problem. I `git checkout` to my "stage" branch and `git pull` to get my partner’s latest changes (which he pushed last night to the "stage" branch on the remote repository), and sure enou...
Try this command: ``` git log origin/stage..stage ``` This show you what you are ahead of the remote. Do a `git rebase origin/stage` / `git push` as appropriate. If it doesn't help, see this question : ['git pull origin mybranch' leaves local mybranch N commits ahead of origin. Why?](https://stackoverflow.com/questi...
3454774
Fix msysGit Portable $HOME location
20
2010-08-11 01:56:59
<p>I have successfully installed and configured msysGit Portable on my flash drive, and have used it to pull and push GitHub repos. However, I seem to always have to kludge the SSH support.</p> <p>Specifically, in order for SSH to find my key files, I have to follow <a href="http://chickenandbeans.vox.com/library/post/...
17,732
5,991
2018-04-10 20:30:27
3,455,231
18
2010-08-11 04:13:35
6,309
2014-03-27 13:45:53
https://stackoverflow.com/q/3454774
https://stackoverflow.com/a/3455231
<p>The command used to launch git bash is:</p> <pre><code>C:\Windows\SysWOW64\cmd.exe /c &quot;&quot;C:\Prog\Git\1.7.1\bin\sh.exe&quot; --login -i&quot; </code></pre> <p>I just tried the following in a DOS session:</p> <pre><code>C:\&gt;C:\Windows\SysWOW64\cmd.exe /c &quot;&quot;C:\Prog\Git\1.7.1\bin\sh.exe&quot; --log...
<p>The command used to launch git bash is:</p> <pre><code>C:\Windows\SysWOW64\cmd.exe /c &quot;&quot;C:\Prog\Git\1.7.1\bin\sh.exe&quot; --login -i&quot; </code></pre> <p>I just tried the following in a DOS session:</p> <pre><code>C:\&gt;C:\Windows\SysWOW64\cmd.exe /c &quot;&quot;C:\Prog\Git\1.7.1\bin\sh.exe&quot; --log...
119, 386, 21628, 32213, 48871
git, home-directory, msysgit, portable-applications, ssh
<h1>Fix msysGit Portable $HOME location</h1> <p>I have successfully installed and configured msysGit Portable on my flash drive, and have used it to pull and push GitHub repos. However, I seem to always have to kludge the SSH support.</p> <p>Specifically, in order for SSH to find my key files, I have to follow <a href=...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
21,003
git
# Fix msysGit Portable $HOME location I have successfully installed and configured msysGit Portable on my flash drive, and have used it to pull and push GitHub repos. However, I seem to always have to kludge the SSH support. Specifically, in order for SSH to find my key files, I have to follow [these instructions](ht...
The command used to launch git bash is: ``` C:\Windows\SysWOW64\cmd.exe /c ""C:\Prog\Git\1.7.1\bin\sh.exe" --login -i" ``` I just tried the following in a DOS session: ``` C:\>C:\Windows\SysWOW64\cmd.exe /c ""C:\Prog\Git\1.7.1\bin\sh.exe" --login -i" VonC@XXX /c/ $ echo $HOME /c/Users/VonC ``` By default, $HOME$%HO...
39504946
What does 'git merge' with no arguments do?
19
2016-09-15 07:07:53
<p>I've seen people doing</p> <pre><code>git merge </code></pre> <p>i.e. using "git merge" with no arguments. It looks like it might do something useful. But I couldn't find documentation for this scenario on git-scm.com.</p> <p>What does "git merge" do in this scenario?</p>
3,245
1,162,732
2021-11-13 01:28:14
39,505,019
18
2016-09-15 07:12:38
6,309
2021-11-13 01:28:14
https://stackoverflow.com/q/39504946
https://stackoverflow.com/a/39505019
<p>It would try and merge its upstream branch (<a href="https://git-scm.com/docs/git-merge" rel="nofollow noreferrer"><code>git merge</code></a>)</p> <blockquote> <p>If no commit is given from the command line, merge the remote-tracking branches that the current branch is configured to use as its upstream.</p> </blockq...
<p>It would try and merge its upstream branch (<a href="https://git-scm.com/docs/git-merge" rel="nofollow noreferrer"><code>git merge</code></a>)</p> <blockquote> <p>If no commit is given from the command line, merge the remote-tracking branches that the current branch is configured to use as its upstream.</p> </blockq...
119
git
<h1>What does 'git merge' with no arguments do?</h1> <p>I've seen people doing</p> <pre><code>git merge </code></pre> <p>i.e. using "git merge" with no arguments. It looks like it might do something useful. But I couldn't find documentation for this scenario on git-scm.com.</p> <p>What does "git merge" do in this sc...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
21,006
git
# What does 'git merge' with no arguments do? I've seen people doing ``` git merge ``` i.e. using "git merge" with no arguments. It looks like it might do something useful. But I couldn't find documentation for this scenario on git-scm.com. What does "git merge" do in this scenario?
It would try and merge its upstream branch ([`git merge`](https://git-scm.com/docs/git-merge)) > If no commit is given from the command line, merge the remote-tracking branches that the current branch is configured to use as its upstream. So check, to see if a branch has an upstream repo associated to it: ``` git co...
4947975
How to tell which remote svn branch is a local git branch tracking?
19
2011-02-09 16:56:20
<p>I'm a bit confused about how to commit on several svn branches from different local git branches. In particular, even though I've read many of the relates questions on this topic, there's one specific thing that nobody seems to have explained so far:</p> <p><em>if I already have a few local branches, how can I tell...
4,126
60,531
2017-05-30 09:48:24
4,948,666
18
2011-02-09 18:03:00
63,112
2011-02-09 18:03:00
https://stackoverflow.com/q/4947975
https://stackoverflow.com/a/4948666
<p><code>git svn info</code> gives you the full repository URL, so the SVN branch should appear there.</p>
<p><code>git svn info</code> gives you the full repository URL, so the SVN branch should appear there.</p>
119, 6452, 31678
git, git-svn, remote-branch
<h1>How to tell which remote svn branch is a local git branch tracking?</h1> <p>I'm a bit confused about how to commit on several svn branches from different local git branches. In particular, even though I've read many of the relates questions on this topic, there's one specific thing that nobody seems to have explain...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
21,007
git
# How to tell which remote svn branch is a local git branch tracking? I'm a bit confused about how to commit on several svn branches from different local git branches. In particular, even though I've read many of the relates questions on this topic, there's one specific thing that nobody seems to have explained so far...
`git svn info` gives you the full repository URL, so the SVN branch should appear there.
44595784
Git commit asks for OpenPGP secret key every time
18
2017-06-16 18:26:36
<p>I've been a linux user for a long time, and recently I started using a macbook. As part of my setup process i did the usual &quot;get git going&quot;, which included making an ssh key. All that went fine. I also had to instal gpg because git would not let me commit unless my commits were signed, fair enough. I gener...
15,600
5,593,651
2024-07-22 07:36:42
70,275,220
18
2021-12-08 12:45:16
831,465
2021-12-08 12:45:16
https://stackoverflow.com/q/44595784
https://stackoverflow.com/a/70275220
<p>I followed <a href="https://gpgtools.tenderapp.com/discussions/problems/106038-pinentry-mac-not-displaying-save-to-keychain-checkbox#comment_48370253" rel="noreferrer">this guide</a> and was able to get the UI dialog which asks for saving the password to the keychain. Using it with MacOS Monterey 12.0.1.</p> <p><a h...
<p>I followed <a href="https://gpgtools.tenderapp.com/discussions/problems/106038-pinentry-mac-not-displaying-save-to-keychain-checkbox#comment_48370253" rel="noreferrer">this guide</a> and was able to get the UI dialog which asks for saving the password to the keychain. Using it with MacOS Monterey 12.0.1.</p> <p><a h...
119, 369, 8337
bitbucket, git, macos
<h1>Git commit asks for OpenPGP secret key every time</h1> <p>I've been a linux user for a long time, and recently I started using a macbook. As part of my setup process i did the usual &quot;get git going&quot;, which included making an ssh key. All that went fine. I also had to instal gpg because git would not let me...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
21,009
git
# Git commit asks for OpenPGP secret key every time I've been a linux user for a long time, and recently I started using a macbook. As part of my setup process i did the usual "get git going", which included making an ssh key. All that went fine. I also had to instal gpg because git would not let me commit unless my c...
I followed [this guide](https://gpgtools.tenderapp.com/discussions/problems/106038-pinentry-mac-not-displaying-save-to-keychain-checkbox#comment_48370253) and was able to get the UI dialog which asks for saving the password to the keychain. Using it with MacOS Monterey 12.0.1. [![Pinentry Mac UI dialog](https://i.ssta...
23293417
What is the right .gitconfig syntax for http.sslCAInfo certificate for specific server?
18
2014-04-25 12:38:29
<p>I'm using a remote git repository via https, which has a self-signed certificate. To make git aware of the self-signed certificates, I have the following in my .gitconfig:</p> <pre><code>[http] sslCAInfo = /home/user/myselfsigned.cert </code></pre> <p>This works fine, but when I add another remote with a CA signed...
33,504
null
2017-05-05 22:30:22
26,463,993
18
2014-10-20 10:58:45
490,114
2014-10-20 10:58:45
https://stackoverflow.com/q/23293417
https://stackoverflow.com/a/26463993
<p>I think <a href="https://stackoverflow.com/questions/23807313/adding-self-signed-ssl-certificate-without-disabling-authority-signed-ones/23807432#23807432">that question</a> has answer to your question as well: </p> <pre><code>git config http."https://code.example.com/".sslCAInfo &lt;downloaded certificate&gt;.pem ...
<p>I think <a href="https://stackoverflow.com/questions/23807313/adding-self-signed-ssl-certificate-without-disabling-authority-signed-ones/23807432#23807432">that question</a> has answer to your question as well: </p> <pre><code>git config http."https://code.example.com/".sslCAInfo &lt;downloaded certificate&gt;.pem ...
119, 642, 5954, 12049, 32868
certificate, git, git-config, https, self-signed
<h1>What is the right .gitconfig syntax for http.sslCAInfo certificate for specific server?</h1> <p>I'm using a remote git repository via https, which has a self-signed certificate. To make git aware of the self-signed certificates, I have the following in my .gitconfig:</p> <pre><code>[http] sslCAInfo = /home/user/my...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
21,012
git
# What is the right .gitconfig syntax for http.sslCAInfo certificate for specific server? I'm using a remote git repository via https, which has a self-signed certificate. To make git aware of the self-signed certificates, I have the following in my .gitconfig: ``` [http] sslCAInfo = /home/user/myselfsigned.cert ``` ...
I think [that question](https://stackoverflow.com/questions/23807313/adding-self-signed-ssl-certificate-without-disabling-authority-signed-ones/23807432#23807432) has answer to your question as well: ``` git config http."https://code.example.com/".sslCAInfo <downloaded certificate>.pem ``` And gitconfig file will be ...
15589862
How to find all unmerged commits in master grouped by the branches they were created in?
18
2013-03-23 17:30:28
<p>I have to create some code review from unmerged branches.</p> <p>In finding solutions, let's not go to local-branch context problem as this will run on a server; there will be just the <strong>origin</strong> remote, I will always run a <strong>git fetch origin</strong> command before other commands, and when we ta...
6,756
755,194
2018-10-16 14:20:20
15,768,236
18
2013-04-02 15:36:02
755,194
2013-04-03 22:07:48
https://stackoverflow.com/q/15589862
https://stackoverflow.com/a/15768236
<p>The repository could be cloned with <code>--mirror</code> which creates a bare repository that can be used as a mirror of the original repository and can be updated with <code>git remote update --prune</code> after which all the tags should be deleted for this feature.</p> <p>I implement it this way:<br> 1. get a l...
<p>The repository could be cloned with <code>--mirror</code> which creates a bare repository that can be used as a mirror of the original repository and can be updated with <code>git remote update --prune</code> after which all the tags should be deleted for this feature.</p> <p>I implement it this way:<br> 1. get a l...
119, 1879, 5597, 53847
branch, branching-and-merging, commit, git
<h1>How to find all unmerged commits in master grouped by the branches they were created in?</h1> <p>I have to create some code review from unmerged branches.</p> <p>In finding solutions, let's not go to local-branch context problem as this will run on a server; there will be just the <strong>origin</strong> remote, I...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
21,013
git
# How to find all unmerged commits in master grouped by the branches they were created in? I have to create some code review from unmerged branches. In finding solutions, let's not go to local-branch context problem as this will run on a server; there will be just the **origin** remote, I will always run a **git fetc...
The repository could be cloned with `--mirror` which creates a bare repository that can be used as a mirror of the original repository and can be updated with `git remote update --prune` after which all the tags should be deleted for this feature. I implement it this way: 1. get a list of branches not merged into ma...
9851644
Git pulling depends on the current dir
18
2012-03-24 12:12:28
<p>I am trying to <code>git pull</code> some repository via root user from any directory. </p> <p>For example, executing <code>git pull</code> from <code>/root/</code>:</p> <pre><code>#&gt; cd ~ #&gt; sudo -u dmalikov git --git-dir=/home/dmalikov/path/to/repo/.git pull /usr/libexec/git-core/git-sh-setup: line 142: c...
11,323
570,689
2012-03-30 17:43:59
9,876,901
18
2012-03-26 17:35:57
1,042,393
2012-03-26 17:41:24
https://stackoverflow.com/q/9851644
https://stackoverflow.com/a/9876901
<p>In your first example, the git command runs as user <code>dmalikov</code> with the current directory <code>/root</code>. Since the <code>git pull</code> command is equivalent to a <code>git fetch</code> followed by a <code>git merge</code>, and since <code>git merge</code> operates on the working tree, git tries to ...
<p>In your first example, the git command runs as user <code>dmalikov</code> with the current directory <code>/root</code>. Since the <code>git pull</code> command is equivalent to a <code>git fetch</code> followed by a <code>git merge</code>, and since <code>git merge</code> operates on the working tree, git tries to ...
119, 28896
git, git-pull
<h1>Git pulling depends on the current dir</h1> <p>I am trying to <code>git pull</code> some repository via root user from any directory. </p> <p>For example, executing <code>git pull</code> from <code>/root/</code>:</p> <pre><code>#&gt; cd ~ #&gt; sudo -u dmalikov git --git-dir=/home/dmalikov/path/to/repo/.git pull ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
21,014
git
# Git pulling depends on the current dir I am trying to `git pull` some repository via root user from any directory. For example, executing `git pull` from `/root/`: ``` #> cd ~ #> sudo -u dmalikov git --git-dir=/home/dmalikov/path/to/repo/.git pull /usr/libexec/git-core/git-sh-setup: line 142: cd: /root/.: Permiss...
In your first example, the git command runs as user `dmalikov` with the current directory `/root`. Since the `git pull` command is equivalent to a `git fetch` followed by a `git merge`, and since `git merge` operates on the working tree, git tries to hunt for the working tree. As this user does not have permission to `...
5367734
Error rebaseing/updating a git-svn repository
18
2011-03-20 09:44:11
<p>Hoping this is not a dup, I didn't find any concise information on how to update a git-svn repo. I used git svn clone to import an SVN repo into git. Then, after doing some commits, I wanted to rebase with regards to the original SVN repo.</p> <pre><code>C:\Work\osqa&gt;git svn rebase Migrating from a git-svn v1 la...
13,195
11,236
2019-03-12 22:50:57
5,367,740
18
2011-03-20 09:46:10
15,064
2011-03-20 09:46:10
https://stackoverflow.com/q/5367734
https://stackoverflow.com/a/5367740
<p>If I recall correctly, that means that there are uncommitted changes to that file. What's the output of <code>git status</code>?</p>
<p>If I recall correctly, that means that there are uncommitted changes to that file. What's the output of <code>git status</code>?</p>
63, 119, 6452
git, git-svn, svn
<h1>Error rebaseing/updating a git-svn repository</h1> <p>Hoping this is not a dup, I didn't find any concise information on how to update a git-svn repo. I used git svn clone to import an SVN repo into git. Then, after doing some commits, I wanted to rebase with regards to the original SVN repo.</p> <pre><code>C:\Wor...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
21,016
git
# Error rebaseing/updating a git-svn repository Hoping this is not a dup, I didn't find any concise information on how to update a git-svn repo. I used git svn clone to import an SVN repo into git. Then, after doing some commits, I wanted to rebase with regards to the original SVN repo. ``` C:\Work\osqa>git svn rebas...
If I recall correctly, that means that there are uncommitted changes to that file. What's the output of `git status`?
32559168
Git create a empty branch from existing repository
17
2015-09-14 07:20:11
<p>I have a git repository which has many branches my requirement is to create a new empty branch so that its independent of the earlier branches.</p>
25,502
1,265,943
2023-03-03 15:27:37
32,560,114
18
2015-09-14 08:16:38
3,128,122
2015-09-14 08:16:38
https://stackoverflow.com/q/32559168
https://stackoverflow.com/a/32560114
<p>That's not a good practice, but if you want really start with a new branch without relation to master you must use <strong>--orphan</strong> argument of checkout : </p> <pre><code>git checkout --orphan version2 # and remove your project files </code></pre> <p>You'll get more detail about <strong>--orphan</strong> ...
<p>That's not a good practice, but if you want really start with a new branch without relation to master you must use <strong>--orphan</strong> argument of checkout : </p> <pre><code>git checkout --orphan version2 # and remove your project files </code></pre> <p>You'll get more detail about <strong>--orphan</strong> ...
119, 1879
branch, git
<h1>Git create a empty branch from existing repository</h1> <p>I have a git repository which has many branches my requirement is to create a new empty branch so that its independent of the earlier branches.</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
21,019
git
# Git create a empty branch from existing repository I have a git repository which has many branches my requirement is to create a new empty branch so that its independent of the earlier branches.
That's not a good practice, but if you want really start with a new branch without relation to master you must use **--orphan** argument of checkout : ``` git checkout --orphan version2 # and remove your project files ``` You'll get more detail about **--orphan** arguments in the doc : <http://git-scm.com/docs/git-ch...
19839996
Setting-up local git repository
17
2013-11-07 15:36:45
<p>I am a fan of using <a href="https://github.com/" rel="noreferrer">GitHub</a> as my project file repository. But it interest me more if I am able to create a repository on this computer on a different directory path. Then clone that create repository on my new working directory.</p> <p>I was planning to make a <a h...
38,272
999,452
2014-08-05 23:54:00
20,040,179
18
2013-11-18 04:37:20
1,759,745
2013-11-19 01:12:49
https://stackoverflow.com/q/19839996
https://stackoverflow.com/a/20040179
<p>Maybe you're asking simple way to create git repo and local clone ?</p> <ol> <li>Create git repo using <code>git init --bare</code></li> <li>Clone from other place using <code>git clone --local /path/your/local/repo/</code></li> </ol> <p>For local network, windows share or other file share may work.</p> <p>But, t...
<p>Maybe you're asking simple way to create git repo and local clone ?</p> <ol> <li>Create git repo using <code>git init --bare</code></li> <li>Clone from other place using <code>git clone --local /path/your/local/repo/</code></li> </ol> <p>For local network, windows share or other file share may work.</p> <p>But, t...
119, 386, 34099, 41346
git, git-clone, git-remote, ssh
<h1>Setting-up local git repository</h1> <p>I am a fan of using <a href="https://github.com/" rel="noreferrer">GitHub</a> as my project file repository. But it interest me more if I am able to create a repository on this computer on a different directory path. Then clone that create repository on my new working directo...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
21,021
git
# Setting-up local git repository I am a fan of using [GitHub](https://github.com/) as my project file repository. But it interest me more if I am able to create a repository on this computer on a different directory path. Then clone that create repository on my new working directory. I was planning to make a [GitHub...
Maybe you're asking simple way to create git repo and local clone ? 1. Create git repo using `git init --bare` 2. Clone from other place using `git clone --local /path/your/local/repo/` For local network, windows share or other file share may work. But, the simple way just work, not best or suitable way. there aren'...
17324715
"git pull --rebase" in Eclipse
17
2013-06-26 15:47:45
<p>Our version control manager recommends us to use <code>git pull --rebase</code> to pull new changes from upstream branch. I want to use EGit (Eclipse plugin for git) to execute that. How can I do this?</p>
15,934
403,616
2016-06-15 15:21:03
17,324,792
18
2013-06-26 15:51:08
1,149,944
2013-06-26 15:51:08
https://stackoverflow.com/q/17324715
https://stackoverflow.com/a/17324792
<p>Use </p> <pre><code>git config branch.*branch-name*.rebase true </code></pre> <p>And <code>pull</code> will automatically rebase.</p> <p>You can set it up to configure new branches automatically.</p> <pre><code>git config branch.autosetuprebase always </code></pre>
<p>Use </p> <pre><code>git config branch.*branch-name*.rebase true </code></pre> <p>And <code>pull</code> will automatically rebase.</p> <p>You can set it up to configure new branches automatically.</p> <pre><code>git config branch.autosetuprebase always </code></pre>
53, 119, 43702
eclipse, egit, git
<h1>"git pull --rebase" in Eclipse</h1> <p>Our version control manager recommends us to use <code>git pull --rebase</code> to pull new changes from upstream branch. I want to use EGit (Eclipse plugin for git) to execute that. How can I do this?</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
21,022
git
# "git pull --rebase" in Eclipse Our version control manager recommends us to use `git pull --rebase` to pull new changes from upstream branch. I want to use EGit (Eclipse plugin for git) to execute that. How can I do this?
Use ``` git config branch.*branch-name*.rebase true ``` And `pull` will automatically rebase. You can set it up to configure new branches automatically. ``` git config branch.autosetuprebase always ```
12182245
Alternatives to cherry-picking
17
2012-08-29 16:15:40
<p>We have a <i>master</i> and a <em>production</em> branch. The master branch contains current developments while the production branch contains the stuff that is running on the server. From time to time, there is an important bugfix that has to be applied to both branches.</p> <p>Currently we are just cherry-picking...
8,046
773,690
2023-01-25 10:37:54
12,182,322
18
2012-08-29 16:20:01
112,968
2023-01-25 10:37:54
https://stackoverflow.com/q/12182245
https://stackoverflow.com/a/12182322
<p>You can create a new branch (let's call it <code>bugfix-a</code>) at the merge base of <code>master</code> and <code>production</code></p> <pre><code>git checkout -b bugfix-a &quot;$(git merge-base master production)&quot; </code></pre> <p>Apply your bugfix in that branch</p> <pre><code>&gt;&gt;/path/to/file echo 't...
<p>You can create a new branch (let's call it <code>bugfix-a</code>) at the merge base of <code>master</code> and <code>production</code></p> <pre><code>git checkout -b bugfix-a &quot;$(git merge-base master production)&quot; </code></pre> <p>Apply your bugfix in that branch</p> <pre><code>&gt;&gt;/path/to/file echo 't...
119
git
<h1>Alternatives to cherry-picking</h1> <p>We have a <i>master</i> and a <em>production</em> branch. The master branch contains current developments while the production branch contains the stuff that is running on the server. From time to time, there is an important bugfix that has to be applied to both branches.</p> ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
21,024
git
# Alternatives to cherry-picking We have a *master* and a *production* branch. The master branch contains current developments while the production branch contains the stuff that is running on the server. From time to time, there is an important bugfix that has to be applied to both branches. Currently we are just ch...
You can create a new branch (let's call it `bugfix-a`) at the merge base of `master` and `production` ``` git checkout -b bugfix-a "$(git merge-base master production)" ``` Apply your bugfix in that branch ``` >>/path/to/file echo 'this fixes the bug' git add /path/to/file git commit -m 'important bugfix' ``` Then,...
8187767
git: Is there a command line option for "Sort by date" for gitk?
17
2011-11-18 19:08:04
<p>I'm trying to find a command line option for gitk that has the same effect of "Strictly sort by date" in the "View / Edit view..." window.</p> <p><code>man gitk</code> shows a very limited number of options compared to those available in the GUI. </p>
5,528
804,037
2026-01-19 07:25:16
8,188,846
18
2011-11-18 20:43:27
6,309
2026-01-19 07:25:16
https://stackoverflow.com/q/8187767
https://stackoverflow.com/a/8188846
<p>The <a href="http://git-scm.com/docs/gitk" rel="nofollow noreferrer"><code>man gitk</code></a> at least mentions it does take the same options than <strong><a href="http://git-scm.com/docs/git-rev-list" rel="nofollow noreferrer"><code>git rev-list</code></a></strong>, including</p> <pre><code>--date-order </code></...
<p>The <a href="http://git-scm.com/docs/gitk" rel="nofollow noreferrer"><code>man gitk</code></a> at least mentions it does take the same options than <strong><a href="http://git-scm.com/docs/git-rev-list" rel="nofollow noreferrer"><code>git rev-list</code></a></strong>, including</p> <pre><code>--date-order </code></...
58, 119, 1231, 30785
command-line, git, gitk, linux
<h1>git: Is there a command line option for "Sort by date" for gitk?</h1> <p>I'm trying to find a command line option for gitk that has the same effect of "Strictly sort by date" in the "View / Edit view..." window.</p> <p><code>man gitk</code> shows a very limited number of options compared to those available in the ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
21,025
git
# git: Is there a command line option for "Sort by date" for gitk? I'm trying to find a command line option for gitk that has the same effect of "Strictly sort by date" in the "View / Edit view..." window. `man gitk` shows a very limited number of options compared to those available in the GUI.
The [`man gitk`](http://git-scm.com/docs/gitk) at least mentions it does take the same options than **[`git rev-list`](http://git-scm.com/docs/git-rev-list)**, including ``` --date-order ``` > This option is similar to `--topo-order` in the sense that no parent comes before all of its children, but otherwise things a...
1584675
Converting svn to git, how to get the branches not to be just remote in the svn repo?
17
2009-10-18 11:43:10
<p>I'm quite new to git and I'm trying to move a svn repository to git. I followed the guide below so now I have a git repo on my server<br> <a href="http://pauldowman.com/2008/07/26/how-to-convert-from-subversion-to-git/" rel="noreferrer">http://pauldowman.com/2008/07/26/how-to-convert-from-subversion-to-git/</a></p> ...
14,218
5,264
2017-06-12 18:54:19
1,585,877
18
2009-10-18 19:57:18
119,313
2017-06-12 18:54:19
https://stackoverflow.com/q/1584675
https://stackoverflow.com/a/1585877
<p>There is a fairly detailed explanation on how to do a pretty good SVN import that explains how to convert the branches properly here:</p> <p><a href="https://git-scm.com/book/en/v1/Git-and-Other-Systems-Migrating-to-Git" rel="noreferrer">https://git-scm.com/book/en/v1/Git-and-Other-Systems-Migrating-to-Git</a></p> ...
<p>There is a fairly detailed explanation on how to do a pretty good SVN import that explains how to convert the branches properly here:</p> <p><a href="https://git-scm.com/book/en/v1/Git-and-Other-Systems-Migrating-to-Git" rel="noreferrer">https://git-scm.com/book/en/v1/Git-and-Other-Systems-Migrating-to-Git</a></p> ...
63, 119, 6452
git, git-svn, svn
<h1>Converting svn to git, how to get the branches not to be just remote in the svn repo?</h1> <p>I'm quite new to git and I'm trying to move a svn repository to git. I followed the guide below so now I have a git repo on my server<br> <a href="http://pauldowman.com/2008/07/26/how-to-convert-from-subversion-to-git/" re...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
21,026
git
# Converting svn to git, how to get the branches not to be just remote in the svn repo? I'm quite new to git and I'm trying to move a svn repository to git. I followed the guide below so now I have a git repo on my server <http://pauldowman.com/2008/07/26/how-to-convert-from-subversion-to-git/> So, if I do "git bra...
There is a fairly detailed explanation on how to do a pretty good SVN import that explains how to convert the branches properly here: <https://git-scm.com/book/en/v1/Git-and-Other-Systems-Migrating-to-Git> The short answer is to run this: ``` $ cp -Rf .git/refs/remotes/* .git/refs/heads/ $ rm -Rf .git/refs/remotes `...
1170660
Committing specific parts of a file in Git
17
2009-07-23 09:35:49
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="https://stackoverflow.com/questions/1085162/how-can-i-commit-only-part-of-a-file-in-git">How can I commit only part of a file in git</a> </p> </blockquote> <p>I have made several changes to a file and have also added it to the git index. While co...
6,998
34,956
2011-06-17 12:38:33
1,170,680
18
2009-07-23 09:42:08
12,037
2009-07-23 09:42:08
https://stackoverflow.com/q/1170660
https://stackoverflow.com/a/1170680
<p>Use:</p> <pre><code>git add -i </code></pre> <p>to add files interactively. This will allow you to stage only the parts of the files you wish to commit. <a href="http://psung.blogspot.com/2007/12/version-control-with-git-git-add.html" rel="noreferrer">More info here</a>, and <a href="http://www.gitready.com/interm...
<p>Use:</p> <pre><code>git add -i </code></pre> <p>to add files interactively. This will allow you to stage only the parts of the files you wish to commit. <a href="http://psung.blogspot.com/2007/12/version-control-with-git-git-add.html" rel="noreferrer">More info here</a>, and <a href="http://www.gitready.com/interm...
119
git
<h1>Committing specific parts of a file in Git</h1> <blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="https://stackoverflow.com/questions/1085162/how-can-i-commit-only-part-of-a-file-in-git">How can I commit only part of a file in git</a> </p> </blockquote> <p>I have made several changes to a fi...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
21,027
git
# Committing specific parts of a file in Git > **Possible Duplicate:** > [How can I commit only part of a file in git](https://stackoverflow.com/questions/1085162/how-can-i-commit-only-part-of-a-file-in-git) I have made several changes to a file and have also added it to the git index. While committing the file I r...
Use: ``` git add -i ``` to add files interactively. This will allow you to stage only the parts of the files you wish to commit. [More info here](http://psung.blogspot.com/2007/12/version-control-with-git-git-add.html), and [a decent tutorial here](http://www.gitready.com/intermediate/2009/01/14/interactive-adding.ht...
55141013
How to get the behaviour of `git checkout ...` in Rust git2
16
2019-03-13 11:38:11
<p>I am using the Rust <a href="https://crates.io/crates/git2" rel="noreferrer">git2</a> crate to clone Git repositories like this</p> <pre><code>use git2::Repository; fn main() { let repo = Repository::clone( "https://github.com/rossmacarthur/dotfiles", "dotfiles" ).expect("failed to clone r...
4,465
4,591,251
2022-01-12 13:50:17
67,240,436
18
2021-04-24 07:41:08
7,115,678
2021-05-21 13:08:36
https://stackoverflow.com/q/55141013
https://stackoverflow.com/a/67240436
<p>With a more recent version of <code>git2</code> (<code>v0.13.18</code>):</p> <pre class="lang-rust prettyprint-override"><code>use git2::Repository; fn main() { let repo = Repository::clone(&quot;https://github.com/rossmacarthur/dotfiles&quot;, &quot;/tmp/dots&quot;) .expect(&quot;Failed to clone repo&q...
<p>With a more recent version of <code>git2</code> (<code>v0.13.18</code>):</p> <pre class="lang-rust prettyprint-override"><code>use git2::Repository; fn main() { let repo = Repository::clone(&quot;https://github.com/rossmacarthur/dotfiles&quot;, &quot;/tmp/dots&quot;) .expect(&quot;Failed to clone repo&q...
119, 5281, 59148, 66800
checkout, git, libgit2, rust
<h1>How to get the behaviour of `git checkout ...` in Rust git2</h1> <p>I am using the Rust <a href="https://crates.io/crates/git2" rel="noreferrer">git2</a> crate to clone Git repositories like this</p> <pre><code>use git2::Repository; fn main() { let repo = Repository::clone( "https://github.com/rossmac...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
21,028
git
# How to get the behaviour of `git checkout ...` in Rust git2 I am using the Rust [git2](https://crates.io/crates/git2) crate to clone Git repositories like this ``` use git2::Repository; fn main() { let repo = Repository::clone( "https://github.com/rossmacarthur/dotfiles", "dotfiles" ).expe...
With a more recent version of `git2` (`v0.13.18`): ``` use git2::Repository; fn main() { let repo = Repository::clone("https://github.com/rossmacarthur/dotfiles", "/tmp/dots") .expect("Failed to clone repo"); let refname = "master"; // or a tag (v0.1.1) or a commit (8e8128) let (object, reference...
51775149
How to make empty merge commit (ignoring changes)?
16
2018-08-09 20:17:11
<p>Automated CI tool merges fixes from <code>release</code> to <code>master</code>. But some commits from release branch should be ignored.</p> <p>Let's consider the following example:</p> <p>Release branch contains two fixes: <code>fix-1</code> should be ignored and <code>fix-2</code> should be merged to <code>maste...
13,092
5,289,288
2018-08-09 20:27:10
51,775,278
18
2018-08-09 20:26:43
17,875
2018-08-09 20:26:43
https://stackoverflow.com/q/51775149
https://stackoverflow.com/a/51775278
<p>You can pass <code>-s ours</code> to <code>git merge</code> to use the "ours" merge strategy, which does exactly what you want: performs a "merge" by completely ignoring the incoming branch.</p> <p>That said, this is a <em>surprising</em> thing to do to your history, to say the least. I assume you have a compellin...
<p>You can pass <code>-s ours</code> to <code>git merge</code> to use the "ours" merge strategy, which does exactly what you want: performs a "merge" by completely ignoring the incoming branch.</p> <p>That said, this is a <em>surprising</em> thing to do to your history, to say the least. I assume you have a compellin...
119
git
<h1>How to make empty merge commit (ignoring changes)?</h1> <p>Automated CI tool merges fixes from <code>release</code> to <code>master</code>. But some commits from release branch should be ignored.</p> <p>Let's consider the following example:</p> <p>Release branch contains two fixes: <code>fix-1</code> should be ig...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
21,031
git
# How to make empty merge commit (ignoring changes)? Automated CI tool merges fixes from `release` to `master`. But some commits from release branch should be ignored. Let's consider the following example: Release branch contains two fixes: `fix-1` should be ignored and `fix-2` should be merged to `master`. ``` bas...
You can pass `-s ours` to `git merge` to use the "ours" merge strategy, which does exactly what you want: performs a "merge" by completely ignoring the incoming branch. That said, this is a *surprising* thing to do to your history, to say the least. I assume you have a compelling reason not to want a hotfix in `master...
49630601
Signing commits with Git doesn't ask for my passphrase
16
2018-04-03 12:53:01
<p>I was trying to sign my commits with the command <code>git commit -S</code> but it fails without prompting my passphrase for my GPG key.</p> <p>The error is:</p> <pre><code>error: gpg failed to sign the data fatal: failed to write commit object </code></pre> <p>I noticed that if I run the following command before...
7,502
3,895,131
2023-01-26 15:26:26
49,633,685
18
2018-04-03 15:21:29
9,318,057
2018-04-03 20:07:28
https://stackoverflow.com/q/49630601
https://stackoverflow.com/a/49633685
<p>You likely need to tell <code>pinentry</code>, the software gpg uses to prompt for your password, where to prompt you.</p> <pre><code>export GPG_TTY=$(tty) git commit -S </code></pre> <p>If this works I would recommend exporting <code>GPG_TTY</code> in your shell's 'rc' file.</p> <p><a href="https://www.gnupg.org...
<p>You likely need to tell <code>pinentry</code>, the software gpg uses to prompt for your password, where to prompt you.</p> <pre><code>export GPG_TTY=$(tty) git commit -S </code></pre> <p>If this works I would recommend exporting <code>GPG_TTY</code> in your shell's 'rc' file.</p> <p><a href="https://www.gnupg.org...
119, 5254, 6735, 124001
git, gnupg, gpg-agent, sign
<h1>Signing commits with Git doesn't ask for my passphrase</h1> <p>I was trying to sign my commits with the command <code>git commit -S</code> but it fails without prompting my passphrase for my GPG key.</p> <p>The error is:</p> <pre><code>error: gpg failed to sign the data fatal: failed to write commit object </code...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
21,032
git
# Signing commits with Git doesn't ask for my passphrase I was trying to sign my commits with the command `git commit -S` but it fails without prompting my passphrase for my GPG key. The error is: ``` error: gpg failed to sign the data fatal: failed to write commit object ``` I noticed that if I run the following c...
You likely need to tell `pinentry`, the software gpg uses to prompt for your password, where to prompt you. ``` export GPG_TTY=$(tty) git commit -S ``` If this works I would recommend exporting `GPG_TTY` in your shell's 'rc' file. [gpg-agent documentation regarding `GPG_TTY`](https://www.gnupg.org/documentation/manu...
33891010
Can I modify git-add's **default** hunk size?
16
2015-11-24 10:20:41
<p>Using <code>git add -p</code>, one can select changes to a file for staging.</p> <p>One can manually change the hunk size (<a href="https://stackoverflow.com/questions/1122210/can-i-modify-git-adds-hunk-size">Can I modify git-add&#39;s hunk size?</a>), but I would like to know how to change the <strong>default</str...
1,255
null
2018-11-02 12:25:51
33,891,676
18
2015-11-24 10:53:33
26,396
2018-11-02 12:25:51
https://stackoverflow.com/q/33891010
https://stackoverflow.com/a/33891676
<p>You can use the <code>GIT_DIFF_OPTS</code> environment variable to tell Git how many lines of context it should include in a <a href="https://en.wikipedia.org/wiki/Diff_utility#Unified_format" rel="noreferrer">hunk</a> every time it has to <a href="https://git-scm.com/docs/git-diff#_generating_patches_with_p" rel="n...
<p>You can use the <code>GIT_DIFF_OPTS</code> environment variable to tell Git how many lines of context it should include in a <a href="https://en.wikipedia.org/wiki/Diff_utility#Unified_format" rel="noreferrer">hunk</a> every time it has to <a href="https://git-scm.com/docs/git-diff#_generating_patches_with_p" rel="n...
119, 2132, 14215
addition, git, patch
<h1>Can I modify git-add's **default** hunk size?</h1> <p>Using <code>git add -p</code>, one can select changes to a file for staging.</p> <p>One can manually change the hunk size (<a href="https://stackoverflow.com/questions/1122210/can-i-modify-git-adds-hunk-size">Can I modify git-add&#39;s hunk size?</a>), but I wo...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
21,034
git
# Can I modify git-add's **default** hunk size? Using `git add -p`, one can select changes to a file for staging. One can manually change the hunk size ([Can I modify git-add's hunk size?](https://stackoverflow.com/questions/1122210/can-i-modify-git-adds-hunk-size)), but I would like to know how to change the **defau...
You can use the `GIT_DIFF_OPTS` environment variable to tell Git how many lines of context it should include in a [hunk](https://en.wikipedia.org/wiki/Diff_utility#Unified_format) every time it has to [generate a patch](https://git-scm.com/docs/git-diff#_generating_patches_with_p). In your case, you would say: ``` ex...
5055190
How to setup post-receive-email Git hook with Gitolite
16
2011-02-20 04:09:45
<p>I'm using <code>post-receive-email</code> hook from the Git distribution to send e-mails to certain users when Git repository is updated (hook invoked from <code>post-receive</code>).</p> <p>All my repositories were managed manually. Now, I get so many repos and so many users and groups that I have to upgrade to so...
22,038
6,236
2018-02-13 00:28:18
5,063,447
18
2011-02-21 07:43:57
6,309
2015-02-14 18:42:36
https://stackoverflow.com/q/5055190
https://stackoverflow.com/a/5063447
<p>You can look at the <a href="http://sitaramc.github.com/gitolite/cust.html#hooks" rel="nofollow noreferrer">doc hook</a> for starters:</p> <blockquote> <h3>where do I (the admin) put the hooks?</h3> <p>In general, all hooks go into the <code>hooks/common</code> directory. Only the special post-update hook me...
<p>You can look at the <a href="http://sitaramc.github.com/gitolite/cust.html#hooks" rel="nofollow noreferrer">doc hook</a> for starters:</p> <blockquote> <h3>where do I (the admin) put the hooks?</h3> <p>In general, all hooks go into the <code>hooks/common</code> directory. Only the special post-update hook me...
119, 39151, 66228
git, gitolite, post-receive-email
<h1>How to setup post-receive-email Git hook with Gitolite</h1> <p>I'm using <code>post-receive-email</code> hook from the Git distribution to send e-mails to certain users when Git repository is updated (hook invoked from <code>post-receive</code>).</p> <p>All my repositories were managed manually. Now, I get so many...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
21,035
git
# How to setup post-receive-email Git hook with Gitolite I'm using `post-receive-email` hook from the Git distribution to send e-mails to certain users when Git repository is updated (hook invoked from `post-receive`). All my repositories were managed manually. Now, I get so many repos and so many users and groups th...
You can look at the [doc hook](http://sitaramc.github.com/gitolite/cust.html#hooks) for starters: > ### where do I (the admin) put the hooks? > > In general, all hooks go into the `hooks/common` directory. Only the special post-update hook meant for the `admin` repo goes into `hooks/gitolite-admin`. But the [Gitolite...
2935899
Is there any git repository with official daily updated Gentoo portage?
16
2010-05-29 17:02:46
<p>RSync is traditionally used to update Gentoo portage tree.</p> <p>But it's somewhat slow when dealing with a large number of files.</p> <p>So, I want to try to replace RSync with Git.</p> <p>I know that Funtoo have Git-based portage tree, but is there a Gentoo-specific official one?</p>
6,511
286,595
2015-09-28 15:28:18
2,985,563
18
2010-06-06 19:19:48
54,175
2010-06-06 19:19:48
https://stackoverflow.com/q/2935899
https://stackoverflow.com/a/2985563
<p>As a Gentoo developer I can say that there is no official git repository for the portage tree. There are plans to switch from what is currently used, CVS, to git, but that may still take a while.</p> <p>Currently, there are three ways to get the tree:</p> <ol> <li><p>Via rsync, as you mentioned.</p></li> <li><p>Vi...
<p>As a Gentoo developer I can say that there is no official git repository for the portage tree. There are plans to switch from what is currently used, CVS, to git, but that may still take a while.</p> <p>Currently, there are three ways to get the tree:</p> <ol> <li><p>Via rsync, as you mentioned.</p></li> <li><p>Vi...
58, 119, 6914
gentoo, git, linux
<h1>Is there any git repository with official daily updated Gentoo portage?</h1> <p>RSync is traditionally used to update Gentoo portage tree.</p> <p>But it's somewhat slow when dealing with a large number of files.</p> <p>So, I want to try to replace RSync with Git.</p> <p>I know that Funtoo have Git-based portage ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
21,036
git
# Is there any git repository with official daily updated Gentoo portage? RSync is traditionally used to update Gentoo portage tree. But it's somewhat slow when dealing with a large number of files. So, I want to try to replace RSync with Git. I know that Funtoo have Git-based portage tree, but is there a Gentoo-sp...
As a Gentoo developer I can say that there is no official git repository for the portage tree. There are plans to switch from what is currently used, CVS, to git, but that may still take a while. Currently, there are three ways to get the tree: 1. Via rsync, as you mentioned. 2. Via CVS, commands for anonymous access...
58867861
Run a husky git hook manually (without triggering it w/git command)
15
2019-11-14 23:03:43
<p>I'm setting up a node project with <a href="https://github.com/typicode/husky" rel="noreferrer"><code>husky</code></a> and I want to have a git-hook script run manually, without having to trigger it in git.</p> <p>Example:</p> <p>My package.json has the following:</p> <pre><code>{ ... "scripts": { "pr...
19,075
7,176,651
2024-03-07 14:15:49
58,871,128
18
2019-11-15 05:56:25
6,309
2019-11-15 05:56:25
https://stackoverflow.com/q/58867861
https://stackoverflow.com/a/58871128
<p>It should be possible, since <a href="https://stackoverflow.com/a/48301424/6309">this answer</a> illustrates you can simply call the <code>.git/hooks/pre-commit</code></p> <p>So as long as you are calling the hook directly, with its full path, you would run whatever it contains.</p>
<p>It should be possible, since <a href="https://stackoverflow.com/a/48301424/6309">this answer</a> illustrates you can simply call the <code>.git/hooks/pre-commit</code></p> <p>So as long as you are calling the hook directly, with its full path, you would run whatever it contains.</p>
3, 119, 43087, 124263
git, githooks, husky, javascript
<h1>Run a husky git hook manually (without triggering it w/git command)</h1> <p>I'm setting up a node project with <a href="https://github.com/typicode/husky" rel="noreferrer"><code>husky</code></a> and I want to have a git-hook script run manually, without having to trigger it in git.</p> <p>Example:</p> <p>My packa...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
21,038
git
# Run a husky git hook manually (without triggering it w/git command) I'm setting up a node project with [`husky`](https://github.com/typicode/husky) and I want to have a git-hook script run manually, without having to trigger it in git. Example: My package.json has the following: ``` { ... "scripts": { ...
It should be possible, since [this answer](https://stackoverflow.com/a/48301424/6309) illustrates you can simply call the `.git/hooks/pre-commit` So as long as you are calling the hook directly, with its full path, you would run whatever it contains.
35545982
Why do I get untracked files after a git pull (files were moved on the remote)
15
2016-02-22 04:47:43
<p>Running a <code>git pull</code> created some untracked files in my local copy. The files were moved on the remote, but the pull didn't remove the files in my working directory. I've spent quite a bit of time researching this, but can't find any similar cases. Is this intended behavior, am I missing something, or ...
18,706
3,638,059
2021-11-02 09:07:17
48,306,637
18
2018-01-17 17:18:14
4,878,911
2018-01-17 17:18:14
https://stackoverflow.com/q/35545982
https://stackoverflow.com/a/48306637
<p><code>git pull</code> doesn't delete uncommitted changes, it doesn't deal with your working directory, any changes or new files will not be touched unless it committed.</p> <p>to learn more about the States of any git repo, Read this :<br> <a href="https://git-scm.com/book/en/v2/Getting-Started-Git-Basics" rel="nor...
<p><code>git pull</code> doesn't delete uncommitted changes, it doesn't deal with your working directory, any changes or new files will not be touched unless it committed.</p> <p>to learn more about the States of any git repo, Read this :<br> <a href="https://git-scm.com/book/en/v2/Getting-Started-Git-Basics" rel="nor...
119
git
<h1>Why do I get untracked files after a git pull (files were moved on the remote)</h1> <p>Running a <code>git pull</code> created some untracked files in my local copy. The files were moved on the remote, but the pull didn't remove the files in my working directory. I've spent quite a bit of time researching this, b...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
21,040
git
# Why do I get untracked files after a git pull (files were moved on the remote) Running a `git pull` created some untracked files in my local copy. The files were moved on the remote, but the pull didn't remove the files in my working directory. I've spent quite a bit of time researching this, but can't find any simi...
`git pull` doesn't delete uncommitted changes, it doesn't deal with your working directory, any changes or new files will not be touched unless it committed. to learn more about the States of any git repo, Read this : <https://git-scm.com/book/en/v2/Getting-Started-Git-Basics> and also, to reset your local branch t...
45028134
What's the difference between the output from rev-parse and symbolic-ref?
15
2017-07-11 07:31:49
<p>I've run into 2 different ways for git to tell me the current branch: </p> <pre><code>git rev-parse --abbrev-ref HEAD </code></pre> <p>and</p> <pre><code>git symbolic-ref --short HEAD </code></pre> <p>Ehh.. what do both do exactly and when would they differ, if at all? </p>
1,955
376,390
2018-09-28 05:10:42
45,028,375
18
2017-07-11 07:44:36
6,394,138
2018-09-28 05:10:42
https://stackoverflow.com/q/45028134
https://stackoverflow.com/a/45028375
<p>They behave differently in detached HEAD state (when there is no current named branch). In such a situation <code>HEAD</code> is not a symbolic ref and <code>git symbolic-ref</code> exits with an error, whereas <code>git rev-parse --abbrev-ref</code> resolves <code>HEAD</code> to itself.</p> <pre><code>$ git checko...
<p>They behave differently in detached HEAD state (when there is no current named branch). In such a situation <code>HEAD</code> is not a symbolic ref and <code>git symbolic-ref</code> exits with an error, whereas <code>git rev-parse --abbrev-ref</code> resolves <code>HEAD</code> to itself.</p> <pre><code>$ git checko...
119
git
<h1>What's the difference between the output from rev-parse and symbolic-ref?</h1> <p>I've run into 2 different ways for git to tell me the current branch: </p> <pre><code>git rev-parse --abbrev-ref HEAD </code></pre> <p>and</p> <pre><code>git symbolic-ref --short HEAD </code></pre> <p>Ehh.. what do both do exactly...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
21,041
git
# What's the difference between the output from rev-parse and symbolic-ref? I've run into 2 different ways for git to tell me the current branch: ``` git rev-parse --abbrev-ref HEAD ``` and ``` git symbolic-ref --short HEAD ``` Ehh.. what do both do exactly and when would they differ, if at all?
They behave differently in detached HEAD state (when there is no current named branch). In such a situation `HEAD` is not a symbolic ref and `git symbolic-ref` exits with an error, whereas `git rev-parse --abbrev-ref` resolves `HEAD` to itself. ``` $ git checkout HEAD^ Note: checking out 'HEAD^'. You are in 'detached...
23857349
Re-use conflict resolution with Git
15
2014-05-25 16:11:36
<p>Can I tell Git to re-use the conflict resolution from an existing merge commit? I had rerere disabled at the time of commit. The new merge commit contains a few additional commits on the "ours" side of the merge (but they should not introduce new conflicts as they modified a different set of files).</p> <hr> <p>Fo...
924
112,968
2017-10-20 15:48:32
23,861,395
18
2014-05-26 00:56:43
1,290,731
2017-10-20 15:48:32
https://stackoverflow.com/q/23857349
https://stackoverflow.com/a/23861395
<p>The simplest way to implement what you're asking for is probably to retroactively turn rerere on:</p> <pre><code>git config rerere.enabled true # with rerere turned on, git checkout $o^1 # rerun the original merge git merge $o^2 git read-tree --reset -u $o: # resolve conflicts exactly as before gi...
<p>The simplest way to implement what you're asking for is probably to retroactively turn rerere on:</p> <pre><code>git config rerere.enabled true # with rerere turned on, git checkout $o^1 # rerun the original merge git merge $o^2 git read-tree --reset -u $o: # resolve conflicts exactly as before gi...
119, 717, 62599, 83367
git, git-rerere, merge, merge-conflict-resolution
<h1>Re-use conflict resolution with Git</h1> <p>Can I tell Git to re-use the conflict resolution from an existing merge commit? I had rerere disabled at the time of commit. The new merge commit contains a few additional commits on the "ours" side of the merge (but they should not introduce new conflicts as they modifie...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
21,044
git
# Re-use conflict resolution with Git Can I tell Git to re-use the conflict resolution from an existing merge commit? I had rerere disabled at the time of commit. The new merge commit contains a few additional commits on the "ours" side of the merge (but they should not introduce new conflicts as they modified a diffe...
The simplest way to implement what you're asking for is probably to retroactively turn rerere on: ``` git config rerere.enabled true # with rerere turned on, git checkout $o^1 # rerun the original merge git merge $o^2 git read-tree --reset -u $o: # resolve conflicts exactly as before git commit ...
21487091
errors while committing the repository in sourcetree, Git window client
15
2014-01-31 18:10:00
<p>I am new to bitbucket, git and sourcetree. i created a repository on bitbucket, then i installed the sourcetree client for win 7, then i clone that repository with my local desktop folder, then i placed a file in the local folder, now when i try to commit the changes, sourcetree give me following errors.</p> <block...
19,935
1,799,232
2015-09-29 15:56:31
21,496,543
18
2014-02-01 09:55:38
1,799,232
2014-02-01 09:55:38
https://stackoverflow.com/q/21487091
https://stackoverflow.com/a/21496543
<p>I got the solution for above mentioned problem, with the help of my friend , Solution is</p> <ol> <li><p>First get the Git Bash command line in ur system by installing Git from <a href="https://confluence.atlassian.com/display/BITBUCKET/Set+up+Git+and+Mercurial">Download Git for Windows</a></p></li> <li><p>Then ope...
<p>I got the solution for above mentioned problem, with the help of my friend , Solution is</p> <ol> <li><p>First get the Git Bash command line in ur system by installing Git from <a href="https://confluence.atlassian.com/display/BITBUCKET/Set+up+Git+and+Mercurial">Download Git for Windows</a></p></li> <li><p>Then ope...
119, 8337, 90056
atlassian-sourcetree, bitbucket, git
<h1>errors while committing the repository in sourcetree, Git window client</h1> <p>I am new to bitbucket, git and sourcetree. i created a repository on bitbucket, then i installed the sourcetree client for win 7, then i clone that repository with my local desktop folder, then i placed a file in the local folder, now w...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
21,045
git
# errors while committing the repository in sourcetree, Git window client I am new to bitbucket, git and sourcetree. i created a repository on bitbucket, then i installed the sourcetree client for win 7, then i clone that repository with my local desktop folder, then i placed a file in the local folder, now when i try...
I got the solution for above mentioned problem, with the help of my friend , Solution is 1. First get the Git Bash command line in ur system by installing Git from [Download Git for Windows](https://confluence.atlassian.com/display/BITBUCKET/Set+up+Git+and+Mercurial) 2. Then open Git Bash from start manu - Git - Git B...
19200561
Git: rebase onto development branch from upstream
15
2013-10-05 17:23:30
<p>I have local <code>master</code> and <code>develop</code> branches. I do all my work on <code>develop</code> and then merge them into <code>master</code> for releases. There is a remote branch, <code>upstream/master</code> which has changes I want, but I want to rebase my changes in <code>develop</code> (which share...
33,296
335,847
2020-12-20 20:56:05
19,200,858
18
2013-10-05 17:48:49
6,309
2013-10-05 17:48:49
https://stackoverflow.com/q/19200561
https://stackoverflow.com/a/19200858
<p>The rebase would actually be:</p> <pre><code>git checkout develop git rebase upstream/master </code></pre> <p>(<code>git rebase</code> should read: "rebase my current branch, here <code>develop</code>, <strong>on top of</strong> target branch, here <code>upstream/master</code>")</p> <p>And the end result wouldn't...
<p>The rebase would actually be:</p> <pre><code>git checkout develop git rebase upstream/master </code></pre> <p>(<code>git rebase</code> should read: "rebase my current branch, here <code>develop</code>, <strong>on top of</strong> target branch, here <code>upstream/master</code>")</p> <p>And the end result wouldn't...
119
git
<h1>Git: rebase onto development branch from upstream</h1> <p>I have local <code>master</code> and <code>develop</code> branches. I do all my work on <code>develop</code> and then merge them into <code>master</code> for releases. There is a remote branch, <code>upstream/master</code> which has changes I want, but I wan...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
21,046
git
# Git: rebase onto development branch from upstream I have local `master` and `develop` branches. I do all my work on `develop` and then merge them into `master` for releases. There is a remote branch, `upstream/master` which has changes I want, but I want to rebase my changes in `develop` (which shares a common ances...
The rebase would actually be: ``` git checkout develop git rebase upstream/master ``` (`git rebase` should read: "rebase my current branch, here `develop`, **on top of** target branch, here `upstream/master`") And the end result wouldn't be a detached head, but the newly rewritten `develop` branch.
10606535
`git svn rebase` vs `git rebase trunk`
15
2012-05-15 18:16:53
<p>I'm working on a project that uses subversion for their repository. Because I need to make some changes that can't be sent to the svn server yet, I started using <code>git svn</code> so that I could do local checkins. My setup looks like this:</p> <p><strong>Branches:</strong> trunk (tracking svn trunk), master (pr...
19,680
117,587
2013-01-21 18:06:32
10,652,357
18
2012-05-18 12:07:57
6,309
2013-01-21 18:06:32
https://stackoverflow.com/q/10606535
https://stackoverflow.com/a/10652357
<p>Note, from <a href="http://schacon.github.com/git/git-svn.html" rel="nofollow noreferrer">git svn</a>, as detailed in "<a href="https://stackoverflow.com/questions/2959443/why-is-the-meaning-of-ours-and-theirs-reversed-with-git-svn/2960751#2960751">Why is the meaning of “ours” and “theirs” reversed with git-svn</a>"...
<p>Note, from <a href="http://schacon.github.com/git/git-svn.html" rel="nofollow noreferrer">git svn</a>, as detailed in "<a href="https://stackoverflow.com/questions/2959443/why-is-the-meaning-of-ours-and-theirs-reversed-with-git-svn/2960751#2960751">Why is the meaning of “ours” and “theirs” reversed with git-svn</a>"...
63, 119, 8974
git, rebase, svn
<h1>`git svn rebase` vs `git rebase trunk`</h1> <p>I'm working on a project that uses subversion for their repository. Because I need to make some changes that can't be sent to the svn server yet, I started using <code>git svn</code> so that I could do local checkins. My setup looks like this:</p> <p><strong>Branches:...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
21,047
git
# `git svn rebase` vs `git rebase trunk` I'm working on a project that uses subversion for their repository. Because I need to make some changes that can't be sent to the svn server yet, I started using `git svn` so that I could do local checkins. My setup looks like this: **Branches:** trunk (tracking svn trunk), ma...
Note, from [git svn](http://schacon.github.com/git/git-svn.html), as detailed in "[Why is the meaning of “ours” and “theirs” reversed with git-svn](https://stackoverflow.com/questions/2959443/why-is-the-meaning-of-ours-and-theirs-reversed-with-git-svn/2960751#2960751)": ``` git svn rebase ``` > This fetches revisions...
9920182
Rebasing after squash merge duplicates commits
15
2012-03-29 06:31:52
<p>I have a 'master' branch and several topic branches. Assume that the master branch is used primarily as a release candidate and no development work happens on this branch.</p> <p>The topic branches are several and are shared by the team. Some of the branches have more than one developer working on them. All topic br...
8,779
1,165,866
2024-10-04 09:48:57
10,028,323
18
2012-04-05 12:10:03
106,205
2012-04-05 12:10:03
https://stackoverflow.com/q/9920182
https://stackoverflow.com/a/10028323
<p>Lets assume you have the following scenario:</p> <pre><code>A - B - C (master) \ D - E (topic) </code></pre> <p>If you merge topic into master with --squash you will get something like</p> <pre><code>A - B - C - F (master) \ D - E (topic) </code></pre> <p>Where F contains all changes from D and E. Rebasing...
<p>Lets assume you have the following scenario:</p> <pre><code>A - B - C (master) \ D - E (topic) </code></pre> <p>If you merge topic into master with --squash you will get something like</p> <pre><code>A - B - C - F (master) \ D - E (topic) </code></pre> <p>Where F contains all changes from D and E. Rebasing...
119, 29934
git, git-rebase
<h1>Rebasing after squash merge duplicates commits</h1> <p>I have a 'master' branch and several topic branches. Assume that the master branch is used primarily as a release candidate and no development work happens on this branch.</p> <p>The topic branches are several and are shared by the team. Some of the branches ha...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
21,048
git
# Rebasing after squash merge duplicates commits I have a 'master' branch and several topic branches. Assume that the master branch is used primarily as a release candidate and no development work happens on this branch. The topic branches are several and are shared by the team. Some of the branches have more than on...
Lets assume you have the following scenario: ``` A - B - C (master) \ D - E (topic) ``` If you merge topic into master with --squash you will get something like ``` A - B - C - F (master) \ D - E (topic) ``` Where F contains all changes from D and E. Rebasing topic on master makes no sense since the topic bra...
5306768
File Permission issues with sharing a GIT Remote Repository
15
2011-03-15 02:12:55
<p>I have a GIT repository that I manage for my office. Because of company policy, we can't use external hosting providers such as GitHub and the like. So, i'm left to do what I can with our local network.</p> <p>Everyone manages their own local repositories, but we also have a remote repository that our users push ...
12,552
464,990
2017-05-03 12:37:17
5,306,825
18
2011-03-15 02:22:39
47,773
2014-05-17 01:19:50
https://stackoverflow.com/q/5306768
https://stackoverflow.com/a/5306825
<p>git now has a <a href="https://www.kernel.org/pub/software/scm/git/docs/git-config.html" rel="noreferrer"><code>core.sharedRepository</code></a> option for exactly this purpose.</p> <p>I recommend:</p> <pre><code>git config core.sharedRepository group </code></pre> <p>Then, to set the initial group ownership, do:...
<p>git now has a <a href="https://www.kernel.org/pub/software/scm/git/docs/git-config.html" rel="noreferrer"><code>core.sharedRepository</code></a> option for exactly this purpose.</p> <p>I recommend:</p> <pre><code>git config core.sharedRepository group </code></pre> <p>Then, to set the initial group ownership, do:...
119, 7330
git, repository
<h1>File Permission issues with sharing a GIT Remote Repository</h1> <p>I have a GIT repository that I manage for my office. Because of company policy, we can't use external hosting providers such as GitHub and the like. So, i'm left to do what I can with our local network.</p> <p>Everyone manages their own local re...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
21,049
git
# File Permission issues with sharing a GIT Remote Repository I have a GIT repository that I manage for my office. Because of company policy, we can't use external hosting providers such as GitHub and the like. So, i'm left to do what I can with our local network. Everyone manages their own local repositories, but we...
git now has a [`core.sharedRepository`](https://www.kernel.org/pub/software/scm/git/docs/git-config.html) option for exactly this purpose. I recommend: ``` git config core.sharedRepository group ``` Then, to set the initial group ownership, do: ``` sudo chgrp -R somegroup . sudo find -type d -exec chmod g+s {} + su...
60707155
Prevent automatic line wrapping when editing git commit message in vim
14
2020-03-16 13:45:31
<p>I want to do the opposite of this question:</p> <p><a href="https://stackoverflow.com/questions/11023194/automatically-wrap-long-git-commit-messages-in-vim">Automatically wrap long Git commit messages in Vim</a></p> <p>Somehow, git decided it wants to wrap my commit messages at 72 characters. I don't want them wra...
3,151
1,593,077
2022-08-28 22:26:21
60,708,523
18
2020-03-16 15:12:45
9,447,571
2021-08-06 23:13:31
https://stackoverflow.com/q/60707155
https://stackoverflow.com/a/60708523
<p>You are getting these settings for a git commit message because Vim recognizes the filetype (<code>gitcommit</code>) and loads filetype-specific settings for it.</p> <p>In this case, it's coming from file <a href="https://github.com/vim/vim/blob/v8.2.0/runtime/ftplugin/gitcommit.vim#L15" rel="noreferrer"><code>$VIMR...
<p>You are getting these settings for a git commit message because Vim recognizes the filetype (<code>gitcommit</code>) and loads filetype-specific settings for it.</p> <p>In this case, it's coming from file <a href="https://github.com/vim/vim/blob/v8.2.0/runtime/ftplugin/gitcommit.vim#L15" rel="noreferrer"><code>$VIMR...
119, 370, 19508, 40713
git, text-width, vim, word-wrap
<h1>Prevent automatic line wrapping when editing git commit message in vim</h1> <p>I want to do the opposite of this question:</p> <p><a href="https://stackoverflow.com/questions/11023194/automatically-wrap-long-git-commit-messages-in-vim">Automatically wrap long Git commit messages in Vim</a></p> <p>Somehow, git dec...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
21,052
git
# Prevent automatic line wrapping when editing git commit message in vim I want to do the opposite of this question: [Automatically wrap long Git commit messages in Vim](https://stackoverflow.com/questions/11023194/automatically-wrap-long-git-commit-messages-in-vim) Somehow, git decided it wants to wrap my commit me...
You are getting these settings for a git commit message because Vim recognizes the filetype (`gitcommit`) and loads filetype-specific settings for it. In this case, it's coming from file [`$VIMRUNTIME/ftplugin/gitcommit.vim`](https://github.com/vim/vim/blob/v8.2.0/runtime/ftplugin/gitcommit.vim#L15), which includes th...
58242131
Is there a way to git stash specific lines of a file?
14
2019-10-04 19:21:50
<p>This is kind of a hard question to explain, mainly because I still don't know a whole bunch about git.</p> <p>I just know the basics to be able to get by.</p> <p>Currently I've been working on a bigger project and have changed a bunch of lines in a specific file. The update that I'm working on is still a ways away ...
7,404
11,852,419
2024-07-19 01:06:10
58,248,602
18
2019-10-05 13:09:28
12,058,959
2024-07-19 01:06:10
https://stackoverflow.com/q/58242131
https://stackoverflow.com/a/58248602
<p>You can stash specific lines from files by using the --patch option:</p> <pre><code>git stash push --patch git stash push --patch &lt;filename&gt; </code></pre> <p>Git will ask you interactively what you want to do with each file. You can edit the files or choose which lines get stashed</p> <p>Note that you can al...
<p>You can stash specific lines from files by using the --patch option:</p> <pre><code>git stash push --patch git stash push --patch &lt;filename&gt; </code></pre> <p>Git will ask you interactively what you want to do with each file. You can edit the files or choose which lines get stashed</p> <p>Note that you can al...
119
git
<h1>Is there a way to git stash specific lines of a file?</h1> <p>This is kind of a hard question to explain, mainly because I still don't know a whole bunch about git.</p> <p>I just know the basics to be able to get by.</p> <p>Currently I've been working on a bigger project and have changed a bunch of lines in a speci...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
21,053
git
# Is there a way to git stash specific lines of a file? This is kind of a hard question to explain, mainly because I still don't know a whole bunch about git. I just know the basics to be able to get by. Currently I've been working on a bigger project and have changed a bunch of lines in a specific file. The update ...
You can stash specific lines from files by using the --patch option: ``` git stash push --patch git stash push --patch <filename> ``` Git will ask you interactively what you want to do with each file. You can edit the files or choose which lines get stashed Note that you can also do this when adding files to your ...
51475525
Check if a git branch is ahead of another using a script
14
2018-07-23 09:27:38
<p>I have <code>branch1</code> and <code>branch2</code> and I want some sort of:</p> <p><code>git branch1 isahead branch2</code></p> <p>That will show if <code>branch1</code> has commits that <code>branch2</code> doesn't have (and possibly specify those commits too). I can't check diff cause <code>branch2</code> <str...
4,801
2,899,096
2018-08-01 08:58:21
51,475,693
18
2018-07-23 09:36:30
6,400,167
2018-07-23 15:21:38
https://stackoverflow.com/q/51475525
https://stackoverflow.com/a/51475693
<p>You can use</p> <p><code>git log branch2..branch1</code></p> <p>If <code>branch1</code> has no commit ahead of <code>branch2</code>, output will be empty.</p> <p>You can also use <code>git rev-list --count branch2..branch1</code></p> <p>This will show the number of commits ahead</p> <p><a href="https://stackove...
<p>You can use</p> <p><code>git log branch2..branch1</code></p> <p>If <code>branch1</code> has no commit ahead of <code>branch2</code>, output will be empty.</p> <p>You can also use <code>git rev-list --count branch2..branch1</code></p> <p>This will show the number of commits ahead</p> <p><a href="https://stackove...
58, 119, 531, 76220
git, git-branch, linux, scripting
<h1>Check if a git branch is ahead of another using a script</h1> <p>I have <code>branch1</code> and <code>branch2</code> and I want some sort of:</p> <p><code>git branch1 isahead branch2</code></p> <p>That will show if <code>branch1</code> has commits that <code>branch2</code> doesn't have (and possibly specify thos...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
21,054
git
# Check if a git branch is ahead of another using a script I have `branch1` and `branch2` and I want some sort of: `git branch1 isahead branch2` That will show if `branch1` has commits that `branch2` doesn't have (and possibly specify those commits too). I can't check diff cause `branch2` **is** ahead of `branch1` (...
You can use `git log branch2..branch1` If `branch1` has no commit ahead of `branch2`, output will be empty. You can also use `git rev-list --count branch2..branch1` This will show the number of commits ahead [Source](https://stackoverflow.com/questions/20433867/git-ahead-behind-info-between-master-and-branch)
47502859
Where keep deployment files in Multi Container, Multi Repository Project?
14
2017-11-27 01:36:22
<p>I have a stack that consist of three git repositories and applications:</p> <ul> <li>The Frontend Application</li> <li>The Backend Application</li> <li>The Worker Application</li> </ul> <p>They all work together with a <code>docker-compose.yml</code> file that also includes other resources and images needed to dep...
3,269
2,335,675
2020-12-30 19:22:56
48,332,911
18
2018-01-19 01:36:30
2,335,675
2020-12-30 19:22:56
https://stackoverflow.com/q/47502859
https://stackoverflow.com/a/48332911
<p>A few months after posting this question I've come up with the following conclusion:</p> <h2>1. Mono Repositories</h2> <p>In some cases the simplest solution might be to create a single repository that hold all the applications. This goes against the <a href="https://12factor.net/" rel="noreferrer">12 Factor Methodo...
<p>A few months after posting this question I've come up with the following conclusion:</p> <h2>1. Mono Repositories</h2> <p>In some cases the simplest solution might be to create a single repository that hold all the applications. This goes against the <a href="https://12factor.net/" rel="noreferrer">12 Factor Methodo...
119, 90304, 110604
docker, docker-compose, git
<h1>Where keep deployment files in Multi Container, Multi Repository Project?</h1> <p>I have a stack that consist of three git repositories and applications:</p> <ul> <li>The Frontend Application</li> <li>The Backend Application</li> <li>The Worker Application</li> </ul> <p>They all work together with a <code>docker-...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
21,055
git
# Where keep deployment files in Multi Container, Multi Repository Project? I have a stack that consist of three git repositories and applications: - The Frontend Application - The Backend Application - The Worker Application They all work together with a `docker-compose.yml` file that also includes other resources ...
A few months after posting this question I've come up with the following conclusion: ## 1. Mono Repositories In some cases the simplest solution might be to create a single repository that hold all the applications. This goes against the [12 Factor Methodology](https://12factor.net/) written by Heroku, however if all...
44953117
Can git tell me if a rebase will conflict without actually rebasing?
14
2017-07-06 15:25:02
<p>I would like to programmatically determine with of my feature branches would have rebase conflicts if I tried to rebase them. Is there a way I can get git to tell me this information without actually performing the rebase?</p> <p>Failing that, what is the simplest way to detect if a rebase failed before <code>git ...
4,072
997,606
2017-07-08 09:51:41
44,954,776
18
2017-07-06 16:49:04
1,256,452
2017-07-06 16:49:04
https://stackoverflow.com/q/44953117
https://stackoverflow.com/a/44954776
<blockquote> <p>Is there a way I can get git to tell me this information without actually performing the rebase?</p> </blockquote> <p>The short answer is "no". The long answer is longer but ends with "no" :-) ... you could get pretty close by writing a lot of code but to get the full correct answer you must do all ...
<blockquote> <p>Is there a way I can get git to tell me this information without actually performing the rebase?</p> </blockquote> <p>The short answer is "no". The long answer is longer but ends with "no" :-) ... you could get pretty close by writing a lot of code but to get the full correct answer you must do all ...
119, 8974
git, rebase
<h1>Can git tell me if a rebase will conflict without actually rebasing?</h1> <p>I would like to programmatically determine with of my feature branches would have rebase conflicts if I tried to rebase them. Is there a way I can get git to tell me this information without actually performing the rebase?</p> <p>Failing...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
21,056
git
# Can git tell me if a rebase will conflict without actually rebasing? I would like to programmatically determine with of my feature branches would have rebase conflicts if I tried to rebase them. Is there a way I can get git to tell me this information without actually performing the rebase? Failing that, what is th...
> Is there a way I can get git to tell me this information without actually performing the rebase? The short answer is "no". The long answer is longer but ends with "no" :-) ... you could get pretty close by writing a lot of code but to get the full correct answer you must do all the commit-copying steps of the rebase...
34881412
What precisely happens when deleting a branch in Git
14
2016-01-19 16:03:02
<p>I have been looking for an answer to this question for a while now, but am still not entirely sure about its answer. Most information I found about deleting branches was no more than a copy of what the manual says (for example <a href="https://stackoverflow.com/a/31185680/2386170">here on SO</a>). I think a core pr...
5,192
2,386,170
2022-05-16 15:27:23
34,882,795
18
2016-01-19 17:06:26
123,109
2022-05-16 15:27:23
https://stackoverflow.com/q/34881412
https://stackoverflow.com/a/34882795
<p>Regardless of whether you delete with <code>git branch -d</code> or <code>git branch -D</code>, git removes not the commits but the branch ref only. Read on to see what that means.</p> <p>First, we will set up a simple demo history.</p> <pre><code>$ touch initial ; git add initial ; git commit -m 'Initial commit' [m...
<p>Regardless of whether you delete with <code>git branch -d</code> or <code>git branch -D</code>, git removes not the commits but the branch ref only. Read on to see what that means.</p> <p>First, we will set up a simple demo history.</p> <pre><code>$ touch initial ; git add initial ; git commit -m 'Initial commit' [m...
119, 1879, 76220
branch, git, git-branch
<h1>What precisely happens when deleting a branch in Git</h1> <p>I have been looking for an answer to this question for a while now, but am still not entirely sure about its answer. Most information I found about deleting branches was no more than a copy of what the manual says (for example <a href="https://stackoverfl...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
21,058
git
# What precisely happens when deleting a branch in Git I have been looking for an answer to this question for a while now, but am still not entirely sure about its answer. Most information I found about deleting branches was no more than a copy of what the manual says (for example [here on SO](https://stackoverflow.co...
Regardless of whether you delete with `git branch -d` or `git branch -D`, git removes not the commits but the branch ref only. Read on to see what that means. First, we will set up a simple demo history. ``` $ touch initial ; git add initial ; git commit -m 'Initial commit' [master (root-commit) 2182bb2] Initial comm...
23935138
Cannot clone private repo from Vagrant provision file
14
2014-05-29 13:57:11
<p>I have vagrant provision script containing shell commands. When I try to clone private repo via git and private\public keys within this script I get an error:</p> <pre><code>Cloning into 'brand.api'... Stderr from the command: stdin: is not a tty dpkg-preconfigure: unable to re-open stdin: No such file or directo...
8,642
750,144
2017-11-09 02:36:22
23,936,465
18
2014-05-29 15:02:44
2,531,957
2014-05-29 15:02:44
https://stackoverflow.com/q/23935138
https://stackoverflow.com/a/23936465
<p>The SSH key of the git server is not known/trusted. When you clone the repo manually on the VM, you get a prompt asking to verify the fingerprint, right?</p> <p>You can either skip the host key verification in <code>~/.ssh/config</code> (or globally in <code>/etc/ssh/config</code> or alike):</p> <pre><code>Host gi...
<p>The SSH key of the git server is not known/trusted. When you clone the repo manually on the VM, you get a prompt asking to verify the fingerprint, right?</p> <p>You can either skip the host key verification in <code>~/.ssh/config</code> (or globally in <code>/etc/ssh/config</code> or alike):</p> <pre><code>Host gi...
119, 386, 25308, 66981
git, ssh, ssh-keys, vagrant
<h1>Cannot clone private repo from Vagrant provision file</h1> <p>I have vagrant provision script containing shell commands. When I try to clone private repo via git and private\public keys within this script I get an error:</p> <pre><code>Cloning into 'brand.api'... Stderr from the command: stdin: is not a tty dpkg...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
21,059
git
# Cannot clone private repo from Vagrant provision file I have vagrant provision script containing shell commands. When I try to clone private repo via git and private\public keys within this script I get an error: ``` Cloning into 'brand.api'... Stderr from the command: stdin: is not a tty dpkg-preconfigure: unabl...
The SSH key of the git server is not known/trusted. When you clone the repo manually on the VM, you get a prompt asking to verify the fingerprint, right? You can either skip the host key verification in `~/.ssh/config` (or globally in `/etc/ssh/config` or alike): ``` Host git.example.com StrictHostKeyChecking no ``...
23563062
How do I force Git NOT to prompt for credentials
14
2014-05-09 11:06:35
<p>I'm using <code>git clone</code> in a Bash script that takes any type of Git location (HTTPS, Git, SSH, filesystem...) and will clone it. But this script must work without interaction with any user. More precisely, I would like this script to NOT PAUSE for credentials: if the location requires credentials, and git c...
6,606
458,681
2018-08-29 07:14:26
23,563,077
18
2014-05-09 11:07:28
458,681
2015-02-06 13:01:14
https://stackoverflow.com/q/23563062
https://stackoverflow.com/a/23563077
<p><strong>UPDATE:</strong> in git version > <code>2.3</code>:</p> <pre><code>GIT_TERMINAL_PROMPT=0 </code></pre> <p><strong>For previous version:</strong></p> <p>Here's my trick to force failing:</p> <pre><code>GIT_ASKPASS=/bin/echo git clone ... </code></pre>
<p><strong>UPDATE:</strong> in git version > <code>2.3</code>:</p> <pre><code>GIT_TERMINAL_PROMPT=0 </code></pre> <p><strong>For previous version:</strong></p> <p>Here's my trick to force failing:</p> <pre><code>GIT_ASKPASS=/bin/echo git clone ... </code></pre>
119, 5357, 34099, 38756
credentials, git, git-clone, non-interactive
<h1>How do I force Git NOT to prompt for credentials</h1> <p>I'm using <code>git clone</code> in a Bash script that takes any type of Git location (HTTPS, Git, SSH, filesystem...) and will clone it. But this script must work without interaction with any user. More precisely, I would like this script to NOT PAUSE for cr...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
21,060
git
# How do I force Git NOT to prompt for credentials I'm using `git clone` in a Bash script that takes any type of Git location (HTTPS, Git, SSH, filesystem...) and will clone it. But this script must work without interaction with any user. More precisely, I would like this script to NOT PAUSE for credentials: if the lo...
**UPDATE:** in git version > `2.3`: ``` GIT_TERMINAL_PROMPT=0 ``` **For previous version:** Here's my trick to force failing: ``` GIT_ASKPASS=/bin/echo git clone ... ```
21832151
git archive : export-ignore, ignoring directories
14
2014-02-17 14:51:34
<p>I have a git repository with this <code>.gitattributes</code>:</p> <pre><code>my_script.py export-subst Makefile export-ignore README.md export-ignore .gitattributes export-ignore .gitignore export-ignore hooks/ export-ignore tests/ export-ignore *.pyc export-ignore </code></pre> <p>but when I make:</p> <pre><cod...
15,507
348,081
2021-03-31 20:25:55
21,832,617
18
2014-02-17 15:12:51
348,081
2014-02-17 15:18:43
https://stackoverflow.com/q/21832151
https://stackoverflow.com/a/21832617
<p>I removed the <code>/</code> in the directories, this fixed the problem</p> <pre><code>my_script.py export-subst Makefile export-ignore README.md export-ignore .gitattributes export-ignore .gitignore export-ignore hooks export-ignore tests export-ignore *.pyc export-ignore </code></pre> <p>I find the solution in a...
<p>I removed the <code>/</code> in the directories, this fixed the problem</p> <pre><code>my_script.py export-subst Makefile export-ignore README.md export-ignore .gitattributes export-ignore .gitignore export-ignore hooks export-ignore tests export-ignore *.pyc export-ignore </code></pre> <p>I find the solution in a...
119, 56102, 81662
git, git-archive, gitattributes
<h1>git archive : export-ignore, ignoring directories</h1> <p>I have a git repository with this <code>.gitattributes</code>:</p> <pre><code>my_script.py export-subst Makefile export-ignore README.md export-ignore .gitattributes export-ignore .gitignore export-ignore hooks/ export-ignore tests/ export-ignore *.pyc expo...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
21,061
git
# git archive : export-ignore, ignoring directories I have a git repository with this `.gitattributes`: ``` my_script.py export-subst Makefile export-ignore README.md export-ignore .gitattributes export-ignore .gitignore export-ignore hooks/ export-ignore tests/ export-ignore *.pyc export-ignore ``` but when I make:...
I removed the `/` in the directories, this fixed the problem ``` my_script.py export-subst Makefile export-ignore README.md export-ignore .gitattributes export-ignore .gitignore export-ignore hooks export-ignore tests export-ignore *.pyc export-ignore ``` I find the solution in a answer to a similar question: [git ig...
15275338
When doing a git clone --mirror where are the actual files?
14
2013-03-07 15:39:13
<p>I have a project on github which I'd like to mirror on my server.</p> <p>I've tried the following: <code>git clone --mirror git@github.com:user/repo.git</code>. </p> <p>Then in the <code>repo.git</code> directory, I have the following file structure (eg, output of <code>ls</code>):</p> <p><code>FETCH_HEAD branche...
8,460
1,350,862
2013-03-07 16:02:42
15,275,671
18
2013-03-07 15:53:07
149,170
2013-03-07 16:02:42
https://stackoverflow.com/q/15275338
https://stackoverflow.com/a/15275671
<p>When you <code>git clone --mirror</code>, it produces a bare repository, so it won't have a work area. I use <code>--mirror</code> more often to make a read-only clone of my working repo for others to pull from.</p> <p>It sounds like you probably should just omit the <code>--mirror</code> option.</p> <p>From <a hr...
<p>When you <code>git clone --mirror</code>, it produces a bare repository, so it won't have a work area. I use <code>--mirror</code> more often to make a read-only clone of my working repo for others to pull from.</p> <p>It sounds like you probably should just omit the <code>--mirror</code> option.</p> <p>From <a hr...
119, 7620, 34099
git, git-clone, mirror
<h1>When doing a git clone --mirror where are the actual files?</h1> <p>I have a project on github which I'd like to mirror on my server.</p> <p>I've tried the following: <code>git clone --mirror git@github.com:user/repo.git</code>. </p> <p>Then in the <code>repo.git</code> directory, I have the following file struct...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
21,062
git
# When doing a git clone --mirror where are the actual files? I have a project on github which I'd like to mirror on my server. I've tried the following: `git clone --mirror git@github.com:user/repo.git`. Then in the `repo.git` directory, I have the following file structure (eg, output of `ls`): `FETCH_HEAD branche...
When you `git clone --mirror`, it produces a bare repository, so it won't have a work area. I use `--mirror` more often to make a read-only clone of my working repo for others to pull from. It sounds like you probably should just omit the `--mirror` option. From [the `git clone` man page](https://www.kernel.org/pub/s...
15032159
git fetch, FETCH_HEAD and origin/master
14
2013-02-22 19:51:41
<p>I'm very new to git and I'm having trouble with a simple <code>fetch</code> operation.</p> <p>I'm trying to fetch a coworker's progress from his repository. At first I did <code>git fetch HEAD</code> which prompted git to download about 350MB of data so I was sure it had done something. However, <code>origin/maste...
53,956
1,361,615
2019-02-12 18:13:12
15,045,485
18
2013-02-23 20:46:23
413,399
2013-02-23 23:49:10
https://stackoverflow.com/q/15032159
https://stackoverflow.com/a/15045485
<p>I'm a bit confused by the commands you use. <code>HEAD</code> is usually a label git uses to track the commit that is currently in the working directory. The <code>git fetch</code> command expects a <strong>remote</strong> or a <strong>remote commit</strong> configuration to know what you want fetched. Using <cod...
<p>I'm a bit confused by the commands you use. <code>HEAD</code> is usually a label git uses to track the commit that is currently in the working directory. The <code>git fetch</code> command expects a <strong>remote</strong> or a <strong>remote commit</strong> configuration to know what you want fetched. Using <cod...
119, 33720
git, git-fetch
<h1>git fetch, FETCH_HEAD and origin/master</h1> <p>I'm very new to git and I'm having trouble with a simple <code>fetch</code> operation.</p> <p>I'm trying to fetch a coworker's progress from his repository. At first I did <code>git fetch HEAD</code> which prompted git to download about 350MB of data so I was sure it...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
21,063
git
# git fetch, FETCH_HEAD and origin/master I'm very new to git and I'm having trouble with a simple `fetch` operation. I'm trying to fetch a coworker's progress from his repository. At first I did `git fetch HEAD` which prompted git to download about 350MB of data so I was sure it had done something. However, `origin/...
I'm a bit confused by the commands you use. `HEAD` is usually a label git uses to track the commit that is currently in the working directory. The `git fetch` command expects a **remote** or a **remote commit** configuration to know what you want fetched. Using `git fetch HEAD` would indicate `HEAD` is a remote in your...
13571944
git svn - Unrecognized URL scheme error
14
2012-11-26 19:44:14
<p>I'm getting the following error on attempt to clone svn rep with git svn:</p> <pre><code>eugene$ git svn clone https://my.site/svn/ here Initialized empty Git repository in /Users/eugene/Documents/workspace/test/here/.git/ Bad URL passed to RA layer: Unrecognized URL scheme for 'https://my.site/svn' at /usr/local/g...
14,714
397,991
2018-12-04 02:10:06
13,865,154
18
2012-12-13 17:23:50
1,065,967
2015-12-03 00:56:26
https://stackoverflow.com/q/13571944
https://stackoverflow.com/a/13865154
<p>Apparently you have two different versions of Subversion binaries and one of those versions does not support <code>http(s)://</code> protocol.</p> <p>If you run <code>svn --version</code> the output should include something like this:</p> <pre><code>* ra_neon : Module for accessing a repository via WebDAV protocol...
<p>Apparently you have two different versions of Subversion binaries and one of those versions does not support <code>http(s)://</code> protocol.</p> <p>If you run <code>svn --version</code> the output should include something like this:</p> <pre><code>* ra_neon : Module for accessing a repository via WebDAV protocol...
63, 119, 6452
git, git-svn, svn
<h1>git svn - Unrecognized URL scheme error</h1> <p>I'm getting the following error on attempt to clone svn rep with git svn:</p> <pre><code>eugene$ git svn clone https://my.site/svn/ here Initialized empty Git repository in /Users/eugene/Documents/workspace/test/here/.git/ Bad URL passed to RA layer: Unrecognized URL...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
21,064
git
# git svn - Unrecognized URL scheme error I'm getting the following error on attempt to clone svn rep with git svn: ``` eugene$ git svn clone https://my.site/svn/ here Initialized empty Git repository in /Users/eugene/Documents/workspace/test/here/.git/ Bad URL passed to RA layer: Unrecognized URL scheme for 'https:/...
Apparently you have two different versions of Subversion binaries and one of those versions does not support `http(s)://` protocol. If you run `svn --version` the output should include something like this: ``` * ra_neon : Module for accessing a repository via WebDAV protocol using Neon. - handles 'http' scheme - ...
10128473
How can I skip commits in git?
14
2012-04-12 17:13:42
<p>I have some commits that I don't want in my project, but there's a commit based on them which I do want in it. This is my GitHub "Network" graph of the repository (ASCII, as I still cannot post images):</p> <pre><code>[]--[]--[_] | | | -------&gt;| ----------&gt;[·]--[·]--[*] </code></pre> <p>(-> mea...
21,755
1,324,984
2013-12-11 12:16:10
10,128,749
18
2012-04-12 17:32:18
236,871
2013-12-11 12:16:10
https://stackoverflow.com/q/10128473
https://stackoverflow.com/a/10128749
<p>I can give you two options:</p> <ul> <li><p><strong>Interactive rebase</strong> (<code>git rebase -i</code>) presents you a list of commits, editing this list will change the result of the operation; lets you reorder, delete or tag these commits for miscellaneous operations. In your case, you can rebase <code>[*]</...
<p>I can give you two options:</p> <ul> <li><p><strong>Interactive rebase</strong> (<code>git rebase -i</code>) presents you a list of commits, editing this list will change the result of the operation; lets you reorder, delete or tag these commits for miscellaneous operations. In your case, you can rebase <code>[*]</...
119, 53850
git, git-commit
<h1>How can I skip commits in git?</h1> <p>I have some commits that I don't want in my project, but there's a commit based on them which I do want in it. This is my GitHub "Network" graph of the repository (ASCII, as I still cannot post images):</p> <pre><code>[]--[]--[_] | | | -------&gt;| ----------&gt...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
21,065
git
# How can I skip commits in git? I have some commits that I don't want in my project, but there's a commit based on them which I do want in it. This is my GitHub "Network" graph of the repository (ASCII, as I still cannot post images): ``` []--[]--[_] | | | ------->| ---------->[·]--[·]--[*] ``` (-> me...
I can give you two options: - **Interactive rebase** (`git rebase -i`) presents you a list of commits, editing this list will change the result of the operation; lets you reorder, delete or tag these commits for miscellaneous operations. In your case, you can rebase `[*]`'s branch into `[_]`'s and delete the lines unw...
10022685
Using Git to create an archive of changed files
14
2012-04-05 04:26:12
<p>I am looking for a simple solution to make a archive of recent changed file.</p> <p>I get this simple command from <a href="http://tosbourn.com/2011/05/git/using-git-to-create-an-archive-of-changed-files/" rel="noreferrer">google</a></p> <pre><code>git archive -o update.zip HEAD $(git diff --name-only HEAD^) </cod...
11,784
151,562
2019-01-16 09:09:43
10,023,894
18
2012-04-05 06:51:15
520,162
2012-04-05 06:51:15
https://stackoverflow.com/q/10022685
https://stackoverflow.com/a/10023894
<p>I'm using <a href="https://stackoverflow.com/questions/1678032/exporting-archiving-changed-files-only-in-git">this answer</a> in that case that tells me to</p> <pre><code>tar czf changed-files.tar.gz `git diff --name-only [diff options]` </code></pre> <p>For example, to create an archive containing the files chang...
<p>I'm using <a href="https://stackoverflow.com/questions/1678032/exporting-archiving-changed-files-only-in-git">this answer</a> in that case that tells me to</p> <pre><code>tar czf changed-files.tar.gz `git diff --name-only [diff options]` </code></pre> <p>For example, to create an archive containing the files chang...
119
git
<h1>Using Git to create an archive of changed files</h1> <p>I am looking for a simple solution to make a archive of recent changed file.</p> <p>I get this simple command from <a href="http://tosbourn.com/2011/05/git/using-git-to-create-an-archive-of-changed-files/" rel="noreferrer">google</a></p> <pre><code>git archi...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
21,066
git
# Using Git to create an archive of changed files I am looking for a simple solution to make a archive of recent changed file. I get this simple command from [google](http://tosbourn.com/2011/05/git/using-git-to-create-an-archive-of-changed-files/) ``` git archive -o update.zip HEAD $(git diff --name-only HEAD^) ```...
I'm using [this answer](https://stackoverflow.com/questions/1678032/exporting-archiving-changed-files-only-in-git) in that case that tells me to ``` tar czf changed-files.tar.gz `git diff --name-only [diff options]` ``` For example, to create an archive containing the files changed in the last four revisions, I'd do ...
8480153
How to avoid tons of commits when debugging Heroku app
14
2011-12-12 20:03:56
<p>While trying to sort out bugs with apps on Heroku, I usually end up with a bunch of Git commits related to the bug fixing process, as I need to commit the updates in order to push to Heroku. Are there any clever ways of cleaning up those commits prior to pushing to the main shared repo for the project?</p>
1,670
678,350
2011-12-12 22:20:56
8,480,221
18
2011-12-12 20:12:33
211,563
2011-12-12 20:12:33
https://stackoverflow.com/q/8480153
https://stackoverflow.com/a/8480221
<p>Create a new branch when you start debugging (<code>git checkout -b debugging</code> or similar), and then make all your commits on there, pushing them to Heroku instead of your master via <code>git push heroku debugging:master</code>.</p> <p>Then when you've fixed the problem, you can squash your debugging changes...
<p>Create a new branch when you start debugging (<code>git checkout -b debugging</code> or similar), and then make all your commits on there, pushing them to Heroku instead of your master via <code>git push heroku debugging:master</code>.</p> <p>Then when you've fixed the problem, you can squash your debugging changes...
119, 4984, 8279
git, heroku, ruby-on-rails
<h1>How to avoid tons of commits when debugging Heroku app</h1> <p>While trying to sort out bugs with apps on Heroku, I usually end up with a bunch of Git commits related to the bug fixing process, as I need to commit the updates in order to push to Heroku. Are there any clever ways of cleaning up those commits prior t...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
21,067
git
# How to avoid tons of commits when debugging Heroku app While trying to sort out bugs with apps on Heroku, I usually end up with a bunch of Git commits related to the bug fixing process, as I need to commit the updates in order to push to Heroku. Are there any clever ways of cleaning up those commits prior to pushing...
Create a new branch when you start debugging (`git checkout -b debugging` or similar), and then make all your commits on there, pushing them to Heroku instead of your master via `git push heroku debugging:master`. Then when you've fixed the problem, you can squash your debugging changes into a single commit and merge ...
7642996
Using git-svn, how do I dcommit tags?
14
2011-10-04 03:31:47
<p>I was using Git to retain a history of my project locally. I was later asked to commit the entire git project into a remote, empty svn project folder (the usual trunk, tags, branches structure, in that case and spelling). I was able to commit to the trunk perfectly fine, but none of the tags seemed to have been dc...
8,374
434,414
2011-10-04 04:36:25
7,643,362
18
2011-10-04 04:36:25
526,535
2011-10-04 04:36:25
https://stackoverflow.com/q/7642996
https://stackoverflow.com/a/7643362
<p>Git and SVN treat tags differently. Tags are a powerful feature in Git, but just a folder in SVN, much like how branches are.</p> <p>So to create tags in SVN from git-svn, you have to create a branch (tag) in git-svn repo. Git tags will not be "dcommitted"</p> <p>You can use <code>git svn branch --tag</code> or it...
<p>Git and SVN treat tags differently. Tags are a powerful feature in Git, but just a folder in SVN, much like how branches are.</p> <p>So to create tags in SVN from git-svn, you have to create a branch (tag) in git-svn repo. Git tags will not be "dcommitted"</p> <p>You can use <code>git svn branch --tag</code> or it...
63, 115, 119, 6452, 31409
git, git-svn, svn, tags, tortoisegit
<h1>Using git-svn, how do I dcommit tags?</h1> <p>I was using Git to retain a history of my project locally. I was later asked to commit the entire git project into a remote, empty svn project folder (the usual trunk, tags, branches structure, in that case and spelling). I was able to commit to the trunk perfectly fi...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
21,068
git
# Using git-svn, how do I dcommit tags? I was using Git to retain a history of my project locally. I was later asked to commit the entire git project into a remote, empty svn project folder (the usual trunk, tags, branches structure, in that case and spelling). I was able to commit to the trunk perfectly fine, but non...
Git and SVN treat tags differently. Tags are a powerful feature in Git, but just a folder in SVN, much like how branches are. So to create tags in SVN from git-svn, you have to create a branch (tag) in git-svn repo. Git tags will not be "dcommitted" You can use `git svn branch --tag` or its shorthand `git svn tag` to...
6434819
Pushing existing git repository to gitolite
14
2011-06-22 04:14:43
<p>I've set up gitolite on my Ubuntu server and can add users, create empty repositories, clone the empty repository, add files, commit locally, and <code>git push origin master</code> to send it to gitolite.</p> <p>I can also create a project in XCode4, with its own git repository, and commit changes locally.</p> <p...
18,548
550,672
2019-10-07 01:31:32
6,434,881
18
2011-06-22 04:24:32
685,929
2019-10-07 01:31:32
https://stackoverflow.com/q/6434819
https://stackoverflow.com/a/6434881
<p>You need to add another remote to your existing repository:</p> <pre><code>git remote add newremote git@gitolite.com:gitolite_repo </code></pre> <p>These values will be changed to suit your needs:</p> <ul> <li>newremote is the name of the new remote (it's like origin, which you've already been using.)</li> <li>gi...
<p>You need to add another remote to your existing repository:</p> <pre><code>git remote add newremote git@gitolite.com:gitolite_repo </code></pre> <p>These values will be changed to suit your needs:</p> <ul> <li>newremote is the name of the new remote (it's like origin, which you've already been using.)</li> <li>gi...
28898, 39151
gitolite, git-push
<h1>Pushing existing git repository to gitolite</h1> <p>I've set up gitolite on my Ubuntu server and can add users, create empty repositories, clone the empty repository, add files, commit locally, and <code>git push origin master</code> to send it to gitolite.</p> <p>I can also create a project in XCode4, with its ow...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
21,069
git
# Pushing existing git repository to gitolite I've set up gitolite on my Ubuntu server and can add users, create empty repositories, clone the empty repository, add files, commit locally, and `git push origin master` to send it to gitolite. I can also create a project in XCode4, with its own git repository, and commi...
You need to add another remote to your existing repository: ``` git remote add newremote git@gitolite.com:gitolite_repo ``` These values will be changed to suit your needs: - newremote is the name of the new remote (it's like origin, which you've already been using.) - git is the username - gitolite.com is the serve...
35450049
What does "would be overwritten by merge" mean?
13
2016-02-17 07:07:25
<p>When pulling from a team based Git remote repository, I get this message:</p> <pre><code>"C:\Program Files (x86)\Git\bin\git.exe" pull --progress "origin" +refs/heads/master:refs/remotes/origin/master Updating 71089d7..4c66e71 error: Your local changes to the following files would be overwritten by merge: Sourc...
34,524
5,769,938
2016-02-17 07:43:03
35,450,614
18
2016-02-17 07:43:03
167,735
2016-02-17 07:43:03
https://stackoverflow.com/q/35450049
https://stackoverflow.com/a/35450614
<h3>What rule would produce a "would be overwritten" warning?</h3> <p>If you've modified a file that also have modifications in the remote repository but have not committed it.</p> <h3>What rule would avoid a "would be overwritten" warning?</h3> <p>If there are no uncommitted files that also have modifications in th...
<h3>What rule would produce a "would be overwritten" warning?</h3> <p>If you've modified a file that also have modifications in the remote repository but have not committed it.</p> <h3>What rule would avoid a "would be overwritten" warning?</h3> <p>If there are no uncommitted files that also have modifications in th...
119, 28896
git, git-pull
<h1>What does "would be overwritten by merge" mean?</h1> <p>When pulling from a team based Git remote repository, I get this message:</p> <pre><code>"C:\Program Files (x86)\Git\bin\git.exe" pull --progress "origin" +refs/heads/master:refs/remotes/origin/master Updating 71089d7..4c66e71 error: Your local changes to the...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
21,072
git
# What does "would be overwritten by merge" mean? When pulling from a team based Git remote repository, I get this message: ``` "C:\Program Files (x86)\Git\bin\git.exe" pull --progress "origin" +refs/heads/master:refs/remotes/origin/master Updating 71089d7..4c66e71 error: Your local changes to the following files wou...
### What rule would produce a "would be overwritten" warning? If you've modified a file that also have modifications in the remote repository but have not committed it. ### What rule would avoid a "would be overwritten" warning? If there are no uncommitted files that also have modifications in the remote repo. ### ...
20525055
How to ignore existing file in Git?
13
2013-12-11 16:50:30
<p>I need to work on <code>file.txt</code> locally and in Git, with different content. I want Git not to tell me that there have been changes to that file.</p> <p>Is this possible?</p>
17,633
2,472,467
2016-08-11 20:20:17
27,301,155
18
2014-12-04 18:19:40
467,386
2015-02-24 17:17:41
https://stackoverflow.com/q/20525055
https://stackoverflow.com/a/27301155
<p>Actually, you want <code>--skip-worktree</code>, not <code>--assume-unchanged</code>. <a href="https://stackoverflow.com/a/13631525/467386">Here's a good explanation why</a>.</p> <p>So <code>git update-index --skip-worktree file.txt</code></p> <p>TLDR; <code>--assume-unchanged</code> is for performance, for files ...
<p>Actually, you want <code>--skip-worktree</code>, not <code>--assume-unchanged</code>. <a href="https://stackoverflow.com/a/13631525/467386">Here's a good explanation why</a>.</p> <p>So <code>git update-index --skip-worktree file.txt</code></p> <p>TLDR; <code>--assume-unchanged</code> is for performance, for files ...
119, 456, 90056
atlassian-sourcetree, git, version-control
<h1>How to ignore existing file in Git?</h1> <p>I need to work on <code>file.txt</code> locally and in Git, with different content. I want Git not to tell me that there have been changes to that file.</p> <p>Is this possible?</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
21,073
git
# How to ignore existing file in Git? I need to work on `file.txt` locally and in Git, with different content. I want Git not to tell me that there have been changes to that file. Is this possible?
Actually, you want `--skip-worktree`, not `--assume-unchanged`. [Here's a good explanation why](https://stackoverflow.com/a/13631525/467386). So `git update-index --skip-worktree file.txt` TLDR; `--assume-unchanged` is for performance, for files that won't change (like SDKs); `--skip-worktree` is for files that exist...
26944235
Creating aliases for Git branch names
13
2014-11-15 08:58:30
<p>Suppose I have the following branches in git:</p> <ul> <li><code>master</code></li> <li><code>release-2014-11-02-some-long-text</code></li> </ul> <p>I would like to easily switch between those to, like this:</p> <pre><code>git checkout devel # checkout to master git checkout release # checkout to the branch relea...
3,990
963,881
2014-11-15 09:17:19
26,944,313
18
2014-11-15 09:10:00
6,309
2014-11-15 09:10:00
https://stackoverflow.com/q/26944235
https://stackoverflow.com/a/26944313
<p>You can try using <a href="http://git-scm.com/docs/git-symbolic-ref" rel="noreferrer"><code>git symbolic-ref</code></a> (as mentioned in "<a href="https://stackoverflow.com/a/549949/6309">Is it possible to alias a branch in Git?</a>"):</p> <pre><code>git symbolic-ref refs/heads/devel refs/heads/master git symboli...
<p>You can try using <a href="http://git-scm.com/docs/git-symbolic-ref" rel="noreferrer"><code>git symbolic-ref</code></a> (as mentioned in "<a href="https://stackoverflow.com/a/549949/6309">Is it possible to alias a branch in Git?</a>"):</p> <pre><code>git symbolic-ref refs/heads/devel refs/heads/master git symboli...
119, 1448, 1879, 37230
alias, branch, git, git-checkout
<h1>Creating aliases for Git branch names</h1> <p>Suppose I have the following branches in git:</p> <ul> <li><code>master</code></li> <li><code>release-2014-11-02-some-long-text</code></li> </ul> <p>I would like to easily switch between those to, like this:</p> <pre><code>git checkout devel # checkout to master git ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
21,074
git
# Creating aliases for Git branch names Suppose I have the following branches in git: - `master` - `release-2014-11-02-some-long-text` I would like to easily switch between those to, like this: ``` git checkout devel # checkout to master git checkout release # checkout to the branch release currently points/aliases...
You can try using [`git symbolic-ref`](http://git-scm.com/docs/git-symbolic-ref) (as mentioned in "[Is it possible to alias a branch in Git?](https://stackoverflow.com/a/549949/6309)"): ``` git symbolic-ref refs/heads/devel refs/heads/master git symbolic-ref refs/heads/release refs/heads/release-2014-11-02-some-long...
22968710
GIT: filter log by group of authors
13
2014-04-09 16:35:16
<p>Our company is divided in teams and we perform code reviews before sending our code to the QA guys.</p> <p>Usually, any code we touch is reviewed by someone inside the same team (A), but in some cases we also need to touch code from another team (B).</p> <p>For those cases, the code review should be two-fold: <str...
11,146
76,583
2021-09-08 12:15:02
22,971,024
18
2014-04-09 18:29:22
454,515
2014-04-10 17:41:26
https://stackoverflow.com/q/22968710
https://stackoverflow.com/a/22971024
<p>EDIT: This should show commits with author names that do not contain "John" "Paul" or "Ringo". Requires git to be built with PCRE.</p> <p><code>git log --perl-regexp --author='^(?!(.*(John|Paul|Ringo)))'</code></p> <p>I'll leave previous variants below as they still may be of some use:</p> <hr> <p>You should be ...
<p>EDIT: This should show commits with author names that do not contain "John" "Paul" or "Ringo". Requires git to be built with PCRE.</p> <p><code>git log --perl-regexp --author='^(?!(.*(John|Paul|Ringo)))'</code></p> <p>I'll leave previous variants below as they still may be of some use:</p> <hr> <p>You should be ...
119, 3953, 5597, 10052
author, commit, filter, git
<h1>GIT: filter log by group of authors</h1> <p>Our company is divided in teams and we perform code reviews before sending our code to the QA guys.</p> <p>Usually, any code we touch is reviewed by someone inside the same team (A), but in some cases we also need to touch code from another team (B).</p> <p>For those ca...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
21,075
git
# GIT: filter log by group of authors Our company is divided in teams and we perform code reviews before sending our code to the QA guys. Usually, any code we touch is reviewed by someone inside the same team (A), but in some cases we also need to touch code from another team (B). For those cases, the code review sh...
EDIT: This should show commits with author names that do not contain "John" "Paul" or "Ringo". Requires git to be built with PCRE. `git log --perl-regexp --author='^(?!(.*(John|Paul|Ringo)))'` I'll leave previous variants below as they still may be of some use: --- You should be able to do it using negative look-be...
21553304
Put current git branch to project version
13
2014-02-04 13:01:56
<p>I want to put the current git branch into the version field in pom xml. I found some post in the internet suggesting to do something like:</p> <pre><code>&lt;version&gt;${scm.version}&lt;/version&gt; </code></pre> <p>but this seems not to work with git. Are there any other solutions?</p>
23,551
905,640
2017-10-16 05:17:24
21,553,367
18
2014-02-04 13:05:10
1,557,750
2014-02-04 13:05:10
https://stackoverflow.com/q/21553304
https://stackoverflow.com/a/21553367
<p>Yes, use the <a href="https://github.com/ktoso/maven-git-commit-id-plugin" rel="noreferrer">git commit id plugin for maven</a></p> <p>It's pretty straightforward. You can use it to get the git branch with </p> <pre><code>${git.branch} </code></pre> <p>So in your case it would go:</p> <pre><code>&lt;version&gt;${...
<p>Yes, use the <a href="https://github.com/ktoso/maven-git-commit-id-plugin" rel="noreferrer">git commit id plugin for maven</a></p> <p>It's pretty straightforward. You can use it to get the git branch with </p> <pre><code>${git.branch} </code></pre> <p>So in your case it would go:</p> <pre><code>&lt;version&gt;${...
81, 119, 41127
git, maven, versioning
<h1>Put current git branch to project version</h1> <p>I want to put the current git branch into the version field in pom xml. I found some post in the internet suggesting to do something like:</p> <pre><code>&lt;version&gt;${scm.version}&lt;/version&gt; </code></pre> <p>but this seems not to work with git. Are there ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
21,076
git
# Put current git branch to project version I want to put the current git branch into the version field in pom xml. I found some post in the internet suggesting to do something like: ``` <version>${scm.version}</version> ``` but this seems not to work with git. Are there any other solutions?
Yes, use the [git commit id plugin for maven](https://github.com/ktoso/maven-git-commit-id-plugin) It's pretty straightforward. You can use it to get the git branch with ``` ${git.branch} ``` So in your case it would go: ``` <version>${git.branch}</version> ```
19811269
Definitively delete the tracking of .DS_Store files in GIT
13
2013-11-06 11:45:08
<p>I've a git repo where <code>.DS_Store</code> files are already tracked. Is there a way to completely ignore theme in every folder?</p> <p>I know that before being tracked I can simply put <code>.DS_Store</code> in <code>.gitignore</code>, but I also know that it doesn't work if <code>.DS_Store</code> are already ve...
4,518
551,357
2013-11-06 12:11:38
19,811,501
18
2013-11-06 11:55:05
1,860,929
2013-11-06 11:55:05
https://stackoverflow.com/q/19811269
https://stackoverflow.com/a/19811501
<p>You need to remove them from the repo using <code>git rm</code> and then commit the changes.</p> <pre><code>git rm --cached "*.DS_Store" git commit -m "remove all .DS_Store" </code></pre>
<p>You need to remove them from the repo using <code>git rm</code> and then commit the changes.</p> <pre><code>git rm --cached "*.DS_Store" git commit -m "remove all .DS_Store" </code></pre>
119
git
<h1>Definitively delete the tracking of .DS_Store files in GIT</h1> <p>I've a git repo where <code>.DS_Store</code> files are already tracked. Is there a way to completely ignore theme in every folder?</p> <p>I know that before being tracked I can simply put <code>.DS_Store</code> in <code>.gitignore</code>, but I als...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
21,077
git
# Definitively delete the tracking of .DS_Store files in GIT I've a git repo where `.DS_Store` files are already tracked. Is there a way to completely ignore theme in every folder? I know that before being tracked I can simply put `.DS_Store` in `.gitignore`, but I also know that it doesn't work if `.DS_Store` are al...
You need to remove them from the repo using `git rm` and then commit the changes. ``` git rm --cached "*.DS_Store" git commit -m "remove all .DS_Store" ```
9666499
How to recover files from index
13
2012-03-12 11:51:20
<p>I accidentally erase files. Fortunately, I have added those to index. Please tell me how to recover those files to working tree, without commiting.</p>
9,468
818,491
2020-10-10 10:43:53
9,666,522
18
2012-03-12 11:52:51
6,309
2020-10-10 10:43:53
https://stackoverflow.com/q/9666499
https://stackoverflow.com/a/9666522
<p>2014: <a href="http://linux.die.net/man/1/git-checkout-index" rel="noreferrer">git <code>checkout-index</code></a> will restore deleted files. It will NOT change the content of existing files.<br /> (unless, as commented, using the <a href="https://git-scm.com/docs/git-checkout-index#Documentation/git-checkout-index...
<p>2014: <a href="http://linux.die.net/man/1/git-checkout-index" rel="noreferrer">git <code>checkout-index</code></a> will restore deleted files. It will NOT change the content of existing files.<br /> (unless, as commented, using the <a href="https://git-scm.com/docs/git-checkout-index#Documentation/git-checkout-index...
119
git
<h1>How to recover files from index</h1> <p>I accidentally erase files. Fortunately, I have added those to index. Please tell me how to recover those files to working tree, without commiting.</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
21,080
git
# How to recover files from index I accidentally erase files. Fortunately, I have added those to index. Please tell me how to recover those files to working tree, without commiting.
2014: [git `checkout-index`](http://linux.die.net/man/1/git-checkout-index) will restore deleted files. It will NOT change the content of existing files. (unless, as commented, using the [`-f/--force` option](https://git-scm.com/docs/git-checkout-index#Documentation/git-checkout-index.txt--f)) [Charles](https://stac...
9586362
How do I checkout a branch ignoring all local changes?
13
2012-03-06 15:12:37
<p>After I have messed around with directories (created/removed) and added/edited both text and binary files, how do I tell git to throw away all my changes, and bring the branch down again, as if I never messed with anything?</p> <p>Currently I'm doing these two commands.</p> <pre><code>git stash git stash clear git...
19,514
92,882
2024-11-19 23:54:06
9,586,429
18
2012-03-06 15:16:06
421,223
2012-03-06 15:16:06
https://stackoverflow.com/q/9586362
https://stackoverflow.com/a/9586429
<p><a href="http://linux.die.net/man/1/git-reset">http://linux.die.net/man/1/git-reset</a></p> <pre><code>git reset --hard </code></pre>
<p><a href="http://linux.die.net/man/1/git-reset">http://linux.die.net/man/1/git-reset</a></p> <pre><code>git reset --hard </code></pre>
119, 13091, 37230
git, git-checkout, git-stash
<h1>How do I checkout a branch ignoring all local changes?</h1> <p>After I have messed around with directories (created/removed) and added/edited both text and binary files, how do I tell git to throw away all my changes, and bring the branch down again, as if I never messed with anything?</p> <p>Currently I'm doing t...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
21,081
git
# How do I checkout a branch ignoring all local changes? After I have messed around with directories (created/removed) and added/edited both text and binary files, how do I tell git to throw away all my changes, and bring the branch down again, as if I never messed with anything? Currently I'm doing these two command...
<http://linux.die.net/man/1/git-reset> ``` git reset --hard ```
9000918
How to cherry-pick interactively
13
2012-01-25 10:13:35
<p>I have hacked on a branch for a while, and this branch won't be merge before long. But there are some commits I'd like to merge in the master anyway.</p> <p>Is there a way to get an interactive cherry-pick, that would show the commits and their changes, and then let me select the ones I'd actually like to cherry-pi...
9,937
353,612
2012-01-25 10:21:46
9,001,019
18
2012-01-25 10:21:46
663,028
2012-01-25 10:21:46
https://stackoverflow.com/q/9000918
https://stackoverflow.com/a/9001019
<p>You can do that via the commit graph using <code> gitk --all</code>, and right clicking on the commit that you wish to cherrypick to your current branch.</p>
<p>You can do that via the commit graph using <code> gitk --all</code>, and right clicking on the commit that you wish to cherrypick to your current branch.</p>
119, 36489
cherry-pick, git
<h1>How to cherry-pick interactively</h1> <p>I have hacked on a branch for a while, and this branch won't be merge before long. But there are some commits I'd like to merge in the master anyway.</p> <p>Is there a way to get an interactive cherry-pick, that would show the commits and their changes, and then let me sele...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
21,082
git
# How to cherry-pick interactively I have hacked on a branch for a while, and this branch won't be merge before long. But there are some commits I'd like to merge in the master anyway. Is there a way to get an interactive cherry-pick, that would show the commits and their changes, and then let me select the ones I'd ...
You can do that via the commit graph using `gitk --all`, and right clicking on the commit that you wish to cherrypick to your current branch.
7844889
.gitignore shows up when I run git status
13
2011-10-21 04:12:03
<p>When I run <code>git status</code>, .gitignore is listed under untracked files. How do I prevent it from being listed?</p> <p>Contents of .gitignore:</p> <pre><code>images/builder/ </code></pre>
10,646
731,218
2011-10-21 09:12:33
7,844,899
18
2011-10-21 04:13:33
444,810
2011-10-21 04:13:33
https://stackoverflow.com/q/7844889
https://stackoverflow.com/a/7844899
<p>You can add <code>.gitignore</code> to your <code>.gitignore</code> file, but you probably just want to commit it anyway considering all of your team members (if there are any others) are probably going to have the same files listed in <code>.gitignore</code>.</p>
<p>You can add <code>.gitignore</code> to your <code>.gitignore</code> file, but you probably just want to commit it anyway considering all of your team members (if there are any others) are probably going to have the same files listed in <code>.gitignore</code>.</p>
119
git
<h1>.gitignore shows up when I run git status</h1> <p>When I run <code>git status</code>, .gitignore is listed under untracked files. How do I prevent it from being listed?</p> <p>Contents of .gitignore:</p> <pre><code>images/builder/ </code></pre>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
21,084
git
# .gitignore shows up when I run git status When I run `git status`, .gitignore is listed under untracked files. How do I prevent it from being listed? Contents of .gitignore: ``` images/builder/ ```
You can add `.gitignore` to your `.gitignore` file, but you probably just want to commit it anyway considering all of your team members (if there are any others) are probably going to have the same files listed in `.gitignore`.
6975272
How can I remove unneeded git commits?
13
2011-08-07 19:34:46
<p>I have some garbage commits in my Git repository. These have been created by, e.g., the Git GUI when changing the latest commit again and accidentally creating additional commits.</p> <p>Now I have some commits lying around without any HEAD assigned (detached, not part of any branch).</p> <p>As I want to tidy up, my...
8,742
882,756
2025-06-10 04:02:35
6,975,294
18
2011-08-07 19:37:31
501,250
2011-08-07 19:37:31
https://stackoverflow.com/q/6975272
https://stackoverflow.com/a/6975294
<p>Try this:</p> <pre><code>git reflog expire --expire=now git gc --prune=now </code></pre>
<p>Try this:</p> <pre><code>git reflog expire --expire=now git gc --prune=now </code></pre>
119
git
<h1>How can I remove unneeded git commits?</h1> <p>I have some garbage commits in my Git repository. These have been created by, e.g., the Git GUI when changing the latest commit again and accidentally creating additional commits.</p> <p>Now I have some commits lying around without any HEAD assigned (detached, not part...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
21,085
git
# How can I remove unneeded git commits? I have some garbage commits in my Git repository. These have been created by, e.g., the Git GUI when changing the latest commit again and accidentally creating additional commits. Now I have some commits lying around without any HEAD assigned (detached, not part of any branch)...
Try this: ``` git reflog expire --expire=now git gc --prune=now ```
5550137
using git to compare one file from two commits
13
2011-04-05 10:00:17
<p>I have a file that has broken somewhere down the line, and I have found the last point in which it was still fixed. </p> <p>I would like to know how, using git, I can compare one file from two commits, or indeed if that is the best way to play this!!</p>
6,074
445,126
2022-09-14 14:34:17
5,550,205
18
2011-04-05 10:05:38
223,092
2011-04-05 10:26:09
https://stackoverflow.com/q/5550137
https://stackoverflow.com/a/5550205
<p>To directly answer your question, suppose you want to compare the file <code>src/toaster.c</code> between your current <code>master</code> and the old commit <code>f4l4f3l</code>, you can just do:</p> <pre><code>git diff master f4l4f3l -- src/toaster.c </code></pre> <p>As an alternative, you can just look through ...
<p>To directly answer your question, suppose you want to compare the file <code>src/toaster.c</code> between your current <code>master</code> and the old commit <code>f4l4f3l</code>, you can just do:</p> <pre><code>git diff master f4l4f3l -- src/toaster.c </code></pre> <p>As an alternative, you can just look through ...
119, 277, 9033
debugging, git, git-diff
<h1>using git to compare one file from two commits</h1> <p>I have a file that has broken somewhere down the line, and I have found the last point in which it was still fixed. </p> <p>I would like to know how, using git, I can compare one file from two commits, or indeed if that is the best way to play this!!</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
21,086
git
# using git to compare one file from two commits I have a file that has broken somewhere down the line, and I have found the last point in which it was still fixed. I would like to know how, using git, I can compare one file from two commits, or indeed if that is the best way to play this!!
To directly answer your question, suppose you want to compare the file `src/toaster.c` between your current `master` and the old commit `f4l4f3l`, you can just do: ``` git diff master f4l4f3l -- src/toaster.c ``` As an alternative, you can just look through all the changes to that file with: ``` git log -p -- src/to...
4665902
Move a file to a new folder, keeping Git history
13
2011-01-12 06:22:02
<p>I am looking to move a folder so that it resides in another folder.</p> <p>Currently: /folder1, moved to /holder/folder1, for example.</p> <p>What is the easiest way to do this both on my home machine (Mac) and git to ensure that all of the history of the files within that folder remain on github.</p> <p>Sorry f...
7,329
572,290
2014-01-06 16:17:01
4,665,963
18
2011-01-12 06:32:23
254,643
2011-01-12 06:32:23
https://stackoverflow.com/q/4665902
https://stackoverflow.com/a/4665963
<p>From git documentation,</p> <pre><code>git mv [-f] [-n] &lt;source&gt; &lt;destination&gt; git mv [-f] [-n] [-k] &lt;source&gt; ... &lt;destination directory&gt; </code></pre> <p>In the first form, it renames , which must exist and be either a file, symlink or directory, to . In the second form, the last argument...
<p>From git documentation,</p> <pre><code>git mv [-f] [-n] &lt;source&gt; &lt;destination&gt; git mv [-f] [-n] [-k] &lt;source&gt; ... &lt;destination directory&gt; </code></pre> <p>In the first form, it renames , which must exist and be either a file, symlink or directory, to . In the second form, the last argument...
119, 369, 1231
command-line, git, macos
<h1>Move a file to a new folder, keeping Git history</h1> <p>I am looking to move a folder so that it resides in another folder.</p> <p>Currently: /folder1, moved to /holder/folder1, for example.</p> <p>What is the easiest way to do this both on my home machine (Mac) and git to ensure that all of the history of the ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
21,087
git
# Move a file to a new folder, keeping Git history I am looking to move a folder so that it resides in another folder. Currently: /folder1, moved to /holder/folder1, for example. What is the easiest way to do this both on my home machine (Mac) and git to ensure that all of the history of the files within that folder...
From git documentation, ``` git mv [-f] [-n] <source> <destination> git mv [-f] [-n] [-k] <source> ... <destination directory> ``` In the first form, it renames , which must exist and be either a file, symlink or directory, to . In the second form, the last argument has to be an existing directory; the given sources ...
3003554
Is there any way to get the SHA of a commit from its message?
13
2010-06-09 06:35:56
<p>When doing a <code>git tag</code>, I'm not always great at remembering if HEAD~6 (for example) is inclusive or exclusive. </p> <p>Given that most of my commits are prefixed with an issue number, I wondered if there is some magic command for searching for the commit SHA from part of its message.</p> <p><em>I know i...
5,117
11,410
2014-06-24 14:17:27
3,003,616
18
2010-06-09 06:48:30
19,563
2010-06-09 08:29:07
https://stackoverflow.com/q/3003554
https://stackoverflow.com/a/3003616
<p>You can use <code>:/blah</code> syntax to specify a commit whose commit message starts with the given text.</p> <p>E.g.</p> <pre><code>git show ":/Issue #299" </code></pre> <p>This is valid anywhere a commit can be used. E.g.</p> <pre><code>git cherry-pick ":/Issue #299" </code></pre> <p>If you actually need th...
<p>You can use <code>:/blah</code> syntax to specify a commit whose commit message starts with the given text.</p> <p>E.g.</p> <pre><code>git show ":/Issue #299" </code></pre> <p>This is valid anywhere a commit can be used. E.g.</p> <pre><code>git cherry-pick ":/Issue #299" </code></pre> <p>If you actually need th...
119
git
<h1>Is there any way to get the SHA of a commit from its message?</h1> <p>When doing a <code>git tag</code>, I'm not always great at remembering if HEAD~6 (for example) is inclusive or exclusive. </p> <p>Given that most of my commits are prefixed with an issue number, I wondered if there is some magic command for sear...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
21,088
git
# Is there any way to get the SHA of a commit from its message? When doing a `git tag`, I'm not always great at remembering if HEAD~6 (for example) is inclusive or exclusive. Given that most of my commits are prefixed with an issue number, I wondered if there is some magic command for searching for the commit SHA fro...
You can use `:/blah` syntax to specify a commit whose commit message starts with the given text. E.g. ``` git show ":/Issue #299" ``` This is valid anywhere a commit can be used. E.g. ``` git cherry-pick ":/Issue #299" ``` If you actually need the SHA-1 of the commit you can just use rev-parse. ``` git rev-parse ...