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
6397898
create branch with N-last commits
23
2011-06-18 18:06:14
<p>I have cloned repository and have made some commits:</p> <pre><code>git clone ... git add git commit git add git commit git add git commit </code></pre> <p>Now I have realized that it will be better to move all my commits to another new branch. What is the best way to do it?</p>
3,853
205,270
2021-02-25 09:52:47
6,397,932
33
2011-06-18 18:11:31
112,968
2021-02-25 09:52:47
https://stackoverflow.com/q/6397898
https://stackoverflow.com/a/6397932
<p>Easy, check out your new branch, then move the old branch (let's assume <code>master</code> and 3 commits were made) back:</p> <pre><code>git checkout -b my_new_branch git branch -f master HEAD~3 </code></pre>
<p>Easy, check out your new branch, then move the old branch (let's assume <code>master</code> and 3 commits were made) back:</p> <pre><code>git checkout -b my_new_branch git branch -f master HEAD~3 </code></pre>
119
git
<h1>create branch with N-last commits</h1> <p>I have cloned repository and have made some commits:</p> <pre><code>git clone ... git add git commit git add git commit git add git commit </code></pre> <p>Now I have realized that it will be better to move all my commits to another new branch. What is the best way to d...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,672
git
# create branch with N-last commits I have cloned repository and have made some commits: ``` git clone ... git add git commit git add git commit git add git commit ``` Now I have realized that it will be better to move all my commits to another new branch. What is the best way to do it?
Easy, check out your new branch, then move the old branch (let's assume `master` and 3 commits were made) back: ``` git checkout -b my_new_branch git branch -f master HEAD~3 ```
2540505
How to go back to the last commit in the history after I used git reset to go to an older changeset?
23
2010-03-29 19:00:53
<p>Suppose my history goes that way :</p> <p>A - B - C - D (master)</p> <p>If I do <code>git reset B</code>, I'll got :</p> <p>A - B (master)</p> <p>Trouble is, <code>git log</code> now show me only the history from A to B, and I can't see C and D anymore.</p> <p>How can I go back to D ?</p>
11,357
9,951
2010-03-29 19:26:21
2,540,528
33
2010-03-29 19:03:56
6,309
2010-03-29 19:03:56
https://stackoverflow.com/q/2540505
https://stackoverflow.com/a/2540528
<p>You should be able to see D with <a href="http://www.kernel.org/pub/software/scm/git/docs/git-reflog.html" rel="noreferrer"><code>git reflog</code></a>.</p> <p>See this <a href="http://gitfu.wordpress.com/2008/04/06/git-reflog-no-commits-left-behind/" rel="noreferrer">article for instance</a>.</p> <blockquote> <...
<p>You should be able to see D with <a href="http://www.kernel.org/pub/software/scm/git/docs/git-reflog.html" rel="noreferrer"><code>git reflog</code></a>.</p> <p>See this <a href="http://gitfu.wordpress.com/2008/04/06/git-reflog-no-commits-left-behind/" rel="noreferrer">article for instance</a>.</p> <blockquote> <...
119, 51381
git, git-reset
<h1>How to go back to the last commit in the history after I used git reset to go to an older changeset?</h1> <p>Suppose my history goes that way :</p> <p>A - B - C - D (master)</p> <p>If I do <code>git reset B</code>, I'll got :</p> <p>A - B (master)</p> <p>Trouble is, <code>git log</code> now show me only the his...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,673
git
# How to go back to the last commit in the history after I used git reset to go to an older changeset? Suppose my history goes that way : A - B - C - D (master) If I do `git reset B`, I'll got : A - B (master) Trouble is, `git log` now show me only the history from A to B, and I can't see C and D anymore. How can...
You should be able to see D with [`git reflog`](http://www.kernel.org/pub/software/scm/git/docs/git-reflog.html). See this [article for instance](http://gitfu.wordpress.com/2008/04/06/git-reflog-no-commits-left-behind/). > The only time commits are actually deleted is if you git gc --prune (so be careful with that on...
37347350
git patches cause error unrecognized input
22
2016-05-20 12:56:07
<p>I'm running Mac OSX 10.9.4 (Mavericks) and have git version 2.8.2. I've tested this with a completely new repo. Here's example.</p> <pre><code>mkdir gitest cd gitest git init echo "monkeyface" &gt; monkey.txt git commit -m "first commit" echo "monkeyface farted" &gt; monkeyfart.txt git add . git diff HEAD &gt; new...
36,411
3,625,433
2021-12-16 08:36:37
37,349,029
33
2016-05-20 14:15:12
3,625,433
2021-10-26 15:27:51
https://stackoverflow.com/q/37347350
https://stackoverflow.com/a/37349029
<h3>Updated</h3> <p>First thing is to ignore color when creating the patch</p> <pre><code>git diff --no-color &gt; my_patch.patch </code></pre> <p>You might have a file which was not encoded to UTF-8. To fix that on *nix systems (MacOS, Linux etc.)</p> <pre><code>iconv -f ascii -t utf-8 fix.patch -o fix_utf8.patch </co...
<h3>Updated</h3> <p>First thing is to ignore color when creating the patch</p> <pre><code>git diff --no-color &gt; my_patch.patch </code></pre> <p>You might have a file which was not encoded to UTF-8. To fix that on *nix systems (MacOS, Linux etc.)</p> <pre><code>iconv -f ascii -t utf-8 fix.patch -o fix_utf8.patch </co...
119, 92978
git, osx-mavericks
<h1>git patches cause error unrecognized input</h1> <p>I'm running Mac OSX 10.9.4 (Mavericks) and have git version 2.8.2. I've tested this with a completely new repo. Here's example.</p> <pre><code>mkdir gitest cd gitest git init echo "monkeyface" &gt; monkey.txt git commit -m "first commit" echo "monkeyface farted" ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,675
git
# git patches cause error unrecognized input I'm running Mac OSX 10.9.4 (Mavericks) and have git version 2.8.2. I've tested this with a completely new repo. Here's example. ``` mkdir gitest cd gitest git init echo "monkeyface" > monkey.txt git commit -m "first commit" echo "monkeyface farted" > monkeyfart.txt git add...
### Updated First thing is to ignore color when creating the patch ``` git diff --no-color > my_patch.patch ``` You might have a file which was not encoded to UTF-8. To fix that on *nix systems (MacOS, Linux etc.) ``` iconv -f ascii -t utf-8 fix.patch -o fix_utf8.patch ``` For windows you can try: ``` Get-Content...
23263499
Jumping between changed lines in VIM with fugitive
22
2014-04-24 08:18:15
<p>I have a huge file where I modified several lines, and saved it. The fugitive knows which lines are modified, and it would be very useful to just jump between them. Is there an existing hotkey for that, or can I map it somehow?</p>
10,133
312,725
2014-04-24 11:33:56
23,264,316
33
2014-04-24 08:59:08
813,602
2014-04-24 09:54:26
https://stackoverflow.com/q/23263499
https://stackoverflow.com/a/23264316
<p>If you mean you've done a <code>:Gdiff</code> to another revision or the index, you can use the built-in <code>]c</code> and <code>[c</code> motions to jump to the next / previous start of a change, as Vim shows the changes in <code>'diff'</code> mode.</p> <p>Edit: Have a look at the <a href="https://github.com/air...
<p>If you mean you've done a <code>:Gdiff</code> to another revision or the index, you can use the built-in <code>]c</code> and <code>[c</code> motions to jump to the next / previous start of a change, as Vim shows the changes in <code>'diff'</code> mode.</p> <p>Edit: Have a look at the <a href="https://github.com/air...
370, 88389
vim, vim-fugitive
<h1>Jumping between changed lines in VIM with fugitive</h1> <p>I have a huge file where I modified several lines, and saved it. The fugitive knows which lines are modified, and it would be very useful to just jump between them. Is there an existing hotkey for that, or can I map it somehow?</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,676
git
# Jumping between changed lines in VIM with fugitive I have a huge file where I modified several lines, and saved it. The fugitive knows which lines are modified, and it would be very useful to just jump between them. Is there an existing hotkey for that, or can I map it somehow?
If you mean you've done a `:Gdiff` to another revision or the index, you can use the built-in `]c` and `[c` motions to jump to the next / previous start of a change, as Vim shows the changes in `'diff'` mode. Edit: Have a look at the [gitgutter](https://github.com/airblade/vim-gitgutter) plugin; it shows the changes i...
24691300
Git Sparse Checkout Leaves No Entry on Working Directory
21
2014-07-11 06:23:54
<p>I am trying to use sparse-checkout to just check-out a directory from a BitBucket repository, but getting a "Sparse checkout leaves no entry on working directory" error when I try to pull.</p> <p>The BitBucket repository has the following directory structure:</p> <ul> <li>SomeProjectRepo <ul> <li>JohnsProject</li...
36,027
1,055,373
2022-09-13 15:33:13
24,771,946
33
2014-07-16 03:54:22
1,055,373
2016-03-23 17:55:35
https://stackoverflow.com/q/24691300
https://stackoverflow.com/a/24771946
<p>OK, I got this working. As I expected it was not working because of step 5.</p> <p>The line below works now:</p> <pre><code>echo "MyProject/*"&gt; .git/info/sparse-checkout </code></pre> <p>The important thing is to use <code>/</code>, use <code>*</code> and leave no space at the end of the directory.</p> <p>The...
<p>OK, I got this working. As I expected it was not working because of step 5.</p> <p>The line below works now:</p> <pre><code>echo "MyProject/*"&gt; .git/info/sparse-checkout </code></pre> <p>The important thing is to use <code>/</code>, use <code>*</code> and leave no space at the end of the directory.</p> <p>The...
119, 8337
bitbucket, git
<h1>Git Sparse Checkout Leaves No Entry on Working Directory</h1> <p>I am trying to use sparse-checkout to just check-out a directory from a BitBucket repository, but getting a "Sparse checkout leaves no entry on working directory" error when I try to pull.</p> <p>The BitBucket repository has the following directory s...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,678
git
# Git Sparse Checkout Leaves No Entry on Working Directory I am trying to use sparse-checkout to just check-out a directory from a BitBucket repository, but getting a "Sparse checkout leaves no entry on working directory" error when I try to pull. The BitBucket repository has the following directory structure: - Som...
OK, I got this working. As I expected it was not working because of step 5. The line below works now: ``` echo "MyProject/*"> .git/info/sparse-checkout ``` The important thing is to use `/`, use `*` and leave no space at the end of the directory. Then you may pull again or checkout the branch (`git checkout master`...
2517332
How to pull a specific file with GIT?
20
2010-03-25 16:25:11
<p>Say you just want to get rid of the changes you've made to one file, and get back to whatever is in the repository. I used to do this in svn:</p> <pre><code>rm a-file.txt svn update a-file.txt </code></pre> <p>What is the equivalent in Git? I know how to fetch/pull <em>evrything</em> from the repository, but how a...
34,303
301,866
2010-03-25 16:35:10
2,517,353
33
2010-03-25 16:27:39
119,159
2010-03-25 16:34:27
https://stackoverflow.com/q/2517332
https://stackoverflow.com/a/2517353
<p>To undo your (uncommitted) changes:</p> <pre><code>git checkout a-file.txt </code></pre> <p>If you have committed changes and want to undo them back to a certain previous commit:</p> <pre><code>git checkout [some-older-commit-ref] a-file.txt </code></pre> <p>Btw, with Subversion you should have done:</p> <pre><...
<p>To undo your (uncommitted) changes:</p> <pre><code>git checkout a-file.txt </code></pre> <p>If you have committed changes and want to undo them back to a certain previous commit:</p> <pre><code>git checkout [some-older-commit-ref] a-file.txt </code></pre> <p>Btw, with Subversion you should have done:</p> <pre><...
119
git
<h1>How to pull a specific file with GIT?</h1> <p>Say you just want to get rid of the changes you've made to one file, and get back to whatever is in the repository. I used to do this in svn:</p> <pre><code>rm a-file.txt svn update a-file.txt </code></pre> <p>What is the equivalent in Git? I know how to fetch/pull <e...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,681
git
# How to pull a specific file with GIT? Say you just want to get rid of the changes you've made to one file, and get back to whatever is in the repository. I used to do this in svn: ``` rm a-file.txt svn update a-file.txt ``` What is the equivalent in Git? I know how to fetch/pull *evrything* from the repository, bu...
To undo your (uncommitted) changes: ``` git checkout a-file.txt ``` If you have committed changes and want to undo them back to a certain previous commit: ``` git checkout [some-older-commit-ref] a-file.txt ``` Btw, with Subversion you should have done: ``` svn revert a-file.txt ```
54367011
git bare repositories, worktrees and tracking branches
19
2019-01-25 14:13:40
<p>I'm working with a code base where I need to be working on several branches at once for different purposes. So I clone to a bare repository and then set up some worktrees:</p> <pre><code>git clone --bare ssh://git@git.example.com/project/repo repo.git cd repo.git git worktree add ../branch-1 branch-1 git worktree ...
19,928
274,460
2025-11-07 15:55:19
54,408,181
33
2019-01-28 18:29:57
1,256,452
2022-12-10 09:11:42
https://stackoverflow.com/q/54367011
https://stackoverflow.com/a/54408181
<p>First, a side note: if you are going to use <code>git worktree add</code> for nontrival periods (more than two weeks at a time), be sure your Git is at least version 2.15.<sup>1</sup></p> <p>For your particular purpose I'd recommend <em>not</em> using <code>git clone --bare</code>. Instead, use a regular clone, fol...
<p>First, a side note: if you are going to use <code>git worktree add</code> for nontrival periods (more than two weeks at a time), be sure your Git is at least version 2.15.<sup>1</sup></p> <p>For your particular purpose I'd recommend <em>not</em> using <code>git clone --bare</code>. Instead, use a regular clone, fol...
119, 64465, 76220, 117020
git, git-bare, git-branch, git-worktree
<h1>git bare repositories, worktrees and tracking branches</h1> <p>I'm working with a code base where I need to be working on several branches at once for different purposes. So I clone to a bare repository and then set up some worktrees:</p> <pre><code>git clone --bare ssh://git@git.example.com/project/repo repo.git...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,682
git
# git bare repositories, worktrees and tracking branches I'm working with a code base where I need to be working on several branches at once for different purposes. So I clone to a bare repository and then set up some worktrees: ``` git clone --bare ssh://git@git.example.com/project/repo repo.git cd repo.git git work...
First, a side note: if you are going to use `git worktree add` for nontrival periods (more than two weeks at a time), be sure your Git is at least version 2.15.1 For your particular purpose I'd recommend *not* using `git clone --bare`. Instead, use a regular clone, followed by the `git worktree add`s that you intend t...
11069020
Git Commit Author's Email changing according to the directory and/or project?
18
2012-06-17 05:00:16
<p>I work with my own projects and every-now-and-then I do some work for third-parties where I need to use their contact-information etc in commits. I usually use just global commit names etc but now I need to specify commit names and emails according to the directory. How can I do that in Git?</p> <blockquote> <p><...
4,622
164,148
2018-02-20 12:58:32
11,069,279
33
2012-06-17 06:00:37
1,301,972
2015-06-22 14:38:06
https://stackoverflow.com/q/11069020
https://stackoverflow.com/a/11069279
<p>You can have a per-repository username and email address that supercedes your global settings. It will affect commits made in the current repository, but not in other repositories.</p> <pre><code>git config user.name "Foo Bar" git config user.email "foo.bar@example.com" </code></pre> <p>You can confirm that your l...
<p>You can have a per-repository username and email address that supercedes your global settings. It will affect commits made in the current repository, but not in other repositories.</p> <pre><code>git config user.name "Foo Bar" git config user.email "foo.bar@example.com" </code></pre> <p>You can confirm that your l...
119
git
<h1>Git Commit Author's Email changing according to the directory and/or project?</h1> <p>I work with my own projects and every-now-and-then I do some work for third-parties where I need to use their contact-information etc in commits. I usually use just global commit names etc but now I need to specify commit names an...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,686
git
# Git Commit Author's Email changing according to the directory and/or project? I work with my own projects and every-now-and-then I do some work for third-parties where I need to use their contact-information etc in commits. I usually use just global commit names etc but now I need to specify commit names and emails ...
You can have a per-repository username and email address that supercedes your global settings. It will affect commits made in the current repository, but not in other repositories. ``` git config user.name "Foo Bar" git config user.email "foo.bar@example.com" ``` You can confirm that your local information is overrid...
19638292
git flow - how to start working on existing feature branch
17
2013-10-28 15:06:07
<p>I would like to start working on another developer's feature branch (we use git and git flow). AFAIK The branch has been published (pushed). How can I get it to my local repository?</p> <p>I tried:</p> <pre><code>git flow feature pull origin/XXXXXX-1003b fatal: 'origin/XXXXXX-1003b' does not appear to be a git re...
16,181
1,607,660
2016-08-25 15:23:44
19,638,411
33
2013-10-28 15:10:27
761,202
2013-10-28 15:10:27
https://stackoverflow.com/q/19638292
https://stackoverflow.com/a/19638411
<h2>git flow feature track</h2> <p>To track an existing feature branch on a remote, use <code>feature track</code>:</p> <pre><code>git flow feature track xxxxxx-1003b </code></pre> <p>Alternatively just do it &quot;the normal way&quot;:</p> <pre><code>git fetch origin git branch -a # list all branches git checkout feat...
<h2>git flow feature track</h2> <p>To track an existing feature branch on a remote, use <code>feature track</code>:</p> <pre><code>git flow feature track xxxxxx-1003b </code></pre> <p>Alternatively just do it &quot;the normal way&quot;:</p> <pre><code>git fetch origin git branch -a # list all branches git checkout feat...
119, 64339
git, git-flow
<h1>git flow - how to start working on existing feature branch</h1> <p>I would like to start working on another developer's feature branch (we use git and git flow). AFAIK The branch has been published (pushed). How can I get it to my local repository?</p> <p>I tried:</p> <pre><code>git flow feature pull origin/XXXXX...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,688
git
# git flow - how to start working on existing feature branch I would like to start working on another developer's feature branch (we use git and git flow). AFAIK The branch has been published (pushed). How can I get it to my local repository? I tried: ``` git flow feature pull origin/XXXXXX-1003b fatal: 'origin/XXX...
## git flow feature track To track an existing feature branch on a remote, use `feature track`: ``` git flow feature track xxxxxx-1003b ``` Alternatively just do it "the normal way": ``` git fetch origin git branch -a # list all branches git checkout feature/xxxxxx-1003b ``` I.e. update the remote origin, and then...
20568971
git pull: keeps telling me to stash local changes before pulling
16
2013-12-13 14:33:18
<p>When I am trying to pull my git repository with "git pull", it keeps telling me that I have local changes although I have not touched any of the mentioned files. Can someone explain this behavior and knows a solution?</p> <p>git status:</p> <pre><code> # On branch master # Your branch is behind 'origin/master' ...
41,263
2,267,304
2021-10-08 19:46:47
20,569,627
33
2013-12-13 15:06:29
1,029,521
2013-12-13 15:06:29
https://stackoverflow.com/q/20568971
https://stackoverflow.com/a/20569627
<p>It sounds like your local branch does not have all of the changes on <code>origin</code>. </p> <p>Firstly, stash your changes</p> <pre><code>git stash </code></pre> <p>Then, pull in the changes from <code>origin</code>.</p> <pre><code>git fetch origin &amp;&amp; git rebase origin/(branch name) </code></pre> <p>...
<p>It sounds like your local branch does not have all of the changes on <code>origin</code>. </p> <p>Firstly, stash your changes</p> <pre><code>git stash </code></pre> <p>Then, pull in the changes from <code>origin</code>.</p> <pre><code>git fetch origin &amp;&amp; git rebase origin/(branch name) </code></pre> <p>...
119, 28896, 28897
git, git-merge, git-pull
<h1>git pull: keeps telling me to stash local changes before pulling</h1> <p>When I am trying to pull my git repository with "git pull", it keeps telling me that I have local changes although I have not touched any of the mentioned files. Can someone explain this behavior and knows a solution?</p> <p>git status:</p> ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,691
git
# git pull: keeps telling me to stash local changes before pulling When I am trying to pull my git repository with "git pull", it keeps telling me that I have local changes although I have not touched any of the mentioned files. Can someone explain this behavior and knows a solution? git status: ``` # On branch ...
It sounds like your local branch does not have all of the changes on `origin`. Firstly, stash your changes ``` git stash ``` Then, pull in the changes from `origin`. ``` git fetch origin && git rebase origin/(branch name) ``` Next, add the stash back in to your working directory: ``` git stash pop ```
19151940
git remove trailing whitespace in new files before commit
16
2013-10-03 06:05:42
<p>I know removing trailing whitespace can be done with a pre-commit hook. I am interested in doing it manually. I read the question here:<br> <a href="https://stackoverflow.com/questions/591923/make-git-automatically-remove-trailing-whitespace-before-committing">Make git automatically remove trailing whitespace before...
25,731
4,704,515
2014-03-06 00:14:15
19,156,679
33
2013-10-03 10:22:00
932,359
2013-10-03 10:22:00
https://stackoverflow.com/q/19151940
https://stackoverflow.com/a/19156679
<p>To manually clean up whitespace from your last 3 commits, you can do this:</p> <p><code>git rebase --whitespace=fix HEAD~3</code></p> <p>When I work on a topic branch, I track the upstream branch (usually by creating it like this)</p> <p><code>git checkout -b topic -t</code></p> <p>Which allows me to drop the la...
<p>To manually clean up whitespace from your last 3 commits, you can do this:</p> <p><code>git rebase --whitespace=fix HEAD~3</code></p> <p>When I work on a topic branch, I track the upstream branch (usually by creating it like this)</p> <p><code>git checkout -b topic -t</code></p> <p>Which allows me to drop the la...
119, 1084, 57198
git, removing-whitespace, whitespace
<h1>git remove trailing whitespace in new files before commit</h1> <p>I know removing trailing whitespace can be done with a pre-commit hook. I am interested in doing it manually. I read the question here:<br> <a href="https://stackoverflow.com/questions/591923/make-git-automatically-remove-trailing-whitespace-before-c...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,692
git
# git remove trailing whitespace in new files before commit I know removing trailing whitespace can be done with a pre-commit hook. I am interested in doing it manually. I read the question here: [Make git automatically remove trailing whitespace before committing - Stack Overflow](https://stackoverflow.com/question...
To manually clean up whitespace from your last 3 commits, you can do this: `git rebase --whitespace=fix HEAD~3` When I work on a topic branch, I track the upstream branch (usually by creating it like this) `git checkout -b topic -t` Which allows me to drop the last argument from `git rebase`. So once I'm done & rea...
5861280
.gitignore /folder vs folder/
15
2011-05-02 19:04:35
<p>in .gitignore what is the difference between using</p> <pre><code>/bin </code></pre> <p>and</p> <pre><code>bin/ </code></pre> <p>And how would I make it so that it removes a certain file, no matter where it is?</p> <pre><code>*/*.ext </code></pre>
6,965
724,569
2020-02-12 22:08:43
5,861,411
33
2011-05-02 19:17:03
19,563
2011-05-02 19:17:03
https://stackoverflow.com/q/5861280
https://stackoverflow.com/a/5861411
<p>A leading <code>/</code> anchors the ignore pattern at the point in the tree where the particular <code>.gitignore</code> resides.</p> <p>A trailing <code>/</code> means that a pattern will only match a directory (and so all the files in that matching directory).</p> <p>You can have both, e.g. <code>/bin/</code> w...
<p>A leading <code>/</code> anchors the ignore pattern at the point in the tree where the particular <code>.gitignore</code> resides.</p> <p>A trailing <code>/</code> means that a pattern will only match a directory (and so all the files in that matching directory).</p> <p>You can have both, e.g. <code>/bin/</code> w...
119, 25056
git, gitignore
<h1>.gitignore /folder vs folder/</h1> <p>in .gitignore what is the difference between using</p> <pre><code>/bin </code></pre> <p>and</p> <pre><code>bin/ </code></pre> <p>And how would I make it so that it removes a certain file, no matter where it is?</p> <pre><code>*/*.ext </code></pre>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,693
git
# .gitignore /folder vs folder/ in .gitignore what is the difference between using ``` /bin ``` and ``` bin/ ``` And how would I make it so that it removes a certain file, no matter where it is? ``` */*.ext ```
A leading `/` anchors the ignore pattern at the point in the tree where the particular `.gitignore` resides. A trailing `/` means that a pattern will only match a directory (and so all the files in that matching directory). You can have both, e.g. `/bin/` will match only a directory called `bin` and only at the level...
37503999
Restore deleted files from commit
14
2016-05-28 21:45:40
<p>I've just done the following series of steps and I don't know how to recover my files.</p> <ol> <li>git add file.txt</li> <li>git commit -m "Message"</li> <li>rm file.txt</li> <li>git commit -am "Message"</li> </ol> <p>Ideally I should have pushed my changes after step 2 and then delete but I forgot. Is there a wa...
14,479
5,837,121
2021-02-17 11:36:15
37,504,063
33
2016-05-28 21:54:51
641,955
2021-02-17 11:36:15
https://stackoverflow.com/q/37503999
https://stackoverflow.com/a/37504063
<p>You can recover the file from the previous revision with the <code>checkout</code> command:</p> <pre><code>git checkout HEAD^ file.txt </code></pre> <p>If the file has been deleted in an earlier commit (let's assume <code>229da640</code>), you can recover it by passing commit's sha1, followed by <code>^</code>:</p> ...
<p>You can recover the file from the previous revision with the <code>checkout</code> command:</p> <pre><code>git checkout HEAD^ file.txt </code></pre> <p>If the file has been deleted in an earlier commit (let's assume <code>229da640</code>), you can recover it by passing commit's sha1, followed by <code>^</code>:</p> ...
119, 5377, 5597
commit, git, restore
<h1>Restore deleted files from commit</h1> <p>I've just done the following series of steps and I don't know how to recover my files.</p> <ol> <li>git add file.txt</li> <li>git commit -m "Message"</li> <li>rm file.txt</li> <li>git commit -am "Message"</li> </ol> <p>Ideally I should have pushed my changes after step 2 ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,695
git
# Restore deleted files from commit I've just done the following series of steps and I don't know how to recover my files. 1. git add file.txt 2. git commit -m "Message" 3. rm file.txt 4. git commit -am "Message" Ideally I should have pushed my changes after step 2 and then delete but I forgot. Is there a way to rec...
You can recover the file from the previous revision with the `checkout` command: ``` git checkout HEAD^ file.txt ``` If the file has been deleted in an earlier commit (let's assume `229da640`), you can recover it by passing commit's sha1, followed by `^`: ``` git checkout 229da640^ file.txt ``` If you haven't pushe...
7784951
How to begin committing via git to bitbucket - Not seeing changes
11
2011-10-16 14:37:03
<p>Perhaps I am going about this wrong, but I am following git tutorials as is. I have a repository on bitbucket called "testrepos" and I am trying to work with it.</p> <p>First, I clone it with <code>git clone https://my_username@bitbucket.org/my_username/testrepos.git</code></p> <p>Now, the repo is empty, so I mad...
18,140
null
2014-06-20 03:03:46
7,789,793
33
2011-10-17 05:43:41
223,092
2011-10-17 05:43:41
https://stackoverflow.com/q/7784951
https://stackoverflow.com/a/7789793
<p>You really do need to do <code>git push origin master</code>, rather than just <code>git push</code>. This is because the default behaviour of <code>git push</code> is to push each branch to one with the same name on the remote side, <em>so long as a remote branch with that name exists</em>. In this case, your Bit...
<p>You really do need to do <code>git push origin master</code>, rather than just <code>git push</code>. This is because the default behaviour of <code>git push</code> is to push each branch to one with the same name on the remote side, <em>so long as a remote branch with that name exists</em>. In this case, your Bit...
119, 456
git, version-control
<h1>How to begin committing via git to bitbucket - Not seeing changes</h1> <p>Perhaps I am going about this wrong, but I am following git tutorials as is. I have a repository on bitbucket called "testrepos" and I am trying to work with it.</p> <p>First, I clone it with <code>git clone https://my_username@bitbucket.or...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,698
git
# How to begin committing via git to bitbucket - Not seeing changes Perhaps I am going about this wrong, but I am following git tutorials as is. I have a repository on bitbucket called "testrepos" and I am trying to work with it. First, I clone it with `git clone https://my_username@bitbucket.org/my_username/testrepo...
You really do need to do `git push origin master`, rather than just `git push`. This is because the default behaviour of `git push` is to push each branch to one with the same name on the remote side, *so long as a remote branch with that name exists*. In this case, your BitBucket repository is completely empty (withou...
55887655
How to delete git repository(laravel project) on visual studio code
10
2019-04-28 06:34:43
<p>I have small laravel project that committed to git. Then I successfully deleted a remote repository by manually(Setting -> Delete this repository), it work fine. But once I try to make new repository on vs code, then I got </p> <pre><code>$ git init Reinitialized existing Git repository in C:/xampp/htdocs/uploadcan...
97,690
11,258,651
2023-08-17 07:17:28
55,887,961
33
2019-04-28 07:19:15
5,010,984
2019-04-28 07:27:37
https://stackoverflow.com/q/55887655
https://stackoverflow.com/a/55887961
<p>I think you can delete <code>.git</code> folder.</p>
<p>I think you can delete <code>.git</code> folder.</p>
119, 75151
git, laravel
<h1>How to delete git repository(laravel project) on visual studio code</h1> <p>I have small laravel project that committed to git. Then I successfully deleted a remote repository by manually(Setting -> Delete this repository), it work fine. But once I try to make new repository on vs code, then I got </p> <pre><code>...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,699
git
# How to delete git repository(laravel project) on visual studio code I have small laravel project that committed to git. Then I successfully deleted a remote repository by manually(Setting -> Delete this repository), it work fine. But once I try to make new repository on vs code, then I got ``` $ git init Reinitiali...
I think you can delete `.git` folder.
31383149
How to ignore files ending with ~ in git?
10
2015-07-13 12:14:41
<p>In git-status, I have</p> <pre><code>sandbox.sh sandbox.sh~ </code></pre> <p>I would like to ignore the latter file. </p> <p>How can you ignore files with extension of some snake ~?</p>
16,421
54,964
2015-07-13 16:32:06
31,383,190
33
2015-07-13 12:16:35
1,587,370
2015-07-13 12:16:35
https://stackoverflow.com/q/31383149
https://stackoverflow.com/a/31383190
<p>Just add <code>*~</code> to your <code>.gitignore</code>.</p> <p>This will ignore all the files ending with <code>~</code></p>
<p>Just add <code>*~</code> to your <code>.gitignore</code>.</p> <p>This will ignore all the files ending with <code>~</code></p>
119
git
<h1>How to ignore files ending with ~ in git?</h1> <p>In git-status, I have</p> <pre><code>sandbox.sh sandbox.sh~ </code></pre> <p>I would like to ignore the latter file. </p> <p>How can you ignore files with extension of some snake ~?</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,700
git
# How to ignore files ending with ~ in git? In git-status, I have ``` sandbox.sh sandbox.sh~ ``` I would like to ignore the latter file. How can you ignore files with extension of some snake ~?
Just add `*~` to your `.gitignore`. This will ignore all the files ending with `~`
33944258
Bitbucket git push ssh "conq: invalid repository syntax."
9
2015-11-26 17:26:49
<p><strong>I cannot <code>git push</code> to my Bitbucket</strong> for some reasons. It used to work but it do not work anymore and I can't figure why.</p> <pre><code>$ git push ssh://git@bitbucket.org:MyUser/MyGit.git conq: invalid repository syntax. fatal: Could not read from remote repository. Please make sure you...
2,718
1,549,310
2017-05-03 15:57:20
33,946,292
33
2015-11-26 20:08:25
1,549,310
2016-04-12 01:31:17
https://stackoverflow.com/q/33944258
https://stackoverflow.com/a/33946292
<p>This is incorrect</p> <pre><code>$ git push ssh://git@bitbucket.org:MyUser/MyGit.git </code></pre> <p><strong>This is correct</strong></p> <pre><code>$ git push ssh://git@bitbucket.org/MyUser/MyGit.git </code></pre>
<p>This is incorrect</p> <pre><code>$ git push ssh://git@bitbucket.org:MyUser/MyGit.git </code></pre> <p><strong>This is correct</strong></p> <pre><code>$ git push ssh://git@bitbucket.org/MyUser/MyGit.git </code></pre>
119, 386, 8337
bitbucket, git, ssh
<h1>Bitbucket git push ssh "conq: invalid repository syntax."</h1> <p><strong>I cannot <code>git push</code> to my Bitbucket</strong> for some reasons. It used to work but it do not work anymore and I can't figure why.</p> <pre><code>$ git push ssh://git@bitbucket.org:MyUser/MyGit.git conq: invalid repository syntax. ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,701
git
# Bitbucket git push ssh "conq: invalid repository syntax." **I cannot `git push` to my Bitbucket** for some reasons. It used to work but it do not work anymore and I can't figure why. ``` $ git push ssh://git@bitbucket.org:MyUser/MyGit.git conq: invalid repository syntax. fatal: Could not read from remote repository...
This is incorrect ``` $ git push ssh://git@bitbucket.org:MyUser/MyGit.git ``` **This is correct** ``` $ git push ssh://git@bitbucket.org/MyUser/MyGit.git ```
34748475
Git clone error "HTTP code 504 from proxy after CONNECT"
7
2016-01-12 16:09:43
<p>I'm working in a office behind a corporate firewall. My System is windows7, using componentes consola. Usually I need to set up proxy connections to get GIT working with github.</p> <p>But when I try to clone a repository sored in a private Stash (Atlassian) I get this error:</p> <pre><code>Cloning into 'apptest'...
61,716
3,518,053
2020-01-22 18:17:12
34,748,763
33
2016-01-12 16:23:24
3,518,053
2018-07-04 14:12:38
https://stackoverflow.com/q/34748475
https://stackoverflow.com/a/34748763
<p>Problem solved. </p> <p><strong>Windows</strong>: Before connecting <strong>Bitbucket</strong> (AKA <strong>stash</strong>) you need to clean all proxies from both Git and console environment:</p> <pre><code>SET HTTP_PROXY= SET HTTPS_PROXY= git config --global --unset http.proxy git config --global --unset https.p...
<p>Problem solved. </p> <p><strong>Windows</strong>: Before connecting <strong>Bitbucket</strong> (AKA <strong>stash</strong>) you need to clean all proxies from both Git and console environment:</p> <pre><code>SET HTTP_PROXY= SET HTTPS_PROXY= git config --global --unset http.proxy git config --global --unset https.p...
119, 760, 2045, 83703
bitbucket-server, firewall, git, proxy
<h1>Git clone error "HTTP code 504 from proxy after CONNECT"</h1> <p>I'm working in a office behind a corporate firewall. My System is windows7, using componentes consola. Usually I need to set up proxy connections to get GIT working with github.</p> <p>But when I try to clone a repository sored in a private Stash (A...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,702
git
# Git clone error "HTTP code 504 from proxy after CONNECT" I'm working in a office behind a corporate firewall. My System is windows7, using componentes consola. Usually I need to set up proxy connections to get GIT working with github. But when I try to clone a repository sored in a private Stash (Atlassian) I get t...
Problem solved. **Windows**: Before connecting **Bitbucket** (AKA **stash**) you need to clean all proxies from both Git and console environment: ``` SET HTTP_PROXY= SET HTTPS_PROXY= git config --global --unset http.proxy git config --global --unset https.proxy git clone http://yourUser@stashAddress:stashPort/apptest...
50254184
git submodule and fetch
6
2018-05-09 13:06:52
<p>having trouble getting my head around submodules</p> <p>They appear to be unnecessarily complicated. Normally I totally avoid them but a project has forced me into this situation</p> <p>So...</p> <p>I have a git repo on our dev server with a submodule</p> <pre><code>/myproject /.git /files .....
15,748
193,506
2022-09-11 19:28:07
50,262,494
33
2018-05-09 21:43:53
1,256,452
2022-09-11 19:28:07
https://stackoverflow.com/q/50254184
https://stackoverflow.com/a/50262494
<blockquote> <p>[Submodules] appear to be unnecessarily complicated ...</p> </blockquote> <p>Probably true. However, submodules are also <em>necessarily</em> complicated. :-) I will also note that submodule support is noticeably better in Git 2.x than it was in the bad old days of Git 1.5 or 1.6 or so, which is when ...
<blockquote> <p>[Submodules] appear to be unnecessarily complicated ...</p> </blockquote> <p>Probably true. However, submodules are also <em>necessarily</em> complicated. :-) I will also note that submodule support is noticeably better in Git 2.x than it was in the bad old days of Git 1.5 or 1.6 or so, which is when ...
119, 41612, 70964
drupal-8, git, git-submodules
<h1>git submodule and fetch</h1> <p>having trouble getting my head around submodules</p> <p>They appear to be unnecessarily complicated. Normally I totally avoid them but a project has forced me into this situation</p> <p>So...</p> <p>I have a git repo on our dev server with a submodule</p> <pre><code>/myproject ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,703
git
# git submodule and fetch having trouble getting my head around submodules They appear to be unnecessarily complicated. Normally I totally avoid them but a project has forced me into this situation So... I have a git repo on our dev server with a submodule ``` /myproject /.git /files ... ...
> [Submodules] appear to be unnecessarily complicated ... Probably true. However, submodules are also *necessarily* complicated. :-) I will also note that submodule support is noticeably better in Git 2.x than it was in the bad old days of Git 1.5 or 1.6 or so, which is when I learned why people called them *sob*-modu...
24301914
How to create a local branch from an existing remote branch?
173
2014-06-19 08:22:20
<p>I want to create a branch from an existing remote branch (let's say remote-A) and then commit the changes to the repository.</p> <p>I have used the below commands to create a local branch from the existing remote-A</p> <pre><code>$git checkout remote-A git branch master * remote-A </code></pre> <p>Now I have cre...
403,205
3,755,432
2023-02-14 17:08:09
24,302,083
32
2014-06-19 08:30:25
1,695,482
2014-06-19 08:30:25
https://stackoverflow.com/q/24301914
https://stackoverflow.com/a/24302083
<p>you want to create branch on base of remote-A, make changes on it and then push them on remote-A?</p> <pre><code>git checkout -b remote-A git pull origin remote-A git checkout -b remote-B </code></pre> <p>make changes on remote-B</p> <pre><code> git commit -a -m 'describe changes on remote-B branch' git checkou...
<p>you want to create branch on base of remote-A, make changes on it and then push them on remote-A?</p> <pre><code>git checkout -b remote-A git pull origin remote-A git checkout -b remote-B </code></pre> <p>make changes on remote-B</p> <pre><code> git commit -a -m 'describe changes on remote-B branch' git checkou...
119, 76220
git, git-branch
<h1>How to create a local branch from an existing remote branch?</h1> <p>I want to create a branch from an existing remote branch (let's say remote-A) and then commit the changes to the repository.</p> <p>I have used the below commands to create a local branch from the existing remote-A</p> <pre><code>$git checkout r...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,705
git
# How to create a local branch from an existing remote branch? I want to create a branch from an existing remote branch (let's say remote-A) and then commit the changes to the repository. I have used the below commands to create a local branch from the existing remote-A ``` $git checkout remote-A git branch master ...
you want to create branch on base of remote-A, make changes on it and then push them on remote-A? ``` git checkout -b remote-A git pull origin remote-A git checkout -b remote-B ``` make changes on remote-B ``` git commit -a -m 'describe changes on remote-B branch' git checkout remote-A git merge remote-B gi...
9898093
Where did I branch from?
106
2012-03-27 21:37:11
<p>I got back on an old project and I ran the nice <code>git status</code> to figure out what was going on and I noticed way too many branches! I want to do some housekeeping before starting to work on this again but I'm not sure which branch comes from which..</p> <p>E.G. Does "branchA" derive from "develop"? Does "b...
77,622
807,231
2022-03-08 18:07:41
9,898,110
32
2012-03-27 21:38:52
148,870
2012-03-27 21:38:52
https://stackoverflow.com/q/9898093
https://stackoverflow.com/a/9898110
<p>There's no canonical answer for this, since branches are simply pointers to certain commits in a DAG. For instance, <code>master</code> and <code>foo</code> could be pointing at the same commit; if you then create a branch from <code>foo</code>, it's effectively the same as creating a branch from <code>master</code>...
<p>There's no canonical answer for this, since branches are simply pointers to certain commits in a DAG. For instance, <code>master</code> and <code>foo</code> could be pointing at the same commit; if you then create a branch from <code>foo</code>, it's effectively the same as creating a branch from <code>master</code>...
119, 1879, 76220
branch, git, git-branch
<h1>Where did I branch from?</h1> <p>I got back on an old project and I ran the nice <code>git status</code> to figure out what was going on and I noticed way too many branches! I want to do some housekeeping before starting to work on this again but I'm not sure which branch comes from which..</p> <p>E.G. Does "branc...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,706
git
# Where did I branch from? I got back on an old project and I ran the nice `git status` to figure out what was going on and I noticed way too many branches! I want to do some housekeeping before starting to work on this again but I'm not sure which branch comes from which.. E.G. Does "branchA" derive from "develop"? ...
There's no canonical answer for this, since branches are simply pointers to certain commits in a DAG. For instance, `master` and `foo` could be pointing at the same commit; if you then create a branch from `foo`, it's effectively the same as creating a branch from `master`. That said, if you visualize the commit graph...
5129959
How do I use git-tfs and idiomatic git branching against a TFS repository?
49
2011-02-26 21:47:01
<h1>How Do I Use git-tfs Idiomatically?</h1> <ul> <li><p>The git idiom is to check out branches <em>to the root directory</em> of the repository. Checking out a branch will replace the contents of the directory with the contents of that branch.</p></li> <li><p>The TFS idiom is to check out <em>each branch in a differe...
8,962
3,619
2015-04-24 15:50:09
13,710,811
32
2012-12-04 19:53:46
222,773
2014-10-27 09:49:20
https://stackoverflow.com/q/5129959
https://stackoverflow.com/a/13710811
<p>It's now possible to get the TFS branches to be correct Git branches if cloning using <a href="https://github.com/git-tfs/git-tfs" rel="noreferrer">git-tfs</a>. This is now in the stable release! You first clone not the entire repository but the trunk :</p> <pre><code>git tfs clone http://&lt;tfsurl&gt;:8080 $/main...
<p>It's now possible to get the TFS branches to be correct Git branches if cloning using <a href="https://github.com/git-tfs/git-tfs" rel="noreferrer">git-tfs</a>. This is now in the stable release! You first clone not the entire repository but the trunk :</p> <pre><code>git tfs clone http://&lt;tfsurl&gt;:8080 $/main...
119, 733, 66446, 76220
git, git-branch, git-tfs, tfs
<h1>How do I use git-tfs and idiomatic git branching against a TFS repository?</h1> <h1>How Do I Use git-tfs Idiomatically?</h1> <ul> <li><p>The git idiom is to check out branches <em>to the root directory</em> of the repository. Checking out a branch will replace the contents of the directory with the contents of tha...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,708
git
# How do I use git-tfs and idiomatic git branching against a TFS repository? # How Do I Use git-tfs Idiomatically? - The git idiom is to check out branches *to the root directory* of the repository. Checking out a branch will replace the contents of the directory with the contents of that branch. - The TFS idiom is t...
It's now possible to get the TFS branches to be correct Git branches if cloning using [git-tfs](https://github.com/git-tfs/git-tfs). This is now in the stable release! You first clone not the entire repository but the trunk : ``` git tfs clone http://<tfsurl>:8080 $/main/trunk ``` Then you run `branch --init`, which ...
11453807
Force push current branch
48
2012-07-12 14:15:07
<p>I often rebase feature branches and then want to force push them to the server.</p> <pre><code>git push --force origin feature-mongodb-support </code></pre> <p>Is there any shortcut for <code>git push --force origin &lt;current branch&gt;</code>?</p>
67,211
773,690
2023-04-24 23:52:28
11,453,999
32
2012-07-12 14:25:41
1,065,190
2015-09-17 16:30:53
https://stackoverflow.com/q/11453807
https://stackoverflow.com/a/11453999
<p>You can use aliases to shorten the command. Use it like this:</p> <pre><code>git config --global alias.fpush "push --force origin" </code></pre> <p>Now to push your branch just type:</p> <pre><code>git fpush feature-mongodb-support </code></pre> <p>Or you can even hardcode the branch name into the command:</p> ...
<p>You can use aliases to shorten the command. Use it like this:</p> <pre><code>git config --global alias.fpush "push --force origin" </code></pre> <p>Now to push your branch just type:</p> <pre><code>git fpush feature-mongodb-support </code></pre> <p>Or you can even hardcode the branch name into the command:</p> ...
119, 28898, 79211
git, git-alias, git-push
<h1>Force push current branch</h1> <p>I often rebase feature branches and then want to force push them to the server.</p> <pre><code>git push --force origin feature-mongodb-support </code></pre> <p>Is there any shortcut for <code>git push --force origin &lt;current branch&gt;</code>?</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,709
git
# Force push current branch I often rebase feature branches and then want to force push them to the server. ``` git push --force origin feature-mongodb-support ``` Is there any shortcut for `git push --force origin <current branch>`?
You can use aliases to shorten the command. Use it like this: ``` git config --global alias.fpush "push --force origin" ``` Now to push your branch just type: ``` git fpush feature-mongodb-support ``` Or you can even hardcode the branch name into the command: ``` git alias fpush "push --force origin feature-mongod...
1634115
What's the difference between git reset --hard and git reset --merge
47
2009-10-27 22:48:53
<p>In my experiments I haven't been able to find any functional difference between</p> <pre><code>git reset --hard </code></pre> <p>and</p> <pre><code>git reset --merge </code></pre> <p>The usage instructions don't give any hint either</p> <pre><code>--hard reset HEAD, index and working tree --merge...
71,530
162,337
2022-02-22 16:31:32
1,634,204
32
2009-10-27 23:08:08
46,058
2009-10-27 23:08:08
https://stackoverflow.com/q/1634115
https://stackoverflow.com/a/1634204
<p>From <a href="http://git-scm.com/docs/git-reset" rel="noreferrer">git reset manpage</a>:</p> <pre> --hard Matches the working tree and index to that of the tree being switched to. Any changes to tracked files in the working tree since &lt;commit&gt; are lost. --merge ...
<p>From <a href="http://git-scm.com/docs/git-reset" rel="noreferrer">git reset manpage</a>:</p> <pre> --hard Matches the working tree and index to that of the tree being switched to. Any changes to tracked files in the working tree since &lt;commit&gt; are lost. --merge ...
119, 717, 12626
git, merge, reset
<h1>What's the difference between git reset --hard and git reset --merge</h1> <p>In my experiments I haven't been able to find any functional difference between</p> <pre><code>git reset --hard </code></pre> <p>and</p> <pre><code>git reset --merge </code></pre> <p>The usage instructions don't give any hint either</p...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,711
git
# What's the difference between git reset --hard and git reset --merge In my experiments I haven't been able to find any functional difference between ``` git reset --hard ``` and ``` git reset --merge ``` The usage instructions don't give any hint either ``` --hard reset HEAD, index and working tr...
From [git reset manpage](http://git-scm.com/docs/git-reset): ``` --hard Matches the working tree and index to that of the tree being switched to. Any changes to tracked files in the working tree since <commit> are lost. --merge Resets the index to match the tree recorde...
12192526
Are merges in Git symmetric?
45
2012-08-30 08:08:13
<p>Lets say we have two branches (<strong>B</strong> and <strong>C</strong>) that have diverged from a common ancestor <strong>A</strong>. Will merging from <strong>B</strong> to <strong>C</strong> produce the same result as merging from <strong>C</strong> to <strong>B</strong>?</p> <pre><code> A | / \ B C </cod...
5,531
150,992
2022-04-01 10:02:13
12,198,219
32
2012-08-30 13:39:32
877,115
2020-04-28 06:07:18
https://stackoverflow.com/q/12192526
https://stackoverflow.com/a/12198219
<p>The answer is yes for default merges. A three-way merge finds a common ancestor and then applies the differences from both sides, an operation that isn't order dependent. The topic of merge-ordering and commutativity generated a fascinating discussion on the <a href="http://thread.gmane.org/gmane.comp.version-contro...
<p>The answer is yes for default merges. A three-way merge finds a common ancestor and then applies the differences from both sides, an operation that isn't order dependent. The topic of merge-ordering and commutativity generated a fascinating discussion on the <a href="http://thread.gmane.org/gmane.comp.version-contro...
119, 717, 28897, 53847, 55696
branching-and-merging, git, git-merge, merge, symmetry
<h1>Are merges in Git symmetric?</h1> <p>Lets say we have two branches (<strong>B</strong> and <strong>C</strong>) that have diverged from a common ancestor <strong>A</strong>. Will merging from <strong>B</strong> to <strong>C</strong> produce the same result as merging from <strong>C</strong> to <strong>B</strong>?</p...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,712
git
# Are merges in Git symmetric? Lets say we have two branches (**B** and **C**) that have diverged from a common ancestor **A**. Will merging from **B** to **C** produce the same result as merging from **C** to **B**? ``` A | / \ B C ``` To clarify- I'm assuming that any manual merge conflict resolutions will ...
The answer is yes for default merges. A three-way merge finds a common ancestor and then applies the differences from both sides, an operation that isn't order dependent. The topic of merge-ordering and commutativity generated a fascinating discussion on the [git list](http://thread.gmane.org/gmane.comp.version-control...
16062358
Referring to the previous/next commit in git?
40
2013-04-17 14:10:15
<p>I have seen git commands use a syntax such as <code>HEAD~</code>, but I haven't been able to find this syntax in the Git <a href="http://git-scm.com/docs" rel="noreferrer">Reference Manual</a>.</p> <p>Here is what I have understood: <code>&lt;commit&gt;~&lt;n&gt;</code> refers to the commit <em>&lt;n></em> steps ea...
24,757
1,070,480
2025-07-08 15:51:09
16,062,839
32
2013-04-17 14:31:09
971,121
2019-01-08 23:03:35
https://stackoverflow.com/q/16062358
https://stackoverflow.com/a/16062839
<p>You have a very clear explanation of how this works in the chapter on <a href="http://git-scm.com/book/en/Git-Tools-Revision-Selection#Ancestry-References" rel="noreferrer">Acenstry References in Pro Git</a>:</p> <ul> <li><code>~</code> is used to get the first parent.</li> <li><code>^</code> can be used to get the...
<p>You have a very clear explanation of how this works in the chapter on <a href="http://git-scm.com/book/en/Git-Tools-Revision-Selection#Ancestry-References" rel="noreferrer">Acenstry References in Pro Git</a>:</p> <ul> <li><code>~</code> is used to get the first parent.</li> <li><code>^</code> can be used to get the...
119, 5597
commit, git
<h1>Referring to the previous/next commit in git?</h1> <p>I have seen git commands use a syntax such as <code>HEAD~</code>, but I haven't been able to find this syntax in the Git <a href="http://git-scm.com/docs" rel="noreferrer">Reference Manual</a>.</p> <p>Here is what I have understood: <code>&lt;commit&gt;~&lt;n&g...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,713
git
# Referring to the previous/next commit in git? I have seen git commands use a syntax such as `HEAD~`, but I haven't been able to find this syntax in the Git [Reference Manual](http://git-scm.com/docs). Here is what I have understood: `<commit>~<n>` refers to the commit *<n>* steps earlier than *<commit>* (where *<n>...
You have a very clear explanation of how this works in the chapter on [Acenstry References in Pro Git](http://git-scm.com/book/en/Git-Tools-Revision-Selection#Ancestry-References): - `~` is used to get the first parent. - `^` can be used to get the other parents (`^2`, for example, for a merge). But you don't have a ...
685319
Git pull error: unable to create temporary sha1 filename
39
2009-03-26 11:08:40
<p>I've got a small git repo setup with the only real purpose to be able to develop locally on several machines (work, home, laptop). Thus I have one branch and I commit/push once I leave a computer, pull once I sit down at the next. Has worked fine, up to now that is. Now when I pull on my 'live test' machine, I get t...
68,324
1,799,944
2019-12-06 18:11:11
692,062
32
2009-03-28 02:36:31
37,772
2015-03-12 00:47:18
https://stackoverflow.com/q/685319
https://stackoverflow.com/a/692062
<p>For what it's worth, when I had this problem—but when committing—I tried <code>git-repack</code> and <code>git-gc</code>, but neither worked. I got a permission denied error, which led me to <code>chown</code> the entire repo recursively to the user I expected it to be, and I could then commit/push/pull with no pro...
<p>For what it's worth, when I had this problem—but when committing—I tried <code>git-repack</code> and <code>git-gc</code>, but neither worked. I got a permission denied error, which led me to <code>chown</code> the entire repo recursively to the user I expected it to be, and I could then commit/push/pull with no pro...
119
git
<h1>Git pull error: unable to create temporary sha1 filename</h1> <p>I've got a small git repo setup with the only real purpose to be able to develop locally on several machines (work, home, laptop). Thus I have one branch and I commit/push once I leave a computer, pull once I sit down at the next. Has worked fine, up ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,715
git
# Git pull error: unable to create temporary sha1 filename I've got a small git repo setup with the only real purpose to be able to develop locally on several machines (work, home, laptop). Thus I have one branch and I commit/push once I leave a computer, pull once I sit down at the next. Has worked fine, up to now th...
For what it's worth, when I had this problem—but when committing—I tried `git-repack` and `git-gc`, but neither worked. I got a permission denied error, which led me to `chown` the entire repo recursively to the user I expected it to be, and I could then commit/push/pull with no problem.
25232056
HEAD detached at origin/master
33
2014-08-10 19:10:28
<p>I've just checked out an old project to fix a bug. git reports:</p> <pre><code>HEAD detached at origin/master </code></pre> <p><code>git status</code> reports I have an untracked file:</p> <pre><code>&lt;project name&gt;.xcworkspace/xcshareddata/ </code></pre> <p>I'd like to get on and fix the bug but I'm not su...
85,447
343,204
2021-09-23 12:56:06
25,232,470
32
2014-08-10 19:57:18
1,256,452
2021-04-23 21:55:03
https://stackoverflow.com/q/25232056
https://stackoverflow.com/a/25232470
<p>As <a href="https://stackoverflow.com/a/25232069/1256452">CommuSoft says</a>, you're not on master. You're in &quot;detached HEAD&quot; mode. You get that any time you explicitly check out something that is not a (local) branch name:</p> <pre><code>$ git checkout origin/master # detach to &quot;remote branch&qu...
<p>As <a href="https://stackoverflow.com/a/25232069/1256452">CommuSoft says</a>, you're not on master. You're in &quot;detached HEAD&quot; mode. You get that any time you explicitly check out something that is not a (local) branch name:</p> <pre><code>$ git checkout origin/master # detach to &quot;remote branch&qu...
119
git
<h1>HEAD detached at origin/master</h1> <p>I've just checked out an old project to fix a bug. git reports:</p> <pre><code>HEAD detached at origin/master </code></pre> <p><code>git status</code> reports I have an untracked file:</p> <pre><code>&lt;project name&gt;.xcworkspace/xcshareddata/ </code></pre> <p>I'd like ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,718
git
# HEAD detached at origin/master I've just checked out an old project to fix a bug. git reports: ``` HEAD detached at origin/master ``` `git status` reports I have an untracked file: ``` <project name>.xcworkspace/xcshareddata/ ``` I'd like to get on and fix the bug but I'm not sure quite what's going on. If I try...
As [CommuSoft says](https://stackoverflow.com/a/25232069/1256452), you're not on master. You're in "detached HEAD" mode. You get that any time you explicitly check out something that is not a (local) branch name: ``` $ git checkout origin/master # detach to "remote branch" ``` or if there's a tag `v1.7`: ``` $ gi...
51782043
What does git lfs migrate do?
31
2018-08-10 08:19:07
<p>I thought that <code>git lfs migrate</code> rewrote the history of a repo so that specified large files were kept in LFS. This means that the repo should get smaller, because it doesn't directly contain all versions of large files. However, when I run</p> <p><code>git lfs migrate import --include="test-data/**" --i...
59,553
1,908,650
2020-11-16 17:34:22
52,823,638
32
2018-10-15 19:38:05
355,401
2018-10-15 19:38:05
https://stackoverflow.com/q/51782043
https://stackoverflow.com/a/52823638
<p>The only problem is that the original git-objects of the binary files are still in the <code>.git</code> folder because you didn't garbage-collected them.</p> <p>You should follow the <a href="https://github.com/git-lfs/git-lfs/wiki/Tutorial#migrating-existing-repository-data-to-lfs" rel="noreferrer">git lfs migrat...
<p>The only problem is that the original git-objects of the binary files are still in the <code>.git</code> folder because you didn't garbage-collected them.</p> <p>You should follow the <a href="https://github.com/git-lfs/git-lfs/wiki/Tutorial#migrating-existing-repository-data-to-lfs" rel="noreferrer">git lfs migrat...
119, 115244
git, git-lfs
<h1>What does git lfs migrate do?</h1> <p>I thought that <code>git lfs migrate</code> rewrote the history of a repo so that specified large files were kept in LFS. This means that the repo should get smaller, because it doesn't directly contain all versions of large files. However, when I run</p> <p><code>git lfs migr...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,719
git
# What does git lfs migrate do? I thought that `git lfs migrate` rewrote the history of a repo so that specified large files were kept in LFS. This means that the repo should get smaller, because it doesn't directly contain all versions of large files. However, when I run `git lfs migrate import --include="test-data/...
The only problem is that the original git-objects of the binary files are still in the `.git` folder because you didn't garbage-collected them. You should follow the [git lfs migration tutorial](https://github.com/git-lfs/git-lfs/wiki/Tutorial#migrating-existing-repository-data-to-lfs) which explains: > The above suc...
14590094
How to replace a commit with another one in Git rebase?
31
2013-01-29 18:51:11
<p>Say I'm working on a feature in a branch <code>oldFeature</code>. I've done commits <code>A</code> and <code>B1</code> and sent it for the code review. In <code>B1</code> I changed some existing files but also added <code>newfile.txt</code>.</p> <p>In the meantime I started working in a branch <code>newFeature</cod...
14,077
245,966
2022-11-14 23:53:39
14,590,183
32
2013-01-29 18:55:35
6,309
2019-12-06 10:37:19
https://stackoverflow.com/q/14590094
https://stackoverflow.com/a/14590183
<p>You could do a <a href="https://thoughtbot.com/blog/git-interactive-rebase-squash-amend-rewriting-history#interactive-rebase" rel="noreferrer">rebase interactive</a>:</p> <pre><code>git checkout new_feature git rebase --interactive old_feature </code></pre> <p>and drop <code>B1</code>: you simply delete the line w...
<p>You could do a <a href="https://thoughtbot.com/blog/git-interactive-rebase-squash-amend-rewriting-history#interactive-rebase" rel="noreferrer">rebase interactive</a>:</p> <pre><code>git checkout new_feature git rebase --interactive old_feature </code></pre> <p>and drop <code>B1</code>: you simply delete the line w...
119, 29934
git, git-rebase
<h1>How to replace a commit with another one in Git rebase?</h1> <p>Say I'm working on a feature in a branch <code>oldFeature</code>. I've done commits <code>A</code> and <code>B1</code> and sent it for the code review. In <code>B1</code> I changed some existing files but also added <code>newfile.txt</code>.</p> <p>In...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,722
git
# How to replace a commit with another one in Git rebase? Say I'm working on a feature in a branch `oldFeature`. I've done commits `A` and `B1` and sent it for the code review. In `B1` I changed some existing files but also added `newfile.txt`. In the meantime I started working in a branch `newFeature`, forked from `...
You could do a [rebase interactive](https://thoughtbot.com/blog/git-interactive-rebase-squash-amend-rewriting-history#interactive-rebase): ``` git checkout new_feature git rebase --interactive old_feature ``` and drop `B1`: you simply delete the line with B1: ``` # If you remove a line here THAT COMMIT WILL BE LOST ...
5496386
Git: distinguish between local and remote tags
30
2011-03-31 07:12:40
<p>If there are tags in the remote repository, I'm usually getting them automatically when pulling. When I delete the created local tag (<code>git tag -d &lt;tag-name&gt;</code>) and pull, the deleted tag will be recreated. I can delete remote branches/tags (<code>git push &lt;remote-branch/tag-name&gt;:&lt;branch/tag-...
15,232
209,706
2021-08-26 18:18:07
5,496,610
32
2011-03-31 07:37:16
223,092
2014-01-17 15:22:05
https://stackoverflow.com/q/5496386
https://stackoverflow.com/a/5496610
<p>If you're annoyed about these tags being recreated when you run <code>git pull</code>, you turn off the fetching of tags by default with the <a href="http://www.kernel.org/pub/software/scm/git/docs/git-pull.html#_options_related_to_fetching">remote.&lt;remote-name&gt;.tagopt</a> config setting. e.g. if the remote i...
<p>If you're annoyed about these tags being recreated when you run <code>git pull</code>, you turn off the fetching of tags by default with the <a href="http://www.kernel.org/pub/software/scm/git/docs/git-pull.html#_options_related_to_fetching">remote.&lt;remote-name&gt;.tagopt</a> config setting. e.g. if the remote i...
115, 119, 60718
git, git-tag, tags
<h1>Git: distinguish between local and remote tags</h1> <p>If there are tags in the remote repository, I'm usually getting them automatically when pulling. When I delete the created local tag (<code>git tag -d &lt;tag-name&gt;</code>) and pull, the deleted tag will be recreated. I can delete remote branches/tags (<code...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,724
git
# Git: distinguish between local and remote tags If there are tags in the remote repository, I'm usually getting them automatically when pulling. When I delete the created local tag (`git tag -d <tag-name>`) and pull, the deleted tag will be recreated. I can delete remote branches/tags (`git push <remote-branch/tag-na...
If you're annoyed about these tags being recreated when you run `git pull`, you turn off the fetching of tags by default with the [remote.<remote-name>.tagopt](http://www.kernel.org/pub/software/scm/git/docs/git-pull.html#_options_related_to_fetching) config setting. e.g. if the remote is `origin`, then you can do: ``...
32320934
Find all current lines modified by an author
29
2015-08-31 22:34:46
<p>How would I in git determine all lines still in existence that were from a specific author. Say for example, a Tony had worked on my project and I wanted to find all lines in my develop branch that still exists and were from a commit that Tony authored?</p>
10,610
301,816
2024-03-11 20:46:41
32,321,085
32
2015-08-31 22:52:21
441,757
2020-02-19 23:15:54
https://stackoverflow.com/q/32320934
https://stackoverflow.com/a/32321085
<p>Maybe just <code>git blame FILE | grep "Some Name"</code>.</p> <p>Or if you want to recursively blame+search through multiple files:</p> <pre><code>for file in $(git ls-files); do git blame $file | grep "Some Name"; done </code></pre> <p>Note: I had originally suggested using the approach below, but the problem y...
<p>Maybe just <code>git blame FILE | grep "Some Name"</code>.</p> <p>Or if you want to recursively blame+search through multiple files:</p> <pre><code>for file in $(git ls-files); do git blame $file | grep "Some Name"; done </code></pre> <p>Note: I had originally suggested using the approach below, but the problem y...
119, 456, 21455, 105902
blame, git, git-blame, version-control
<h1>Find all current lines modified by an author</h1> <p>How would I in git determine all lines still in existence that were from a specific author. Say for example, a Tony had worked on my project and I wanted to find all lines in my develop branch that still exists and were from a commit that Tony authored?</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,725
git
# Find all current lines modified by an author How would I in git determine all lines still in existence that were from a specific author. Say for example, a Tony had worked on my project and I wanted to find all lines in my develop branch that still exists and were from a commit that Tony authored?
Maybe just `git blame FILE | grep "Some Name"`. Or if you want to recursively blame+search through multiple files: ``` for file in $(git ls-files); do git blame $file | grep "Some Name"; done ``` Note: I had originally suggested using the approach below, but the problem you can run into with it is that it may also p...
20074692
Set up GIT on a NAS with Synology's official package
29
2013-11-19 14:51:45
<p>I bought 2-3 months ago a Synology 213air NAS for programing purpose.</p> <p>Then before trying to set up git manually on my NAS, I heard that DSM4.3 will propose Synology's official package. So I decided to wait.</p> <p>The DSM4.3 with Git package is now out : <a href="http://www.synology.fr/dsm/dsm_app.php#Git">...
109,127
1,056,254
2024-11-16 23:59:47
20,750,043
32
2013-12-23 19:36:16
1,424,583
2013-12-23 19:41:19
https://stackoverflow.com/q/20074692
https://stackoverflow.com/a/20750043
<p>I found some helpful info on the Synology forum here:</p> <p><a href="http://forum.synology.com/enu/viewtopic.php?f=190&amp;t=73064">http://forum.synology.com/enu/viewtopic.php?f=190&amp;t=73064</a></p> <p>First you should install the package via your Diskstation package manager and enable it. This will create a ...
<p>I found some helpful info on the Synology forum here:</p> <p><a href="http://forum.synology.com/enu/viewtopic.php?f=190&amp;t=73064">http://forum.synology.com/enu/viewtopic.php?f=190&amp;t=73064</a></p> <p>First you should install the package via your Diskstation package manager and enable it. This will create a ...
119, 13461, 87902
git, nas, synology
<h1>Set up GIT on a NAS with Synology's official package</h1> <p>I bought 2-3 months ago a Synology 213air NAS for programing purpose.</p> <p>Then before trying to set up git manually on my NAS, I heard that DSM4.3 will propose Synology's official package. So I decided to wait.</p> <p>The DSM4.3 with Git package is n...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,726
git
# Set up GIT on a NAS with Synology's official package I bought 2-3 months ago a Synology 213air NAS for programing purpose. Then before trying to set up git manually on my NAS, I heard that DSM4.3 will propose Synology's official package. So I decided to wait. The DSM4.3 with Git package is now out : <http://www.sy...
I found some helpful info on the Synology forum here: <http://forum.synology.com/enu/viewtopic.php?f=190&t=73064> First you should install the package via your Diskstation package manager and enable it. This will create a Git folder on the NAS. I created a user called "gituser" and granted it read/write permissions t...
30689384
Find all binary files in git HEAD
28
2015-06-07 02:07:36
<p>I have a huge git repo that eventually want to clean up with <a href="https://rtyley.github.io/bfg-repo-cleaner/" rel="noreferrer">bfg</a>.<br> But first, I want to track down and remove files in the <code>HEAD</code> which git treats as binary...</p> <p>So, what i'm looking for is a <strong>command to find all fil...
13,079
1,511,914
2022-10-20 04:40:58
30,690,662
32
2015-06-07 06:21:01
4,085,153
2015-06-12 00:08:36
https://stackoverflow.com/q/30689384
https://stackoverflow.com/a/30690662
<pre><code>diff &lt;(git grep -Ic '') &lt;(git grep -c '') | grep '^&gt;' | cut -d : -f 1 | cut -d ' ' -f 2- </code></pre> <p>Breaking it down:</p> <ul> <li><code>git grep -c ''</code> prints the names and line counts of each file in the repository. Adding the <code>-I</code> option makes the command ignore binary fi...
<pre><code>diff &lt;(git grep -Ic '') &lt;(git grep -c '') | grep '^&gt;' | cut -d : -f 1 | cut -d ' ' -f 2- </code></pre> <p>Breaking it down:</p> <ul> <li><code>git grep -c ''</code> prints the names and line counts of each file in the repository. Adding the <code>-I</code> option makes the command ignore binary fi...
119
git
<h1>Find all binary files in git HEAD</h1> <p>I have a huge git repo that eventually want to clean up with <a href="https://rtyley.github.io/bfg-repo-cleaner/" rel="noreferrer">bfg</a>.<br> But first, I want to track down and remove files in the <code>HEAD</code> which git treats as binary...</p> <p>So, what i'm looki...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,727
git
# Find all binary files in git HEAD I have a huge git repo that eventually want to clean up with [bfg](https://rtyley.github.io/bfg-repo-cleaner/). But first, I want to track down and remove files in the `HEAD` which git treats as binary... So, what i'm looking for is a **command to find all files in the *HEAD* tha...
``` diff <(git grep -Ic '') <(git grep -c '') | grep '^>' | cut -d : -f 1 | cut -d ' ' -f 2- ``` Breaking it down: - `git grep -c ''` prints the names and line counts of each file in the repository. Adding the `-I` option makes the command ignore binary files. - `diff <(cmd1) <(cmd2)` uses process substitution to pro...
19650621
Heroku upload-Precompiling assets failed
28
2013-10-29 05:45:35
<p>I need help. When trying to upload my app to heroku, I get this error, anyone know why? A few was wrong. thanks </p> <pre><code> Using rake (10.1.0) ... Using tlsmail (0.0.1) Using uglifier (2.1.2) Your bundle is complete! It was installed into ./vendor/bundle -----&gt; Writing con...
48,690
2,930,724
2019-07-25 15:23:42
19,650,687
32
2013-10-29 05:49:28
1,086,529
2013-10-30 17:19:58
https://stackoverflow.com/q/19650621
https://stackoverflow.com/a/19650687
<p>From the <a href="https://devcenter.heroku.com/articles/rails-asset-pipeline" rel="noreferrer">Heroku docs</a>:</p> <blockquote> <p>This means that your app is attempting to connect to the database as part of rake assets:precompile. Because the config vars are not present in the environment, we use a placeholder DAT...
<p>From the <a href="https://devcenter.heroku.com/articles/rails-asset-pipeline" rel="noreferrer">Heroku docs</a>:</p> <blockquote> <p>This means that your app is attempting to connect to the database as part of rake assets:precompile. Because the config vars are not present in the environment, we use a placeholder DAT...
12, 119, 4984, 8279
git, heroku, ruby, ruby-on-rails
<h1>Heroku upload-Precompiling assets failed</h1> <p>I need help. When trying to upload my app to heroku, I get this error, anyone know why? A few was wrong. thanks </p> <pre><code> Using rake (10.1.0) ... Using tlsmail (0.0.1) Using uglifier (2.1.2) Your bundle is complete! It was in...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,728
git
# Heroku upload-Precompiling assets failed I need help. When trying to upload my app to heroku, I get this error, anyone know why? A few was wrong. thanks ``` Using rake (10.1.0) ... Using tlsmail (0.0.1) Using uglifier (2.1.2) Your bundle is complete! It was installed into ./vendor...
From the [Heroku docs](https://devcenter.heroku.com/articles/rails-asset-pipeline): > This means that your app is attempting to connect to the database as part of rake assets:precompile. Because the config vars are not present in the environment, we use a placeholder DATABASE_URL to satisfy Rails. To resolve this iss...
1489393
Good Git deployment using branches strategy with Heroku?
28
2009-09-28 21:10:12
<p>What is a good deployment strategy to use with Git + Heroku (Ruby on Rails)?</p> <p>Currently, the way I work with my origin Git repository: All features (or 'stories') are first checked out as branches, then get merged with master and pushed to origin.</p> <p>Anything pushed to origin/master triggers a script tha...
9,716
179,327
2019-10-06 23:51:44
1,739,728
32
2009-11-16 02:24:26
117,630
2009-11-16 02:24:26
https://stackoverflow.com/q/1489393
https://stackoverflow.com/a/1739728
<p>In the Gemcutter project we simply have a <strong><a href="http://github.com/qrush/gemcutter/tree/production" rel="noreferrer">production</a></strong> branch. Any changes that we want to see on the production site get merged into that branch, and then deployed with:</p> <pre><code>git push heroku production:master ...
<p>In the Gemcutter project we simply have a <strong><a href="http://github.com/qrush/gemcutter/tree/production" rel="noreferrer">production</a></strong> branch. Any changes that we want to see on the production site get merged into that branch, and then deployed with:</p> <pre><code>git push heroku production:master ...
119, 190, 4984, 8279
deployment, git, heroku, ruby-on-rails
<h1>Good Git deployment using branches strategy with Heroku?</h1> <p>What is a good deployment strategy to use with Git + Heroku (Ruby on Rails)?</p> <p>Currently, the way I work with my origin Git repository: All features (or 'stories') are first checked out as branches, then get merged with master and pushed to orig...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,730
git
# Good Git deployment using branches strategy with Heroku? What is a good deployment strategy to use with Git + Heroku (Ruby on Rails)? Currently, the way I work with my origin Git repository: All features (or 'stories') are first checked out as branches, then get merged with master and pushed to origin. Anything pu...
In the Gemcutter project we simply have a **[production](http://github.com/qrush/gemcutter/tree/production)** branch. Any changes that we want to see on the production site get merged into that branch, and then deployed with: ``` git push heroku production:master ``` The `staging` branch serves a similar purpose for ...
34276532
Keep changes while doing a `git stash`
27
2015-12-14 21:02:26
<p>Is there any way that I can run <code>git stash</code> have it create a stash of my files, but also keep them around so that I can continue editing them.</p> <p>My motivation for this is that I would like to create a temporary snapshot of some work I'm doing, so that I can go back to it if I muck things up. However...
5,901
288,439
2018-10-15 11:02:53
34,276,577
32
2015-12-14 21:05:09
288,439
2015-12-14 21:05:09
https://stackoverflow.com/q/34276532
https://stackoverflow.com/a/34276577
<p>There is (as far as I am aware) not a way to do this with <code>git stash</code> with one command, but you can do it with two uses of <code>git stash</code>.</p> <p>The commands you want to run are:</p> <pre><code>git stash git stash apply </code></pre> <p>The first one takes your local changes and pushes them to...
<p>There is (as far as I am aware) not a way to do this with <code>git stash</code> with one command, but you can do it with two uses of <code>git stash</code>.</p> <p>The commands you want to run are:</p> <pre><code>git stash git stash apply </code></pre> <p>The first one takes your local changes and pushes them to...
119
git
<h1>Keep changes while doing a `git stash`</h1> <p>Is there any way that I can run <code>git stash</code> have it create a stash of my files, but also keep them around so that I can continue editing them.</p> <p>My motivation for this is that I would like to create a temporary snapshot of some work I'm doing, so that ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,731
git
# Keep changes while doing a `git stash` Is there any way that I can run `git stash` have it create a stash of my files, but also keep them around so that I can continue editing them. My motivation for this is that I would like to create a temporary snapshot of some work I'm doing, so that I can go back to it if I mu...
There is (as far as I am aware) not a way to do this with `git stash` with one command, but you can do it with two uses of `git stash`. The commands you want to run are: ``` git stash git stash apply ``` The first one takes your local changes and pushes them to the stash, thus removing them from HEAD. The second one...
15870217
Android source code and repo - What exactly is happening when getting code
27
2013-04-08 02:11:40
<p>I have come across plenty of short questions on minimal aspects of using <code>repo</code> to get Android source or very broad definitions of what <code>repo</code> does and as a result don't really understand what is happening when I use <code>repo</code>. I am following the instructions on the <a href="http://sour...
4,633
1,386,784
2017-02-18 09:45:46
15,871,161
32
2013-04-08 04:16:44
1,254,812
2017-02-18 09:45:46
https://stackoverflow.com/q/15870217
https://stackoverflow.com/a/15871161
<h2>repo init</h2> <p>Since you seem pretty savvy, you know repo is just a python script, right? You can read it to see exactly how it works. I haven't read through the entire thing, but, basically, it wraps <code>git</code> and provides support for working across multiple git repositories. The idea is there is a m...
<h2>repo init</h2> <p>Since you seem pretty savvy, you know repo is just a python script, right? You can read it to see exactly how it works. I haven't read through the entire thing, but, basically, it wraps <code>git</code> and provides support for working across multiple git repositories. The idea is there is a m...
17, 119, 1386, 7330, 47738
android, android-source, git, java, repository
<h1>Android source code and repo - What exactly is happening when getting code</h1> <p>I have come across plenty of short questions on minimal aspects of using <code>repo</code> to get Android source or very broad definitions of what <code>repo</code> does and as a result don't really understand what is happening when ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,732
git
# Android source code and repo - What exactly is happening when getting code I have come across plenty of short questions on minimal aspects of using `repo` to get Android source or very broad definitions of what `repo` does and as a result don't really understand what is happening when I use `repo`. I am following th...
## repo init Since you seem pretty savvy, you know repo is just a python script, right? You can read it to see exactly how it works. I haven't read through the entire thing, but, basically, it wraps `git` and provides support for working across multiple git repositories. The idea is there is a manifest file that speci...
2974016
git-svn branching
27
2010-06-04 12:22:48
<p>I am using git with an svn repository everything is going fine I did all my branching with git so I did not branch on svn but I branched with git and pushed those branches to a separate location. Then I commited changes from the branch when needed.<br> But now I want to create some branches that actually exist on sv...
11,572
218,484
2012-09-27 01:40:02
2,980,284
32
2010-06-05 12:17:43
30,451
2012-09-27 01:40:02
https://stackoverflow.com/q/2974016
https://stackoverflow.com/a/2980284
<p>You have multiple (or no) directories from svn marked as place for branches. Look into you .git/config file, there would be section like that:</p> <pre><code>[svn-remote "svn"] url = file:///someurlto/svn fetch = trunk:refs/remotes/trunk branches = branches/*:refs/remotes/* branches = branches2/*:refs/remotes/* </c...
<p>You have multiple (or no) directories from svn marked as place for branches. Look into you .git/config file, there would be section like that:</p> <pre><code>[svn-remote "svn"] url = file:///someurlto/svn fetch = trunk:refs/remotes/trunk branches = branches/*:refs/remotes/* branches = branches2/*:refs/remotes/* </c...
63, 119, 1879, 6452
branch, git, git-svn, svn
<h1>git-svn branching</h1> <p>I am using git with an svn repository everything is going fine I did all my branching with git so I did not branch on svn but I branched with git and pushed those branches to a separate location. Then I commited changes from the branch when needed.<br> But now I want to create some branche...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,733
git
# git-svn branching I am using git with an svn repository everything is going fine I did all my branching with git so I did not branch on svn but I branched with git and pushed those branches to a separate location. Then I commited changes from the branch when needed. But now I want to create some branches that actu...
You have multiple (or no) directories from svn marked as place for branches. Look into you .git/config file, there would be section like that: ``` [svn-remote "svn"] url = file:///someurlto/svn fetch = trunk:refs/remotes/trunk branches = branches/*:refs/remotes/* branches = branches2/*:refs/remotes/* ``` There will b...
39538520
Git pull a branch from a different repository
26
2016-09-16 19:03:20
<p>I've few files in my current repository. I want to merge a remote branch from a different repository.</p> <ol> <li>Pull and merge a branch from <code>github.com/username/code.git</code> (branch loader)</li> <li>Then pull and merge a branch from <code>github.com/username/code.git</code> (branch login)</li> </ol> <p...
38,824
null
2020-02-13 16:11:02
39,539,852
32
2016-09-16 20:46:21
1,597,771
2016-09-16 20:51:33
https://stackoverflow.com/q/39538520
https://stackoverflow.com/a/39539852
<p>You can add other origins for your repository using</p> <pre><code>git remote add new_origin git@theUrlToRepo </code></pre> <p>You can now start pushing/pulling and basically doing all operations on both of your remotes.</p> <pre><code>git push origin master git push new_origin master git pull origin master git ...
<p>You can add other origins for your repository using</p> <pre><code>git remote add new_origin git@theUrlToRepo </code></pre> <p>You can now start pushing/pulling and basically doing all operations on both of your remotes.</p> <pre><code>git push origin master git push new_origin master git pull origin master git ...
119, 28896
git, git-pull
<h1>Git pull a branch from a different repository</h1> <p>I've few files in my current repository. I want to merge a remote branch from a different repository.</p> <ol> <li>Pull and merge a branch from <code>github.com/username/code.git</code> (branch loader)</li> <li>Then pull and merge a branch from <code>github.com...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,734
git
# Git pull a branch from a different repository I've few files in my current repository. I want to merge a remote branch from a different repository. 1. Pull and merge a branch from `github.com/username/code.git` (branch loader) 2. Then pull and merge a branch from `github.com/username/code.git` (branch login) Is it...
You can add other origins for your repository using ``` git remote add new_origin git@theUrlToRepo ``` You can now start pushing/pulling and basically doing all operations on both of your remotes. ``` git push origin master git push new_origin master git pull origin master git pull new_origin master ``` You just h...
31308033
git diff between specific commit and local file
26
2015-07-09 04:15:02
<p>I've looked for the answer but couldn't find it on stackoverflow, so I ask it here.<br> Let's assume I have some local changes since the last commit(and push) and I want to git diff of a file between a specific commit(several commits ago) and my current local version.<br> I mean, for example, I can see the differenc...
19,897
1,511,337
2015-07-09 04:27:36
31,308,066
32
2015-07-09 04:19:43
1,741,244
2015-07-09 04:27:36
https://stackoverflow.com/q/31308033
https://stackoverflow.com/a/31308066
<p>Per the git <a href="http://git-scm.com/docs/git-diff" rel="noreferrer">docs</a>:</p> <blockquote> <p>git diff [--options] &lt;commit> [--] [&lt;path>…] This form is to view the changes you have in your working tree relative to the named &lt;commit>. You can use HEAD to compare it with the latest commit, or a...
<p>Per the git <a href="http://git-scm.com/docs/git-diff" rel="noreferrer">docs</a>:</p> <blockquote> <p>git diff [--options] &lt;commit> [--] [&lt;path>…] This form is to view the changes you have in your working tree relative to the named &lt;commit>. You can use HEAD to compare it with the latest commit, or a...
119
git
<h1>git diff between specific commit and local file</h1> <p>I've looked for the answer but couldn't find it on stackoverflow, so I ask it here.<br> Let's assume I have some local changes since the last commit(and push) and I want to git diff of a file between a specific commit(several commits ago) and my current local ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,735
git
# git diff between specific commit and local file I've looked for the answer but couldn't find it on stackoverflow, so I ask it here. Let's assume I have some local changes since the last commit(and push) and I want to git diff of a file between a specific commit(several commits ago) and my current local version. ...
Per the git [docs](http://git-scm.com/docs/git-diff): > git diff [--options] <commit> [--] [<path>…] This form is to view the > changes you have in your working tree relative to the named <commit>. > You can use HEAD to compare it with the latest commit, or a branch > name to compare with the tip of a different branch...
16840184
How can I automatically be warned if a specific file changes?
26
2013-05-30 15:30:29
<p>I have a php project, and when I pull from another repository and the composer.lock file gets changed, I'm supposed to run <code>composer.phar install --dev</code>. How can git automatically warn me / ask me if I want to run this command? I suppose some sort of hook would do the trick, but how can I get information ...
13,447
353,612
2019-03-11 13:43:58
16,853,458
32
2013-05-31 08:54:53
1,734,130
2016-01-16 07:38:05
https://stackoverflow.com/q/16840184
https://stackoverflow.com/a/16853458
<p>It depends on what option you use when pulling:</p> <h2>No option : git fetch and git merge are run</h2> <p>You can write your own <a href="https://www.kernel.org/pub/software/scm/git/docs/githooks.html#_post_merge" rel="noreferrer">post-merge git hook</a>:</p> <blockquote> <p>This hook is invoked by git merge,...
<p>It depends on what option you use when pulling:</p> <h2>No option : git fetch and git merge are run</h2> <p>You can write your own <a href="https://www.kernel.org/pub/software/scm/git/docs/githooks.html#_post_merge" rel="noreferrer">post-merge git hook</a>:</p> <blockquote> <p>This hook is invoked by git merge,...
119, 43087
git, githooks
<h1>How can I automatically be warned if a specific file changes?</h1> <p>I have a php project, and when I pull from another repository and the composer.lock file gets changed, I'm supposed to run <code>composer.phar install --dev</code>. How can git automatically warn me / ask me if I want to run this command? I suppo...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,736
git
# How can I automatically be warned if a specific file changes? I have a php project, and when I pull from another repository and the composer.lock file gets changed, I'm supposed to run `composer.phar install --dev`. How can git automatically warn me / ask me if I want to run this command? I suppose some sort of hook...
It depends on what option you use when pulling: ## No option : git fetch and git merge are run You can write your own [post-merge git hook](https://www.kernel.org/pub/software/scm/git/docs/githooks.html#_post_merge): > This hook is invoked by git merge, which happens when a git pull is done on a local repository. Th...
12078365
how exactly does git submodule work
26
2012-08-22 17:28:22
<p>The <code>.gitmodule</code> file only specifies the module repository url. How does <code>git submodule</code> know which version to download? It seems to be always checking out the latest version. Then, how does developers ensure compatibility between the main project and the sub modules?</p>
13,678
219,837
2013-04-03 09:06:01
12,078,816
32
2012-08-22 17:58:56
6,309
2013-04-03 09:06:01
https://stackoverflow.com/q/12078365
https://stackoverflow.com/a/12078816
<p>Your submodule is represented as a special entry with a special mode (called a <strong><a href="http://www.kernel.org/pub/software/scm/git/docs/git-fast-import.html#_tt_filemodify_tt" rel="noreferrer">gitlink</a></strong>, see "<a href="https://stackoverflow.com/questions/5980960/git-repository-in-a-git-repository/5...
<p>Your submodule is represented as a special entry with a special mode (called a <strong><a href="http://www.kernel.org/pub/software/scm/git/docs/git-fast-import.html#_tt_filemodify_tt" rel="noreferrer">gitlink</a></strong>, see "<a href="https://stackoverflow.com/questions/5980960/git-repository-in-a-git-repository/5...
119, 41612
git, git-submodules
<h1>how exactly does git submodule work</h1> <p>The <code>.gitmodule</code> file only specifies the module repository url. How does <code>git submodule</code> know which version to download? It seems to be always checking out the latest version. Then, how does developers ensure compatibility between the main project an...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,737
git
# how exactly does git submodule work The `.gitmodule` file only specifies the module repository url. How does `git submodule` know which version to download? It seems to be always checking out the latest version. Then, how does developers ensure compatibility between the main project and the sub modules?
Your submodule is represented as a special entry with a special mode (called a **[gitlink](http://www.kernel.org/pub/software/scm/git/docs/git-fast-import.html#_tt_filemodify_tt)**, see "[Nested git repositories without submodules?](https://stackoverflow.com/questions/5980960/git-repository-in-a-git-repository/5981099#...
58377383
VSCode: enable or disable editor tabs modified since last git commit, show git status with modified tabs colors
25
2019-10-14 12:58:25
<p>In VSCODE, how can I highlight tabs that were modified compared to previous git commit? In order to show their git status.</p> <p>Note: This is not a duplicate of <a href="https://stackoverflow.com/questions/39085107/how-can-i-edit-vs-code-settings-so-that-the-tabs-of-modified-files-are-highlight">How can I edit VS...
5,266
2,476,373
2021-03-31 20:05:35
65,998,050
32
2021-02-01 18:18:47
836,330
2021-03-31 19:56:04
https://stackoverflow.com/q/58377383
https://stackoverflow.com/a/65998050
<p>v1.53 has added this functionality, see <a href="https://github.com/microsoft/vscode-docs/blob/vnext/release-notes/v1_53.md#tab-decorations" rel="noreferrer">Release notes: tab decorations</a>.</p> <blockquote> <p>Two new settings allow you to configure whether editor tabs show decorations, such as git status or dia...
<p>v1.53 has added this functionality, see <a href="https://github.com/microsoft/vscode-docs/blob/vnext/release-notes/v1_53.md#tab-decorations" rel="noreferrer">Release notes: tab decorations</a>.</p> <blockquote> <p>Two new settings allow you to configure whether editor tabs show decorations, such as git status or dia...
119, 111608
git, visual-studio-code
<h1>VSCode: enable or disable editor tabs modified since last git commit, show git status with modified tabs colors</h1> <p>In VSCODE, how can I highlight tabs that were modified compared to previous git commit? In order to show their git status.</p> <p>Note: This is not a duplicate of <a href="https://stackoverflow.c...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,739
git
# VSCode: enable or disable editor tabs modified since last git commit, show git status with modified tabs colors In VSCODE, how can I highlight tabs that were modified compared to previous git commit? In order to show their git status. Note: This is not a duplicate of [How can I edit VS Code settings so that the tab...
v1.53 has added this functionality, see [Release notes: tab decorations](https://github.com/microsoft/vscode-docs/blob/vnext/release-notes/v1_53.md#tab-decorations). > Two new settings allow you to configure whether editor tabs show > decorations, such as git status or diagnostics. Use > `workbench.editor.decorations....
45926640
How do I view a single file's history in GitK?
25
2017-08-28 20:09:54
<p>I have a git repository with a large number of files in it. At some point a bug was introduced into my program. I have a good idea which file is causing the issue, I just need to track down which commit introduced the error.</p> <p>How can I view the revision history for single file using GitK?</p>
19,093
3,357,935
2022-08-16 14:30:24
45,927,975
32
2017-08-28 22:05:41
99,238
2017-08-28 22:05:41
https://stackoverflow.com/q/45926640
https://stackoverflow.com/a/45927975
<p>To get the file history </p> <pre><code>gitk &lt;filename&gt; </code></pre> <p>To see the blame history in a gui, which may help you track the commit use</p> <pre><code>git gui blame &lt;filename&gt; </code></pre>
<p>To get the file history </p> <pre><code>gitk &lt;filename&gt; </code></pre> <p>To see the blame history in a gui, which may help you track the commit use</p> <pre><code>git gui blame &lt;filename&gt; </code></pre>
119, 30785
git, gitk
<h1>How do I view a single file's history in GitK?</h1> <p>I have a git repository with a large number of files in it. At some point a bug was introduced into my program. I have a good idea which file is causing the issue, I just need to track down which commit introduced the error.</p> <p>How can I view the revision h...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,740
git
# How do I view a single file's history in GitK? I have a git repository with a large number of files in it. At some point a bug was introduced into my program. I have a good idea which file is causing the issue, I just need to track down which commit introduced the error. How can I view the revision history for sing...
To get the file history ``` gitk <filename> ``` To see the blame history in a gui, which may help you track the commit use ``` git gui blame <filename> ```
29931302
Initialize a CLLocation object in swift with latitude and longitude
24
2015-04-28 22:48:39
<p>In objective C (I have no experience with it) you can initialize a CLLocation object with latitude and longitude likes this:</p> <pre><code>CLLocation *myLocation = [[CLLocation alloc] initWithLatitude:your_latitiude_value longitude:your_longitude_value]; </code></pre> <p>But how do I do it in Swift?</p> <p>I tr...
35,742
4,734,179
2015-04-28 23:34:15
29,931,747
32
2015-04-28 23:34:15
2,833,727
2015-04-28 23:34:15
https://stackoverflow.com/q/29931302
https://stackoverflow.com/a/29931747
<p>I am not near my Mac to test it but the following should be working. Just pass your <em>lat</em> and <em>lon</em> values to the CLLocaion initializer like this: </p> <pre><code>let myLocation = CLLocation(latitude: your_latitiude_value, longitude: your_longitude_value) </code></pre> <p>For reference you can check...
<p>I am not near my Mac to test it but the following should be working. Just pass your <em>lat</em> and <em>lon</em> values to the CLLocaion initializer like this: </p> <pre><code>let myLocation = CLLocation(latitude: your_latitiude_value, longitude: your_longitude_value) </code></pre> <p>For reference you can check...
20301, 48898, 65674, 94887, 104797
cllocation, cllocationcoordinate2d, cllocationdistance, latitude-longitude, swift
<h1>Initialize a CLLocation object in swift with latitude and longitude</h1> <p>In objective C (I have no experience with it) you can initialize a CLLocation object with latitude and longitude likes this:</p> <pre><code>CLLocation *myLocation = [[CLLocation alloc] initWithLatitude:your_latitiude_value longitude:your_...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,741
git
# Initialize a CLLocation object in swift with latitude and longitude In objective C (I have no experience with it) you can initialize a CLLocation object with latitude and longitude likes this: ``` CLLocation *myLocation = [[CLLocation alloc] initWithLatitude:your_latitiude_value longitude:your_longitude_value]; ``...
I am not near my Mac to test it but the following should be working. Just pass your *lat* and *lon* values to the CLLocaion initializer like this: ``` let myLocation = CLLocation(latitude: your_latitiude_value, longitude: your_longitude_value) ``` For reference you can check the [documentation](https://developer.appl...
21823679
Digital certificates: What is the difference between encrypting and signing
24
2014-02-17 08:01:53
<p>I am relatively new to PKI, certificates and all related stuff.</p> <p>As far as I understand in public-key cryptography one encrypt with a public key and decrypt with a private key. Only <strong>one</strong> private key can correspond to <strong>any</strong> public key but the opposite is not true. Is it correct? ...
33,802
1,745,356
2024-06-03 12:16:39
21,826,397
32
2014-02-17 10:23:55
2,845,946
2014-02-19 19:53:04
https://stackoverflow.com/q/21823679
https://stackoverflow.com/a/21826397
<h2>Difference between Message Encryption and Signing</h2> <p>I think information security objectives are essential to realize the difference between message encryption and signing. To define a few objectives:</p> <ol> <li><strong>Confidentiality</strong>: keeping information secret from unauthorized parties.</li> <li>...
<h2>Difference between Message Encryption and Signing</h2> <p>I think information security objectives are essential to realize the difference between message encryption and signing. To define a few objectives:</p> <ol> <li><strong>Confidentiality</strong>: keeping information secret from unauthorized parties.</li> <li>...
8176, 8502, 17782
digital-certificate, digital-signature, pki
<h1>Digital certificates: What is the difference between encrypting and signing</h1> <p>I am relatively new to PKI, certificates and all related stuff.</p> <p>As far as I understand in public-key cryptography one encrypt with a public key and decrypt with a private key. Only <strong>one</strong> private key can corres...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,743
git
# Digital certificates: What is the difference between encrypting and signing I am relatively new to PKI, certificates and all related stuff. As far as I understand in public-key cryptography one encrypt with a public key and decrypt with a private key. Only **one** private key can correspond to **any** public key bu...
## Difference between Message Encryption and Signing I think information security objectives are essential to realize the difference between message encryption and signing. To define a few objectives: 1. **Confidentiality**: keeping information secret from unauthorized parties. 2. **Data integrity**: ensuring that in...
56473680
npm install shows error with git not found
23
2019-06-06 08:30:51
<p>I have recently added some dependencies to the package JSON and tried installing npm, but it shows errors related to git not found:</p> <blockquote> <p>npm ERR! path git<br /> npm ERR! code ENOENT<br /> npm ERR! errno ENOENT<br /> npm ERR! syscall spawn git<br /> npm ERR! enoent Error while executing:<br /> npm ERR!...
33,496
11,430,621
2021-09-28 01:15:11
56,474,107
32
2019-06-06 08:56:19
3,092,377
2020-07-15 05:00:02
https://stackoverflow.com/q/56473680
https://stackoverflow.com/a/56474107
<p>You need to <a href="https://git-scm.com/downloads" rel="noreferrer">install</a> <code>git</code> in your machine to have it working.</p> <pre><code>undefined ls-remote -h -t ssh://git@github.com/eligrey/FileSaver.js.git </code></pre> <p>it should have been</p> <pre><code>git ls-remote -h -t ssh://git@github.com/eli...
<p>You need to <a href="https://git-scm.com/downloads" rel="noreferrer">install</a> <code>git</code> in your machine to have it working.</p> <pre><code>undefined ls-remote -h -t ssh://git@github.com/eligrey/FileSaver.js.git </code></pre> <p>it should have been</p> <pre><code>git ls-remote -h -t ssh://git@github.com/eli...
119, 46426, 61387, 125866, 135208
angular, angular7, git, node.js, npm
<h1>npm install shows error with git not found</h1> <p>I have recently added some dependencies to the package JSON and tried installing npm, but it shows errors related to git not found:</p> <blockquote> <p>npm ERR! path git<br /> npm ERR! code ENOENT<br /> npm ERR! errno ENOENT<br /> npm ERR! syscall spawn git<br /> n...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,746
git
# npm install shows error with git not found I have recently added some dependencies to the package JSON and tried installing npm, but it shows errors related to git not found: > npm ERR! path git > npm ERR! code ENOENT > npm ERR! errno ENOENT > npm ERR! syscall spawn git > npm ERR! enoent Error while executi...
You need to [install](https://git-scm.com/downloads) `git` in your machine to have it working. ``` undefined ls-remote -h -t ssh://git@github.com/eligrey/FileSaver.js.git ``` it should have been ``` git ls-remote -h -t ssh://git@github.com/eligrey/FileSaver.js.git ``` There is error related to git path. [check this...
16777058
Review the result of git-merge before the actual merge
23
2013-05-27 16:18:00
<p>Is there a way to review the result of a merge between two branches before actually merging them ? </p> <p>When attempting to merge branch A to branch B, I usually checkout a temporary branch from B, merge it with branch A, then I'd create a diff patch, or just checkout to that temporary branch and check whether ev...
12,308
452,069
2020-02-07 12:27:58
16,778,718
32
2013-05-27 18:32:18
46,194
2020-02-07 12:27:58
https://stackoverflow.com/q/16777058
https://stackoverflow.com/a/16778718
<p>As Marian Theisen suggested, you can do this to do the merge without committing</p> <pre><code>git merge --no-commit &lt;branchname&gt; </code></pre> <p>You can back out of that merge with</p> <pre><code>git reset --hard </code></pre> <p>Also, remember that it is always easy to change your mind and return to a p...
<p>As Marian Theisen suggested, you can do this to do the merge without committing</p> <pre><code>git merge --no-commit &lt;branchname&gt; </code></pre> <p>You can back out of that merge with</p> <pre><code>git reset --hard </code></pre> <p>Also, remember that it is always easy to change your mind and return to a p...
119
git
<h1>Review the result of git-merge before the actual merge</h1> <p>Is there a way to review the result of a merge between two branches before actually merging them ? </p> <p>When attempting to merge branch A to branch B, I usually checkout a temporary branch from B, merge it with branch A, then I'd create a diff patch...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,747
git
# Review the result of git-merge before the actual merge Is there a way to review the result of a merge between two branches before actually merging them ? When attempting to merge branch A to branch B, I usually checkout a temporary branch from B, merge it with branch A, then I'd create a diff patch, or just checkou...
As Marian Theisen suggested, you can do this to do the merge without committing ``` git merge --no-commit <branchname> ``` You can back out of that merge with ``` git reset --hard ``` Also, remember that it is always easy to change your mind and return to a previous state in Git. You can do a full merge, including ...
4337796
git-svn display svn repository url
23
2010-12-02 17:17:39
<p>My project is setting up using git and upload to svn. However, i forgot what is the svn repository url that is configured with my project. Is there a command line to show that information?</p> <p>Thanks,</p>
4,287
463,300
2014-04-16 09:57:58
4,337,818
32
2010-12-02 17:20:00
1,737,192
2014-04-16 09:57:58
https://stackoverflow.com/q/4337796
https://stackoverflow.com/a/4337818
<pre><code>git svn info </code></pre> <p>That should do the trick</p>
<pre><code>git svn info </code></pre> <p>That should do the trick</p>
63, 119
git, svn
<h1>git-svn display svn repository url</h1> <p>My project is setting up using git and upload to svn. However, i forgot what is the svn repository url that is configured with my project. Is there a command line to show that information?</p> <p>Thanks,</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,748
git
# git-svn display svn repository url My project is setting up using git and upload to svn. However, i forgot what is the svn repository url that is configured with my project. Is there a command line to show that information? Thanks,
``` git svn info ``` That should do the trick
28312439
git gc --aggressive --prune=all does not remove big file from repository
22
2015-02-04 02:19:45
<p>There are many SO questions regarding "how to remove an accidentally added big file from repo", many of them suggesting using <code>git gc</code> command. However, I find it not working for me and I don't know what's going wrong.</p> <p>Here is what I have done:</p> <pre><code>$ git init Initialized empty Git repo...
23,884
1,324,308
2018-05-23 07:23:21
28,335,092
32
2015-02-05 02:17:49
1,324,308
2015-02-05 02:17:49
https://stackoverflow.com/q/28312439
https://stackoverflow.com/a/28335092
<p>As Andrew C suggested, one needs to expire reflog to dereference the objects before <code>git gc</code> being able to recycle the loose objects. So the correct way to recover the disk space claimed by accidentally added big files is:</p> <pre><code>git reflog expire --expire=now --all git gc --aggressive --prune=no...
<p>As Andrew C suggested, one needs to expire reflog to dereference the objects before <code>git gc</code> being able to recycle the loose objects. So the correct way to recover the disk space claimed by accidentally added big files is:</p> <pre><code>git reflog expire --expire=now --all git gc --aggressive --prune=no...
119, 456, 1850
garbage-collection, git, version-control
<h1>git gc --aggressive --prune=all does not remove big file from repository</h1> <p>There are many SO questions regarding "how to remove an accidentally added big file from repo", many of them suggesting using <code>git gc</code> command. However, I find it not working for me and I don't know what's going wrong.</p> ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,750
git
# git gc --aggressive --prune=all does not remove big file from repository There are many SO questions regarding "how to remove an accidentally added big file from repo", many of them suggesting using `git gc` command. However, I find it not working for me and I don't know what's going wrong. Here is what I have done...
As Andrew C suggested, one needs to expire reflog to dereference the objects before `git gc` being able to recycle the loose objects. So the correct way to recover the disk space claimed by accidentally added big files is: ``` git reflog expire --expire=now --all git gc --aggressive --prune=now ``` This will remove a...
19461833
what does this error message imply: fatal: unable to access 'https:URL': Peer's Certificate issuer is not recognized?
22
2013-10-19 02:51:57
<p>I have tried many different searches relating to certificates but I don't get it. I don't know how to see if I have good certificates or not. This message was given after trying to push a a git commit in Fedora like this:</p> <pre><code>$ git push origin master </code></pre> <p>Is this certificate related or git r...
91,662
1,965,708
2022-03-01 10:36:47
19,464,361
32
2013-10-19 09:09:11
6,309
2013-10-22 19:26:42
https://stackoverflow.com/q/19461833
https://stackoverflow.com/a/19464361
<p>One possibility would be the absence of Certification Authority certificates on your system.</p> <p>If that is the case, you can add those as described in <a href="https://stackoverflow.com/a/4454754/6309">this answer</a>.</p> <p>This is better than ignoring said CA (<code>env GIT_SSL_NO_VERIFY=true git clone http...
<p>One possibility would be the absence of Certification Authority certificates on your system.</p> <p>If that is the case, you can add those as described in <a href="https://stackoverflow.com/a/4454754/6309">this answer</a>.</p> <p>This is better than ignoring said CA (<code>env GIT_SSL_NO_VERIFY=true git clone http...
119, 641, 5954
certificate, git, ssl
<h1>what does this error message imply: fatal: unable to access 'https:URL': Peer's Certificate issuer is not recognized?</h1> <p>I have tried many different searches relating to certificates but I don't get it. I don't know how to see if I have good certificates or not. This message was given after trying to push a a ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,751
git
# what does this error message imply: fatal: unable to access 'https:URL': Peer's Certificate issuer is not recognized? I have tried many different searches relating to certificates but I don't get it. I don't know how to see if I have good certificates or not. This message was given after trying to push a a git commi...
One possibility would be the absence of Certification Authority certificates on your system. If that is the case, you can add those as described in [this answer](https://stackoverflow.com/a/4454754/6309). This is better than ignoring said CA (`env GIT_SSL_NO_VERIFY=true git clone https://github...`). --- In the spe...
9785792
git track, ignore, delete, untrack
22
2012-03-20 11:21:40
<p>I seem to have ballsed up my git repo by tracking a file, later ignoring it and then deleting it. The thing is, I want the file to be present in a remote repository (the live site), but just don't want to track. </p> <p>Now my master branch is trying to remove all the files from the repository, which I know will de...
13,977
572,646
2015-04-06 04:59:54
11,209,188
32
2012-06-26 14:08:21
1,365,319
2015-04-06 04:59:54
https://stackoverflow.com/q/9785792
https://stackoverflow.com/a/11209188
<p>You just don't want to track a file, but you want to keep the file in the remote repository (non-bare).</p> <p>Use this git command. After you do this, git stops checking the file for possible modifications.</p> <pre><code>git update-index --assume-unchanged &lt;filename&gt; </code></pre> <p>At any time, you can...
<p>You just don't want to track a file, but you want to keep the file in the remote repository (non-bare).</p> <p>Use this git command. After you do this, git stops checking the file for possible modifications.</p> <pre><code>git update-index --assume-unchanged &lt;filename&gt; </code></pre> <p>At any time, you can...
119
git
<h1>git track, ignore, delete, untrack</h1> <p>I seem to have ballsed up my git repo by tracking a file, later ignoring it and then deleting it. The thing is, I want the file to be present in a remote repository (the live site), but just don't want to track. </p> <p>Now my master branch is trying to remove all the fil...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,752
git
# git track, ignore, delete, untrack I seem to have ballsed up my git repo by tracking a file, later ignoring it and then deleting it. The thing is, I want the file to be present in a remote repository (the live site), but just don't want to track. Now my master branch is trying to remove all the files from the repos...
You just don't want to track a file, but you want to keep the file in the remote repository (non-bare). Use this git command. After you do this, git stops checking the file for possible modifications. ``` git update-index --assume-unchanged <filename> ``` At any time, you can track again by setting *--no-assume-unc...
3329041
Best practice to store .jar files in VCS (SVN, Git, ...)
22
2010-07-25 11:43:57
<p>I know, in the time of Maven it is not recommended to store libraries in VCS, but sometimes it makes sense, though.</p> <p>My question is how to best store them - compressed or uncompressed? Uncompressed they are larger, but if they are replaced a couple of times with newer ones, then maybe the stored difference be...
19,860
209,706
2010-07-26 13:00:59
3,329,272
32
2010-07-25 13:06:19
6,309
2010-07-26 13:00:59
https://stackoverflow.com/q/3329041
https://stackoverflow.com/a/3329272
<p>Best practice to store .jar files in VCS (SVN, Git, …): don't.</p> <p>It could make sense in a CVCS (Centralized VCS) like SVN, which can handle millions of files whatever their size is.</p> <p>It doesn't in a DVCS, especially one like Git (and <a href="https://stackoverflow.com/questions/984707/what-are-the-git-l...
<p>Best practice to store .jar files in VCS (SVN, Git, …): don't.</p> <p>It could make sense in a CVCS (Centralized VCS) like SVN, which can handle millions of files whatever their size is.</p> <p>It doesn't in a DVCS, especially one like Git (and <a href="https://stackoverflow.com/questions/984707/what-are-the-git-l...
17, 63, 119
git, java, svn
<h1>Best practice to store .jar files in VCS (SVN, Git, ...)</h1> <p>I know, in the time of Maven it is not recommended to store libraries in VCS, but sometimes it makes sense, though.</p> <p>My question is how to best store them - compressed or uncompressed? Uncompressed they are larger, but if they are replaced a co...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,753
git
# Best practice to store .jar files in VCS (SVN, Git, ...) I know, in the time of Maven it is not recommended to store libraries in VCS, but sometimes it makes sense, though. My question is how to best store them - compressed or uncompressed? Uncompressed they are larger, but if they are replaced a couple of times wi...
Best practice to store .jar files in VCS (SVN, Git, …): don't. It could make sense in a CVCS (Centralized VCS) like SVN, which can handle millions of files whatever their size is. It doesn't in a DVCS, especially one like Git (and [its limits](https://stackoverflow.com/questions/984707/what-are-the-git-limits/984973#...
15291056
GIT corrupt files (<<<<<<<<HEAD)
21
2013-03-08 09:49:43
<p>I have this in my files after some trouble with VS2012 git-plugin:</p> <pre><code>using Microsoft.VisualStudio.TestTools.UnitTesting; &lt;&lt;&lt;&lt;&lt;&lt;&lt; HEAD using NHibernate; ======= &gt;&gt;&gt;&gt;&gt;&gt;&gt; dd2c3d7dfe81074e7c5a73f8e4ca2584481a74f1 namespace Controll.Hosting.Tests { [TestClass] publ...
30,679
225,360
2016-10-25 14:01:59
15,291,122
32
2013-03-08 09:53:20
1,225,541
2013-03-08 09:53:20
https://stackoverflow.com/q/15291056
https://stackoverflow.com/a/15291122
<p>What you had wasn't <strong>trouble</strong> but <strong>conflicts</strong>. This happens when the files are modified by two different persons at the same place (you both add/remove/modify things inside the same lines).</p> <p>You can simply update your files manually, by deciding to keep everything between <code>&...
<p>What you had wasn't <strong>trouble</strong> but <strong>conflicts</strong>. This happens when the files are modified by two different persons at the same place (you both add/remove/modify things inside the same lines).</p> <p>You can simply update your files manually, by deciding to keep everything between <code>&...
119, 28897, 62599
git, git-merge, merge-conflict-resolution
<h1>GIT corrupt files (<<<<<<<<HEAD)</h1> <p>I have this in my files after some trouble with VS2012 git-plugin:</p> <pre><code>using Microsoft.VisualStudio.TestTools.UnitTesting; &lt;&lt;&lt;&lt;&lt;&lt;&lt; HEAD using NHibernate; ======= &gt;&gt;&gt;&gt;&gt;&gt;&gt; dd2c3d7dfe81074e7c5a73f8e4ca2584481a74f1 namespace...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,754
git
# GIT corrupt files (<<<<<<< I have this in my files after some trouble with VS2012 git-plugin: ``` using Microsoft.VisualStudio.TestTools.UnitTesting; <<<<<<< HEAD using NHibernate; ======= >>>>>>> dd2c3d7dfe81074e7c5a73f8e4ca2584481a74f1 namespace Controll.Hosting.Tests { [TestClass] public class TestBase { <<<<<<< H...
What you had wasn't **trouble** but **conflicts**. This happens when the files are modified by two different persons at the same place (you both add/remove/modify things inside the same lines). You can simply update your files manually, by deciding to keep everything between `<<<<<<< HEAD` and `=======`, or between `=...
6498914
git pull from clean directory has merge conflicts
21
2011-06-27 21:01:24
<p>I did a <code>git pull</code> from my upstream on a clean working directory and it presents me with merge conflicts. I spent about an hour manually resetting them thinking I had screwed something up and it happened again.</p> <p>Is this a bug in git? I know little about it, so I'm fully willing to accept that I did...
12,961
818,112
2018-01-07 10:59:13
6,498,964
32
2011-06-27 21:07:24
36,723
2011-06-27 21:07:24
https://stackoverflow.com/q/6498914
https://stackoverflow.com/a/6498964
<p>Your working directory may be clean, but you have one or more commits that you have made locally that are not on the server. When you pull, git tries to merge these local commits with the ones on the server, but since they modify the same area of the code, they conflict.</p> <p>Your options here basically boil down...
<p>Your working directory may be clean, but you have one or more commits that you have made locally that are not on the server. When you pull, git tries to merge these local commits with the ones on the server, but since they modify the same area of the code, they conflict.</p> <p>Your options here basically boil down...
119
git
<h1>git pull from clean directory has merge conflicts</h1> <p>I did a <code>git pull</code> from my upstream on a clean working directory and it presents me with merge conflicts. I spent about an hour manually resetting them thinking I had screwed something up and it happened again.</p> <p>Is this a bug in git? I know...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,755
git
# git pull from clean directory has merge conflicts I did a `git pull` from my upstream on a clean working directory and it presents me with merge conflicts. I spent about an hour manually resetting them thinking I had screwed something up and it happened again. Is this a bug in git? I know little about it, so I'm fu...
Your working directory may be clean, but you have one or more commits that you have made locally that are not on the server. When you pull, git tries to merge these local commits with the ones on the server, but since they modify the same area of the code, they conflict. Your options here basically boil down to: 1. [...
9301759
How can I use gitstats to find out how many SLOC a Git repo has in total and per commiter?
20
2012-02-15 21:32:21
<p>I just installed <a href="http://gitstats.sourceforge.net/">GitStats</a>, and I'm at that point where I have to say, "Now, what?". I see examples on the site of user lines of code, etc., but no examples of how to get simple stats like that. I don't need a chart or anything. I just want to be able to console output t...
17,101
128,463
2017-06-10 19:45:05
9,302,716
32
2012-02-15 22:49:27
128,463
2014-07-11 13:30:18
https://stackoverflow.com/q/9301759
https://stackoverflow.com/a/9302716
<h3>Update (July 11th, 2014)</h3> <p>I'm not sure what version i had installed when I first answered this question, but the latest version gave me an <code>authors.html</code> file when I ran <code>gitstats /path/to/repo/.git /path/to/output/dir/</code> that contained exactly the info I was looking for.</p> <h3>Origi...
<h3>Update (July 11th, 2014)</h3> <p>I'm not sure what version i had installed when I first answered this question, but the latest version gave me an <code>authors.html</code> file when I ran <code>gitstats /path/to/repo/.git /path/to/output/dir/</code> that contained exactly the info I was looking for.</p> <h3>Origi...
119, 19158
code-statistics, git
<h1>How can I use gitstats to find out how many SLOC a Git repo has in total and per commiter?</h1> <p>I just installed <a href="http://gitstats.sourceforge.net/">GitStats</a>, and I'm at that point where I have to say, "Now, what?". I see examples on the site of user lines of code, etc., but no examples of how to get ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,756
git
# How can I use gitstats to find out how many SLOC a Git repo has in total and per commiter? I just installed [GitStats](http://gitstats.sourceforge.net/), and I'm at that point where I have to say, "Now, what?". I see examples on the site of user lines of code, etc., but no examples of how to get simple stats like th...
### Update (July 11th, 2014) I'm not sure what version i had installed when I first answered this question, but the latest version gave me an `authors.html` file when I ran `gitstats /path/to/repo/.git /path/to/output/dir/` that contained exactly the info I was looking for. ### Original Answer It's pretty simple, I ...
5150898
Git pushd & popd? I.e., checkout last state
20
2011-03-01 05:36:26
<p>I'm writing a Bash script, and I want to checkout a tag and then checkout back to where I started.</p> <p>I tried <code>git co HEAD@{1}</code>, but when starting at master, that takes me back to the commit SHA of master but with a detatched head.</p> <p>Is there something like <code>pushd</code> &amp; <code>popd</...
6,131
242,933
2022-10-19 15:41:52
5,151,002
32
2011-03-01 05:53:40
15,464
2011-03-01 07:50:28
https://stackoverflow.com/q/5150898
https://stackoverflow.com/a/5151002
<p><code>git checkout @{-1}</code> which can be abbreviated to <code>git checkout -</code>.</p> <p><a href="http://git-scm.com/docs/git-checkout">From the manpage:</a></p> <blockquote> <p>As a special case, the "@{-N}" syntax for the N-th last branch checks out the branch (instead of detaching). You may also ...
<p><code>git checkout @{-1}</code> which can be abbreviated to <code>git checkout -</code>.</p> <p><a href="http://git-scm.com/docs/git-checkout">From the manpage:</a></p> <blockquote> <p>As a special case, the "@{-N}" syntax for the N-th last branch checks out the branch (instead of detaching). You may also ...
119, 37230
git, git-checkout
<h1>Git pushd & popd? I.e., checkout last state</h1> <p>I'm writing a Bash script, and I want to checkout a tag and then checkout back to where I started.</p> <p>I tried <code>git co HEAD@{1}</code>, but when starting at master, that takes me back to the commit SHA of master but with a detatched head.</p> <p>Is there...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,757
git
# Git pushd & popd? I.e., checkout last state I'm writing a Bash script, and I want to checkout a tag and then checkout back to where I started. I tried `git co HEAD@{1}`, but when starting at master, that takes me back to the commit SHA of master but with a detatched head. Is there something like `pushd` & `popd` f...
`git checkout @{-1}` which can be abbreviated to `git checkout -`. [From the manpage:](http://git-scm.com/docs/git-checkout) > As a special case, the "@{-N}" syntax > for the N-th last branch checks out > the branch (instead of detaching). You > may also specify - which is synonymous > with "@{-1}".
1607337
git - changed file summary like svn diff --summarize/svn status from console (no gitk)
20
2009-10-22 13:47:20
<p><code>svn diff --summarize</code> shows the changes at the file level for a commit. Output it something like:</p> <pre><code> M modified-foo.bar D deleted-file.bar A new-file.bar </code></pre> <p>Similar to svn status, but for commits. I would be happy with output similar to git status, but for a particula...
10,436
12,034
2014-11-04 23:18:55
1,607,385
32
2009-10-22 13:53:05
89,364
2012-08-06 07:10:52
https://stackoverflow.com/q/1607337
https://stackoverflow.com/a/1607385
<pre><code>git diff &lt;commit&gt; --name-status </code></pre>
<pre><code>git diff &lt;commit&gt; --name-status </code></pre>
63, 119, 606
diff, git, svn
<h1>git - changed file summary like svn diff --summarize/svn status from console (no gitk)</h1> <p><code>svn diff --summarize</code> shows the changes at the file level for a commit. Output it something like:</p> <pre><code> M modified-foo.bar D deleted-file.bar A new-file.bar </code></pre> <p>Similar to svn ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,758
git
# git - changed file summary like svn diff --summarize/svn status from console (no gitk) `svn diff --summarize` shows the changes at the file level for a commit. Output it something like: ``` M modified-foo.bar D deleted-file.bar A new-file.bar ``` Similar to svn status, but for commits. I would be happy wi...
``` git diff <commit> --name-status ```
1220557
How do I prepend history to a Git repository?
20
2009-08-03 03:23:28
<p>I have a project that has existed in two SVN repositories. The second SVN repository was created simply by adding the repositories from a checkout of the old SVN repository without SCM information stripped. The content of the files are byte identical, but there is no associated SCM meta-data.</p> <p>I have taken t...
3,575
8,020
2018-07-18 19:00:03
1,547,490
32
2009-10-10 09:33:36
46,058
2018-07-18 19:00:03
https://stackoverflow.com/q/1220557
https://stackoverflow.com/a/1547490
<p><strong><em>See also:</em></strong> the <em>How do I re-play my commits of a local Git repository, on top of a project I forked on github.com?</em> question <em>(and my answer there)</em>, although the situation is slightly different, I think.</p> <hr> <p>You have at least three possibilities:</p> <ul> <li><p>Use...
<p><strong><em>See also:</em></strong> the <em>How do I re-play my commits of a local Git repository, on top of a project I forked on github.com?</em> question <em>(and my answer there)</em>, although the situation is slightly different, I think.</p> <hr> <p>You have at least three possibilities:</p> <ul> <li><p>Use...
63, 119, 6452
git, git-svn, svn
<h1>How do I prepend history to a Git repository?</h1> <p>I have a project that has existed in two SVN repositories. The second SVN repository was created simply by adding the repositories from a checkout of the old SVN repository without SCM information stripped. The content of the files are byte identical, but there...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,759
git
# How do I prepend history to a Git repository? I have a project that has existed in two SVN repositories. The second SVN repository was created simply by adding the repositories from a checkout of the old SVN repository without SCM information stripped. The content of the files are byte identical, but there is no ass...
***See also:*** the *How do I re-play my commits of a local Git repository, on top of a project I forked on github.com?* question *(and my answer there)*, although the situation is slightly different, I think. --- You have at least three possibilities: - Use **[grafts](http://git.or.cz/gitwiki/GraftPoint)** to join ...
53962583
How to add git hash to Vue.js Component
19
2018-12-28 18:05:53
<p>I want to create a vue.js component which will display the package.json version number and hash of most recent git commit. Here is the code so far:</p> <pre><code>&lt;template&gt; &lt;div class="versionLabel"&gt;Version: {{version}} (HASH)&lt;/div&gt; &lt;/template&gt; &lt;script lang="ts"&gt; import { Component...
9,835
9,540,018
2020-11-19 02:15:36
59,951,577
32
2020-01-28 15:02:38
907,575
2020-01-28 15:02:38
https://stackoverflow.com/q/53962583
https://stackoverflow.com/a/59951577
<p>Install <a href="https://www.npmjs.com/package/git-describe" rel="noreferrer">git-describe</a> as a dev dependency (e.g. <code>yarn add --dev git-describe</code>).</p> <p>In <code>vue.config.js</code> add:</p> <pre><code>const {gitDescribe, gitDescribeSync} = require('git-describe'); process.env.VUE_APP_GIT_HASH =...
<p>Install <a href="https://www.npmjs.com/package/git-describe" rel="noreferrer">git-describe</a> as a dev dependency (e.g. <code>yarn add --dev git-describe</code>).</p> <p>In <code>vue.config.js</code> add:</p> <pre><code>const {gitDescribe, gitDescribeSync} = require('git-describe'); process.env.VUE_APP_GIT_HASH =...
119, 8279, 46426, 104257, 119200
git, heroku, node.js, vue.js, vue-component
<h1>How to add git hash to Vue.js Component</h1> <p>I want to create a vue.js component which will display the package.json version number and hash of most recent git commit. Here is the code so far:</p> <pre><code>&lt;template&gt; &lt;div class="versionLabel"&gt;Version: {{version}} (HASH)&lt;/div&gt; &lt;/template...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,761
git
# How to add git hash to Vue.js Component I want to create a vue.js component which will display the package.json version number and hash of most recent git commit. Here is the code so far: ``` <template> <div class="versionLabel">Version: {{version}} (HASH)</div> </template> <script lang="ts"> import { Component,...
Install [git-describe](https://www.npmjs.com/package/git-describe) as a dev dependency (e.g. `yarn add --dev git-describe`). In `vue.config.js` add: ``` const {gitDescribe, gitDescribeSync} = require('git-describe'); process.env.VUE_APP_GIT_HASH = gitDescribeSync().hash ``` Now, in every component, we have `process....
36237537
brew doctor Warning: How to add git to PATH?
19
2016-03-26 16:07:43
<p>I installed Homebrew on OS X El Capitan. In the last steps of the installation I was supposed to install git with </p> <pre><code>brew install git </code></pre> <p>which was fine. Now if I run 'brew doctor' this happens:</p> <pre><code>$ brew doctor Please note that these warnings are just used to help the Homebr...
34,184
6,116,066
2025-07-26 15:33:56
38,408,656
32
2016-07-16 06:57:37
2,713,572
2025-07-26 15:33:56
https://stackoverflow.com/q/36237537
https://stackoverflow.com/a/38408656
<p>First, change directory to <code>/usr/local/Homebrew</code> in the Terminal (for older versions of MacOS, use <code>cd /usr/local/Library/Homebrew</code>). Then run this:</p> <pre><code>git pull origin master brew update &amp;&amp; brew upgrade </code></pre>
<p>First, change directory to <code>/usr/local/Homebrew</code> in the Terminal (for older versions of MacOS, use <code>cd /usr/local/Library/Homebrew</code>). Then run this:</p> <pre><code>git pull origin master brew update &amp;&amp; brew upgrade </code></pre>
119, 369, 1067, 6268
git, homebrew, macos, path
<h1>brew doctor Warning: How to add git to PATH?</h1> <p>I installed Homebrew on OS X El Capitan. In the last steps of the installation I was supposed to install git with </p> <pre><code>brew install git </code></pre> <p>which was fine. Now if I run 'brew doctor' this happens:</p> <pre><code>$ brew doctor Please not...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,763
git
# brew doctor Warning: How to add git to PATH? I installed Homebrew on OS X El Capitan. In the last steps of the installation I was supposed to install git with ``` brew install git ``` which was fine. Now if I run 'brew doctor' this happens: ``` $ brew doctor Please note that these warnings are just used to help t...
First, change directory to `/usr/local/Homebrew` in the Terminal (for older versions of MacOS, use `cd /usr/local/Library/Homebrew`). Then run this: ``` git pull origin master brew update && brew upgrade ```
35400416
What are some more forceful ways than a .gitignore to keep (force) files out of a repository?
19
2016-02-15 02:00:32
<p>People on my development team keep on pushing build-specific files (folder <em><a href="https://stackoverflow.com/questions/63294260/what-is-the-purpose-of-the-node-modules-folder">node_modules</a></em> and others) onto our repositories despite these files being in a <em>.gitignore</em> file, presumably with <code>g...
2,935
3,103,576
2022-02-13 12:29:13
35,400,472
32
2016-02-15 02:07:28
1,755,598
2022-02-13 12:24:25
https://stackoverflow.com/q/35400416
https://stackoverflow.com/a/35400472
<blockquote> <p>Is there some way I can make it totally impossible to push certain files onto a repository?</p> </blockquote> <p>Yep, you can use hooks like this to prevent several files to be committed.</p> <h2><em><strong><a href="https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks#pre-receive-KpTEIPiaik" rel="n...
<blockquote> <p>Is there some way I can make it totally impossible to push certain files onto a repository?</p> </blockquote> <p>Yep, you can use hooks like this to prevent several files to be committed.</p> <h2><em><strong><a href="https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks#pre-receive-KpTEIPiaik" rel="n...
119
git
<h1>What are some more forceful ways than a .gitignore to keep (force) files out of a repository?</h1> <p>People on my development team keep on pushing build-specific files (folder <em><a href="https://stackoverflow.com/questions/63294260/what-is-the-purpose-of-the-node-modules-folder">node_modules</a></em> and others)...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,764
git
# What are some more forceful ways than a .gitignore to keep (force) files out of a repository? People on my development team keep on pushing build-specific files (folder *[node_modules](https://stackoverflow.com/questions/63294260/what-is-the-purpose-of-the-node-modules-folder)* and others) onto our repositories desp...
> Is there some way I can make it totally impossible to push certain files onto a repository? Yep, you can use hooks like this to prevent several files to be committed. ## ***[`pre-receive hook`](https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks#pre-receive-KpTEIPiaik)*** ``` #!/bin/sh # Check to see if this...
25791533
unstaged files gone after git reset --hard
19
2014-09-11 15:31:34
<p>I tried the <code>git reset --hard HEAD@{n}</code> from <code>git reflog</code> and I lost everything with my current unstaged files :'(</p> <p>the unstaged files is the last <code>git add</code> I did, before then I tried <code>git reset</code> to the last <code>git commit</code>.</p> <p>And all my files gone, I ...
25,018
3,763,032
2024-09-19 22:04:37
25,792,257
32
2014-09-11 16:07:39
4,021,077
2018-04-09 17:51:09
https://stackoverflow.com/q/25791533
https://stackoverflow.com/a/25792257
<p>It's not clear if you lost files in your working directory, or files in the index. You say you lost your "unstaged files", but then you mention you might have run "git add". "unstaged files" are lost for good.</p> <p>Staged files can be recovered with</p> <pre><code>git fsck --full --unreachable --no-reflog </c...
<p>It's not clear if you lost files in your working directory, or files in the index. You say you lost your "unstaged files", but then you mention you might have run "git add". "unstaged files" are lost for good.</p> <p>Staged files can be recovered with</p> <pre><code>git fsck --full --unreachable --no-reflog </c...
119, 12626, 14215, 17492, 59545
addition, git, head, reflog, reset
<h1>unstaged files gone after git reset --hard</h1> <p>I tried the <code>git reset --hard HEAD@{n}</code> from <code>git reflog</code> and I lost everything with my current unstaged files :'(</p> <p>the unstaged files is the last <code>git add</code> I did, before then I tried <code>git reset</code> to the last <code>...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,765
git
# unstaged files gone after git reset --hard I tried the `git reset --hard HEAD@{n}` from `git reflog` and I lost everything with my current unstaged files :'( the unstaged files is the last `git add` I did, before then I tried `git reset` to the last `git commit`. And all my files gone, I can't go back to the `git ...
It's not clear if you lost files in your working directory, or files in the index. You say you lost your "unstaged files", but then you mention you might have run "git add". "unstaged files" are lost for good. Staged files can be recovered with ``` git fsck --full --unreachable --no-reflog ``` For each file added th...
21002310
In git, how do you revert a file back to 3 commits ago?
19
2014-01-08 17:19:15
<p>I changed an image file in git and it was 2 commits ago. How do I go back to 2 previous commits ago? </p> <p>What is the easiest method of doing this file revert via the command line with the least amount of commands required? </p>
13,014
1,642,231
2014-01-08 17:21:26
21,002,352
32
2014-01-08 17:21:26
216,074
2014-01-08 17:21:26
https://stackoverflow.com/q/21002310
https://stackoverflow.com/a/21002352
<p>Just check out the old version of that file:</p> <pre><code>git checkout HEAD~2 -- path/to/file </code></pre> <p>Or more explicit:</p> <pre><code>git checkout commit-id -- path/to/file </code></pre>
<p>Just check out the old version of that file:</p> <pre><code>git checkout HEAD~2 -- path/to/file </code></pre> <p>Or more explicit:</p> <pre><code>git checkout commit-id -- path/to/file </code></pre>
119, 34403
git, git-revert
<h1>In git, how do you revert a file back to 3 commits ago?</h1> <p>I changed an image file in git and it was 2 commits ago. How do I go back to 2 previous commits ago? </p> <p>What is the easiest method of doing this file revert via the command line with the least amount of commands required? </p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,766
git
# In git, how do you revert a file back to 3 commits ago? I changed an image file in git and it was 2 commits ago. How do I go back to 2 previous commits ago? What is the easiest method of doing this file revert via the command line with the least amount of commands required?
Just check out the old version of that file: ``` git checkout HEAD~2 -- path/to/file ``` Or more explicit: ``` git checkout commit-id -- path/to/file ```
11113632
Why doesn't git attempt to merge changes to renamed files?
19
2012-06-20 06:01:35
<p>Let's say I have a file that's</p> <ol> <li>Modified in master</li> <li>Modified in a feature branch</li> <li>Renamed in a feature branch</li> </ol> <p>When I try to merge up from master to the feature branch, merge fails with</p> <blockquote> <p>CONFLICT (modify/delete): X deleted in HEAD and modified in origi...
6,500
23,643
2012-06-20 08:10:28
11,115,331
32
2012-06-20 08:10:28
19,531
2012-06-20 08:10:28
https://stackoverflow.com/q/11113632
https://stackoverflow.com/a/11115331
<p>Because there is actually no concept of first-class rename operation in git, it just "detects" renames using a threshold for file differences. Your files are probably too different.</p> <p>Try merging with: <code>git merge master -s recursive -X rename-threshold=5%</code></p>
<p>Because there is actually no concept of first-class rename operation in git, it just "detects" renames using a threshold for file differences. Your files are probably too different.</p> <p>Try merging with: <code>git merge master -s recursive -X rename-threshold=5%</code></p>
119, 717
git, merge
<h1>Why doesn't git attempt to merge changes to renamed files?</h1> <p>Let's say I have a file that's</p> <ol> <li>Modified in master</li> <li>Modified in a feature branch</li> <li>Renamed in a feature branch</li> </ol> <p>When I try to merge up from master to the feature branch, merge fails with</p> <blockquote> ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,767
git
# Why doesn't git attempt to merge changes to renamed files? Let's say I have a file that's 1. Modified in master 2. Modified in a feature branch 3. Renamed in a feature branch When I try to merge up from master to the feature branch, merge fails with > CONFLICT (modify/delete): X deleted in HEAD and modified in or...
Because there is actually no concept of first-class rename operation in git, it just "detects" renames using a threshold for file differences. Your files are probably too different. Try merging with: `git merge master -s recursive -X rename-threshold=5%`
50032989
How can I determine whether a file in git is executable?
18
2018-04-26 00:10:50
<p>If I have a file in a git repository, how can I determine whether a given revision of the file is executable or not?</p> <p>I know that git keeps track of whether files are executable or not, and <code>git show</code> will show changes in execute permissions. For example, the output of <code>git show</code> on a g...
6,938
827,263
2018-04-26 00:32:17
50,033,081
32
2018-04-26 00:25:12
354,577
2018-04-26 00:32:17
https://stackoverflow.com/q/50032989
https://stackoverflow.com/a/50033081
<p>Use <a href="https://git-scm.com/docs/git-ls-tree" rel="noreferrer"><code>git ls-tree</code></a>, passing in the ref and file path you want to inspect.</p> <p>For example, <code>git ls-tree HEAD foo.txt</code> will give something like</p> <pre><code>100644 blob 3e1d68d0714fd3d46ec22a685e317f0cf47f5e83 foo.txt <...
<p>Use <a href="https://git-scm.com/docs/git-ls-tree" rel="noreferrer"><code>git ls-tree</code></a>, passing in the ref and file path you want to inspect.</p> <p>For example, <code>git ls-tree HEAD foo.txt</code> will give something like</p> <pre><code>100644 blob 3e1d68d0714fd3d46ec22a685e317f0cf47f5e83 foo.txt <...
119
git
<h1>How can I determine whether a file in git is executable?</h1> <p>If I have a file in a git repository, how can I determine whether a given revision of the file is executable or not?</p> <p>I know that git keeps track of whether files are executable or not, and <code>git show</code> will show changes in execute per...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,768
git
# How can I determine whether a file in git is executable? If I have a file in a git repository, how can I determine whether a given revision of the file is executable or not? I know that git keeps track of whether files are executable or not, and `git show` will show changes in execute permissions. For example, the ...
Use [`git ls-tree`](https://git-scm.com/docs/git-ls-tree), passing in the ref and file path you want to inspect. For example, `git ls-tree HEAD foo.txt` will give something like ``` 100644 blob 3e1d68d0714fd3d46ec22a685e317f0cf47f5e83 foo.txt ``` The 644 in the first column indicates a non-executable file. 755 wo...
47183452
how to do an export for git stash
18
2017-11-08 15:23:24
<p>I want to export one stash (the changes) that I see in my stash list in a <code>.zip/.gz</code> file. I have found the following command:</p> <pre><code>git stash show -p &gt; patch </code></pre> <p>which saves the changes in a file, but I also want to keep <code>.png</code> files, etc... I am looking for a way to...
15,560
8,259,546
2023-08-13 21:59:54
47,184,355
32
2017-11-08 16:05:11
4,620,609
2017-11-08 16:12:16
https://stackoverflow.com/q/47183452
https://stackoverflow.com/a/47184355
<p>Try it with <code>--binary</code> option to export</p> <pre><code>git stash show -p --binary &gt; changes.patch </code></pre> <p>When you want to import it, apply the patch </p> <pre><code>git apply changes.patch </code></pre>
<p>Try it with <code>--binary</code> option to export</p> <pre><code>git stash show -p --binary &gt; changes.patch </code></pre> <p>When you want to import it, apply the patch </p> <pre><code>git apply changes.patch </code></pre>
119
git
<h1>how to do an export for git stash</h1> <p>I want to export one stash (the changes) that I see in my stash list in a <code>.zip/.gz</code> file. I have found the following command:</p> <pre><code>git stash show -p &gt; patch </code></pre> <p>which saves the changes in a file, but I also want to keep <code>.png</co...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,769
git
# how to do an export for git stash I want to export one stash (the changes) that I see in my stash list in a `.zip/.gz` file. I have found the following command: ``` git stash show -p > patch ``` which saves the changes in a file, but I also want to keep `.png` files, etc... I am looking for a way to compress **all...
Try it with `--binary` option to export ``` git stash show -p --binary > changes.patch ``` When you want to import it, apply the patch ``` git apply changes.patch ```
23944414
Revert changes to a specific file from a specific commit
18
2014-05-29 23:02:31
<p>A few weeks ago (i.e. many commits ago), I made a git commit that touched many files. Most of the commit was great.</p> <p><strong>However, I'd now like to undo the changes that I'd made to just one of those files, but I don't want to override any changes that had been made to that file <em>after</em> that commit....
5,386
470,749
2014-05-30 04:47:52
23,944,529
32
2014-05-29 23:13:28
1,256,452
2014-05-29 23:13:28
https://stackoverflow.com/q/23944414
https://stackoverflow.com/a/23944529
<p>Get a patch-ready diff for that file in that commit, and then reverse-apply the patch:</p> <pre><code>git show &lt;commit-id&gt; -- &lt;path&gt; | git apply -R - </code></pre> <p>Make sure you like the result, and if so, add and commit with appropriate message.</p>
<p>Get a patch-ready diff for that file in that commit, and then reverse-apply the patch:</p> <pre><code>git show &lt;commit-id&gt; -- &lt;path&gt; | git apply -R - </code></pre> <p>Make sure you like the result, and if so, add and commit with appropriate message.</p>
119
git
<h1>Revert changes to a specific file from a specific commit</h1> <p>A few weeks ago (i.e. many commits ago), I made a git commit that touched many files. Most of the commit was great.</p> <p><strong>However, I'd now like to undo the changes that I'd made to just one of those files, but I don't want to override any c...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,770
git
# Revert changes to a specific file from a specific commit A few weeks ago (i.e. many commits ago), I made a git commit that touched many files. Most of the commit was great. **However, I'd now like to undo the changes that I'd made to just one of those files, but I don't want to override any changes that had been ma...
Get a patch-ready diff for that file in that commit, and then reverse-apply the patch: ``` git show <commit-id> -- <path> | git apply -R - ``` Make sure you like the result, and if so, add and commit with appropriate message.
11473150
Git push failed after 'git reset --hard HEAD~1' of local repo
18
2012-07-13 15:05:20
<p>I have a local git repo on my workstation which I push to a dropbox location so that I can pull it down to my laptop via <code>git pull remote dropbox</code>.</p> <p>Yesterday I checked in a change on my workstation, committed it and <code>git push dropbox</code>'ed it. I did not do a <code>git pull</code> from my...
14,261
241,536
2012-07-13 15:07:18
11,473,185
32
2012-07-13 15:07:18
888,641
2012-07-13 15:07:18
https://stackoverflow.com/q/11473150
https://stackoverflow.com/a/11473185
<p>Force push should work: <code>git push -f dropbox</code></p> <p>Git is complaining because your remote still has that extra commit, and thus you are behind it in terms of history.</p>
<p>Force push should work: <code>git push -f dropbox</code></p> <p>Git is complaining because your remote still has that extra commit, and thus you are behind it in terms of history.</p>
119
git
<h1>Git push failed after 'git reset --hard HEAD~1' of local repo</h1> <p>I have a local git repo on my workstation which I push to a dropbox location so that I can pull it down to my laptop via <code>git pull remote dropbox</code>.</p> <p>Yesterday I checked in a change on my workstation, committed it and <code>git p...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,771
git
# Git push failed after 'git reset --hard HEAD~1' of local repo I have a local git repo on my workstation which I push to a dropbox location so that I can pull it down to my laptop via `git pull remote dropbox`. Yesterday I checked in a change on my workstation, committed it and `git push dropbox`'ed it. I did not do...
Force push should work: `git push -f dropbox` Git is complaining because your remote still has that extra commit, and thus you are behind it in terms of history.
29559053
force update the current branch - how?
17
2015-04-10 10:25:18
<p>I'm on the <code>my-backup</code> branch. Now I do <code>git fetch origin my-backup</code> and <code>origin/my-backup</code> is updated and I see that it was forced pushed. Now I need to updated my local <code>my-backup</code> branch to point to <code>origin/my-backup</code> branch. I do <code>git branch -f my-backu...
21,197
2,545,680
2023-10-30 11:22:30
29,559,362
32
2015-04-10 10:40:05
2,462,524
2017-01-24 01:56:06
https://stackoverflow.com/q/29559053
https://stackoverflow.com/a/29559362
<p>Use <code>reset</code></p> <pre><code>git reset --hard origin/my-backup </code></pre> <p>This will reset your current branch (<code>my-backup</code>) with losing all your local changes.</p> <hr> <p><code>git branch -f my-backup origin/my-backup</code> is allowed only if your current branch is not <code>my-backup...
<p>Use <code>reset</code></p> <pre><code>git reset --hard origin/my-backup </code></pre> <p>This will reset your current branch (<code>my-backup</code>) with losing all your local changes.</p> <hr> <p><code>git branch -f my-backup origin/my-backup</code> is allowed only if your current branch is not <code>my-backup...
119
git
<h1>force update the current branch - how?</h1> <p>I'm on the <code>my-backup</code> branch. Now I do <code>git fetch origin my-backup</code> and <code>origin/my-backup</code> is updated and I see that it was forced pushed. Now I need to updated my local <code>my-backup</code> branch to point to <code>origin/my-backup<...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,772
git
# force update the current branch - how? I'm on the `my-backup` branch. Now I do `git fetch origin my-backup` and `origin/my-backup` is updated and I see that it was forced pushed. Now I need to updated my local `my-backup` branch to point to `origin/my-backup` branch. I do `git branch -f my-backup origin/my-backup` b...
Use `reset` ``` git reset --hard origin/my-backup ``` This will reset your current branch (`my-backup`) with losing all your local changes. --- `git branch -f my-backup origin/my-backup` is allowed only if your current branch is not `my-backup`.
37174130
Pushing to a remote branch (failed to update ref)
16
2016-05-11 22:11:59
<p>I have a remote repository with a feature/initital-change branch. Now I want to push some files to this remote branch from my local feature/initital-change branch.</p> <p>I went through a few posts on pushing to remote branches and tried out a few methods but I am still getting the same error. After adding and comm...
23,858
6,021,490
2018-01-26 16:34:46
42,846,055
32
2017-03-16 22:37:11
2,786,215
2017-03-16 22:37:11
https://stackoverflow.com/q/37174130
https://stackoverflow.com/a/42846055
<p>This can happen when two branches are created, one with a slash <code>/</code> and one without a slash, where the branch without the slash is the prefix of the other branch.</p> <h2>Example</h2> <p>Consider these two valid branch names:</p> <ul> <li><code>feature</code></li> <li><code>feature/initial-change</code...
<p>This can happen when two branches are created, one with a slash <code>/</code> and one without a slash, where the branch without the slash is the prefix of the other branch.</p> <h2>Example</h2> <p>Consider these two valid branch names:</p> <ul> <li><code>feature</code></li> <li><code>feature/initial-change</code...
119, 1879, 4236, 7330, 8337
bitbucket, branch, git, push, repository
<h1>Pushing to a remote branch (failed to update ref)</h1> <p>I have a remote repository with a feature/initital-change branch. Now I want to push some files to this remote branch from my local feature/initital-change branch.</p> <p>I went through a few posts on pushing to remote branches and tried out a few methods b...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,774
git
# Pushing to a remote branch (failed to update ref) I have a remote repository with a feature/initital-change branch. Now I want to push some files to this remote branch from my local feature/initital-change branch. I went through a few posts on pushing to remote branches and tried out a few methods but I am still ge...
This can happen when two branches are created, one with a slash `/` and one without a slash, where the branch without the slash is the prefix of the other branch. ## Example Consider these two valid branch names: - `feature` - `feature/initial-change` When you fetch these branches from the remote to your local mach...
2652167
How do I calculate the distance between two points of latitude and longitude?
16
2010-04-16 10:29:50
<p>i have latitude and longitude of particular place and i want to calculate the distance so how can i calculate it?</p>
19,638
198,680
2012-03-12 01:41:17
2,652,300
32
2010-04-16 10:53:10
76,799
2012-03-12 01:41:17
https://stackoverflow.com/q/2652167
https://stackoverflow.com/a/2652300
<pre><code>CLLocation *location1 = [[CLLocation alloc] initWithLatitude:lat1 longitude:long1]; CLLocation *location2 = [[CLLocation alloc] initWithLatitude:lat2 longitude:long2]; NSLog(@"Distance i meters: %f", [location1 distanceFromLocation:location2]); [location1 release]; [location2 release]; </code></pre> <p>You ...
<pre><code>CLLocation *location1 = [[CLLocation alloc] initWithLatitude:lat1 longitude:long1]; CLLocation *location2 = [[CLLocation alloc] initWithLatitude:lat2 longitude:long2]; NSLog(@"Distance i meters: %f", [location1 distanceFromLocation:location2]); [location1 release]; [location2 release]; </code></pre> <p>You ...
154, 259, 1834, 20301, 24852
coordinates, dictionary, iphone, latitude-longitude, math
<h1>How do I calculate the distance between two points of latitude and longitude?</h1> <p>i have latitude and longitude of particular place and i want to calculate the distance so how can i calculate it?</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,775
git
# How do I calculate the distance between two points of latitude and longitude? i have latitude and longitude of particular place and i want to calculate the distance so how can i calculate it?
``` CLLocation *location1 = [[CLLocation alloc] initWithLatitude:lat1 longitude:long1]; CLLocation *location2 = [[CLLocation alloc] initWithLatitude:lat2 longitude:long2]; NSLog(@"Distance i meters: %f", [location1 distanceFromLocation:location2]); [location1 release]; [location2 release]; ``` You also need to add `Co...
46711492
git commit error : name consists only of disallowed characters:
15
2017-10-12 13:55:49
<p>create a new git project and only add README.txt when I commit, an error occurred.</p> <p><img src="https://i.sstatic.net/450wN.jpg" alt="enter image description here"></p>
18,734
8,765,649
2023-09-20 12:56:05
46,711,619
32
2017-10-12 14:01:59
7,293,102
2017-10-12 14:01:59
https://stackoverflow.com/q/46711492
https://stackoverflow.com/a/46711619
<p>The Problem here seems to be your username. Check it with <code>git config --list</code>. You can change it with </p> <blockquote> <p>$ git config --global user.name "validName"</p> </blockquote>
<p>The Problem here seems to be your username. Check it with <code>git config --list</code>. You can change it with </p> <blockquote> <p>$ git config --global user.name "validName"</p> </blockquote>
119
git
<h1>git commit error : name consists only of disallowed characters:</h1> <p>create a new git project and only add README.txt when I commit, an error occurred.</p> <p><img src="https://i.sstatic.net/450wN.jpg" alt="enter image description here"></p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,776
git
# git commit error : name consists only of disallowed characters: create a new git project and only add README.txt when I commit, an error occurred. ![enter image description here](https://i.sstatic.net/450wN.jpg)
The Problem here seems to be your username. Check it with `git config --list`. You can change it with > $ git config --global user.name "validName"
60094306
How to fix "warning: symbolic ref is dangling" in git
14
2020-02-06 11:49:21
<p>Recently I started to notice that on one of my git repositories, any git command I run, I get the following warning:</p> <p><code>warning: symbolic ref is dangling: refs/remotes/origin/HEAD</code></p> <p><strong>What does this mean and how do I fix it?</strong></p>
4,664
9,358,535
2023-04-04 12:33:13
60,102,988
32
2020-02-06 20:26:40
1,256,452
2020-02-07 01:03:20
https://stackoverflow.com/q/60094306
https://stackoverflow.com/a/60102988
<h3>How to fix it</h3> <p>Because this particular symbolic ref is not useful anyway, I recommend just deleting it:</p> <pre><code>git remote set-head origin --delete </code></pre> <p>If you like having this useless symbolic ref, you can have your Git auto-update it instead:</p> <pre><code>git remote set-head origin...
<h3>How to fix it</h3> <p>Because this particular symbolic ref is not useful anyway, I recommend just deleting it:</p> <pre><code>git remote set-head origin --delete </code></pre> <p>If you like having this useless symbolic ref, you can have your Git auto-update it instead:</p> <pre><code>git remote set-head origin...
119, 7330
git, repository
<h1>How to fix "warning: symbolic ref is dangling" in git</h1> <p>Recently I started to notice that on one of my git repositories, any git command I run, I get the following warning:</p> <p><code>warning: symbolic ref is dangling: refs/remotes/origin/HEAD</code></p> <p><strong>What does this mean and how do I fix it?...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,780
git
# How to fix "warning: symbolic ref is dangling" in git Recently I started to notice that on one of my git repositories, any git command I run, I get the following warning: `warning: symbolic ref is dangling: refs/remotes/origin/HEAD` **What does this mean and how do I fix it?**
### How to fix it Because this particular symbolic ref is not useful anyway, I recommend just deleting it: ``` git remote set-head origin --delete ``` If you like having this useless symbolic ref, you can have your Git auto-update it instead: ``` git remote set-head origin --auto ``` This will have your Git call u...
39282911
Heroku/python failed to detect set buildpack
14
2016-09-02 01:02:11
<p>I'm a Django newbie, I created an app and want to deploy it using Heroku. However, when I do <code>git push heroku master</code> (I follow Heroku's getting started), this is what I got:</p> <pre><code>Counting objects: 36, done. Delta compression using up to 4 threads. Compressing objects: 100% (33/33), done. Writi...
15,299
null
2019-02-16 08:13:34
39,283,046
32
2016-09-02 01:23:34
6,464,893
2016-12-28 13:57:57
https://stackoverflow.com/q/39282911
https://stackoverflow.com/a/39283046
<p>You need to add a <code>requirements.txt</code> file which contains all of the modules required to run your application.</p> <p>You can do <code>pip freeze &gt; requirements.txt</code> to freeze all of your modules into a file. I would only recommend doing this if you're using a virtualenv because otherwise it will...
<p>You need to add a <code>requirements.txt</code> file which contains all of the modules required to run your application.</p> <p>You can do <code>pip freeze &gt; requirements.txt</code> to freeze all of your modules into a file. I would only recommend doing this if you're using a virtualenv because otherwise it will...
16, 119, 190, 243, 8279
deployment, django, git, heroku, python
<h1>Heroku/python failed to detect set buildpack</h1> <p>I'm a Django newbie, I created an app and want to deploy it using Heroku. However, when I do <code>git push heroku master</code> (I follow Heroku's getting started), this is what I got:</p> <pre><code>Counting objects: 36, done. Delta compression using up to 4 t...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,781
git
# Heroku/python failed to detect set buildpack I'm a Django newbie, I created an app and want to deploy it using Heroku. However, when I do `git push heroku master` (I follow Heroku's getting started), this is what I got: ``` Counting objects: 36, done. Delta compression using up to 4 threads. Compressing objects: 10...
You need to add a `requirements.txt` file which contains all of the modules required to run your application. You can do `pip freeze > requirements.txt` to freeze all of your modules into a file. I would only recommend doing this if you're using a virtualenv because otherwise it will add ALL of your modules. Anyways,...
20883936
How to apply this mutt sidebar patch?
14
2014-01-02 13:20:39
<p>Since the homebrew guys now have removed the option of appying the mutt sidebar patch during installation i went searching and found someone who had created an updated mutt sidebar patch for version 1.5.22 of mutt (every mutt sidebar versions seems to always be incompatible with the previous or the next).</p> <p>Th...
6,728
null
2017-05-24 13:24:59
23,226,399
32
2014-04-22 17:31:50
3,521,438
2017-05-24 13:24:59
https://stackoverflow.com/q/20883936
https://stackoverflow.com/a/23226399
<p><strong>UPDATE</strong></p> <p>This answer has become a bit out of date. Thankfully some people have created some homebrew taps to solve this problem for us and make it much simpler. All you have to do now is the following:</p> <pre><code>brew uninstall mutt brew tap sgeb/mutt brew install sgeb/mutt/mutt --with-si...
<p><strong>UPDATE</strong></p> <p>This answer has become a bit out of date. Thankfully some people have created some homebrew taps to solve this problem for us and make it much simpler. All you have to do now is the following:</p> <pre><code>brew uninstall mutt brew tap sgeb/mutt brew install sgeb/mutt/mutt --with-si...
119, 369, 2132, 20540
git, macos, mutt, patch
<h1>How to apply this mutt sidebar patch?</h1> <p>Since the homebrew guys now have removed the option of appying the mutt sidebar patch during installation i went searching and found someone who had created an updated mutt sidebar patch for version 1.5.22 of mutt (every mutt sidebar versions seems to always be incompat...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,782
git
# How to apply this mutt sidebar patch? Since the homebrew guys now have removed the option of appying the mutt sidebar patch during installation i went searching and found someone who had created an updated mutt sidebar patch for version 1.5.22 of mutt (every mutt sidebar versions seems to always be incompatible with...
**UPDATE** This answer has become a bit out of date. Thankfully some people have created some homebrew taps to solve this problem for us and make it much simpler. All you have to do now is the following: ``` brew uninstall mutt brew tap sgeb/mutt brew install sgeb/mutt/mutt --with-sidebar-patch ``` If you want to in...
29485350
Git case-sensitivity error -- renaming and committing from Android Studio
13
2015-04-07 06:40:14
<p><br /> For example, I have a file named <code>FOOBar.java</code> that I want to rename to <code>FooBar.java</code>. After trying lots of stuff, I get the error: <br /></p> <blockquote> <p><img src="https://i.sstatic.net/zZsPs.png" alt="enter image description here"> <br /><br /> <code>Error:error: pathspec 'app/s...
15,024
1,298,685
2016-05-17 11:51:19
29,485,441
32
2015-04-07 06:45:13
216,074
2015-04-07 06:45:13
https://stackoverflow.com/q/29485350
https://stackoverflow.com/a/29485441
<p>Windows’ file system is mostly case-insensitive, so you cannot rename a file by just changing its capitalization. Instead, you will have to use a temporary name in between.</p> <p>Try the following from the command line:</p> <pre><code>git mv FOOBar.java FooBar.java.new git mv FooBar.java.new FooBar.java git commi...
<p>Windows’ file system is mostly case-insensitive, so you cannot rename a file by just changing its capitalization. Instead, you will have to use a temporary name in between.</p> <p>Try the following from the command line:</p> <pre><code>git mv FOOBar.java FooBar.java.new git mv FooBar.java.new FooBar.java git commi...
119, 9708, 91905
android-studio, case-sensitive, git
<h1>Git case-sensitivity error -- renaming and committing from Android Studio</h1> <p><br /> For example, I have a file named <code>FOOBar.java</code> that I want to rename to <code>FooBar.java</code>. After trying lots of stuff, I get the error: <br /></p> <blockquote> <p><img src="https://i.sstatic.net/zZsPs.png" ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,783
git
# Git case-sensitivity error -- renaming and committing from Android Studio For example, I have a file named `FOOBar.java` that I want to rename to `FooBar.java`. After trying lots of stuff, I get the error: > ![enter image description here](https://i.sstatic.net/zZsPs.png) > > `Error:error: pathspec 'app/src/...
Windows’ file system is mostly case-insensitive, so you cannot rename a file by just changing its capitalization. Instead, you will have to use a temporary name in between. Try the following from the command line: ``` git mv FOOBar.java FooBar.java.new git mv FooBar.java.new FooBar.java git commit -m 'Rename file' ``...
16666009
How do I use vim as 'git log' editor?
13
2013-05-21 09:02:12
<p>When I run <code>git log</code>, what exactly is the editor <code>git log</code> is using? </p> <p>Also: </p> <ol> <li>Is there anyway I can use <code>vim</code> as my default editor for <code>git log</code>?</li> <li>If I want to search against the git log, what's the best way? Now I'm doing something like: <code...
15,415
1,275,937
2021-07-04 04:30:49
16,666,055
32
2013-05-21 09:04:33
null
2013-05-21 09:11:02
https://stackoverflow.com/q/16666009
https://stackoverflow.com/a/16666055
<p>The <code>git log</code> command pipes it's output by default into a <em>pager</em>, not an editor. This pager is usually <code>less</code> or <code>more</code> on most systems. You can change the default pager to <code>vim</code> with the command:</p> <pre><code>git config --global core.pager 'vim -' </code></pre>...
<p>The <code>git log</code> command pipes it's output by default into a <em>pager</em>, not an editor. This pager is usually <code>less</code> or <code>more</code> on most systems. You can change the default pager to <code>vim</code> with the command:</p> <pre><code>git config --global core.pager 'vim -' </code></pre>...
119, 370, 33345, 47913
git, git-log, pager, vim
<h1>How do I use vim as 'git log' editor?</h1> <p>When I run <code>git log</code>, what exactly is the editor <code>git log</code> is using? </p> <p>Also: </p> <ol> <li>Is there anyway I can use <code>vim</code> as my default editor for <code>git log</code>?</li> <li>If I want to search against the git log, what's th...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,785
git
# How do I use vim as 'git log' editor? When I run `git log`, what exactly is the editor `git log` is using? Also: 1. Is there anyway I can use `vim` as my default editor for `git log`? 2. If I want to search against the git log, what's the best way? Now I'm doing something like: `git log | grep bla`.
The `git log` command pipes it's output by default into a *pager*, not an editor. This pager is usually `less` or `more` on most systems. You can change the default pager to `vim` with the command: ``` git config --global core.pager 'vim -' ``` Now you can search using `vim` functionality with `/` as usual.
15335407
Is it possible to set a Git config for all users in a system?
12
2013-03-11 09:46:44
<p>Suppose I need to set a git alias that every user in the system has to use. Instead of asking each user to add this config to their <code>$HOME/.gitconfig</code>, is it possible to declare this once globally for all users?</p>
11,749
390,522
2013-03-11 10:18:06
15,335,659
32
2013-03-11 09:59:22
520,162
2013-03-11 10:18:06
https://stackoverflow.com/q/15335407
https://stackoverflow.com/a/15335659
<p>The <a href="https://www.kernel.org/pub/software/scm/git/docs/git-config.html#FILES">docs</a> say:</p> <blockquote> <p>If not set explicitly with <code>--file</code>, there are four files where <code>git config</code> will search for configuration options: </p> <p><strong><code>$GIT_DIR/config</code></strong...
<p>The <a href="https://www.kernel.org/pub/software/scm/git/docs/git-config.html#FILES">docs</a> say:</p> <blockquote> <p>If not set explicitly with <code>--file</code>, there are four files where <code>git config</code> will search for configuration options: </p> <p><strong><code>$GIT_DIR/config</code></strong...
119
git
<h1>Is it possible to set a Git config for all users in a system?</h1> <p>Suppose I need to set a git alias that every user in the system has to use. Instead of asking each user to add this config to their <code>$HOME/.gitconfig</code>, is it possible to declare this once globally for all users?</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,787
git
# Is it possible to set a Git config for all users in a system? Suppose I need to set a git alias that every user in the system has to use. Instead of asking each user to add this config to their `$HOME/.gitconfig`, is it possible to declare this once globally for all users?
The [docs](https://www.kernel.org/pub/software/scm/git/docs/git-config.html#FILES) say: > If not set explicitly with `--file`, there are four files where `git config` will search for configuration options: > > **`$GIT_DIR/config`** > Repository specific configuration file. > > **`~/.gitconfig`** > User-specific co...
3755529
git remote doesn't seem to be working at all
12
2010-09-20 21:09:13
<p>I'm following along with the railstutorial.org, and when I get to the "git push heroku master" part, I get the following error:</p> <pre><code>fatal: Not a git repository (or any of the parent directories): .git </code></pre> <p>So I do some googling, and see a common troubleshooting trick is to try "git remote -v...
21,529
142,486
2023-05-11 03:26:34
3,809,886
32
2010-09-28 05:21:12
122,864
2010-09-28 05:21:12
https://stackoverflow.com/q/3755529
https://stackoverflow.com/a/3809886
<p>You need to actually create the git repo. Simply calling 'heroku create' won't set one up for you. For an existing folder, you want enter it and run something like:</p> <pre><code>git init git add . git commit -m 'Initial commit' </code></pre> <p>...and then you add the remote (fill in your heroku git repo name fr...
<p>You need to actually create the git repo. Simply calling 'heroku create' won't set one up for you. For an existing folder, you want enter it and run something like:</p> <pre><code>git init git add . git commit -m 'Initial commit' </code></pre> <p>...and then you add the remote (fill in your heroku git repo name fr...
119, 8279
git, heroku
<h1>git remote doesn't seem to be working at all</h1> <p>I'm following along with the railstutorial.org, and when I get to the "git push heroku master" part, I get the following error:</p> <pre><code>fatal: Not a git repository (or any of the parent directories): .git </code></pre> <p>So I do some googling, and see a...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,788
git
# git remote doesn't seem to be working at all I'm following along with the railstutorial.org, and when I get to the "git push heroku master" part, I get the following error: ``` fatal: Not a git repository (or any of the parent directories): .git ``` So I do some googling, and see a common troubleshooting trick is ...
You need to actually create the git repo. Simply calling 'heroku create' won't set one up for you. For an existing folder, you want enter it and run something like: ``` git init git add . git commit -m 'Initial commit' ``` ...and then you add the remote (fill in your heroku git repo name from `heroku info` here): ``...
59652396
change package-lock.json package back to original repo version
11
2020-01-08 19:11:37
<p>I'm working on a git pull request for Mocha.</p> <p>I'm running into an error related to my package-lock.json file in where I accidentally updated the package ansi-regex from 2.1.1 to 3.0.0</p> <p>I'm now having issues getting this version back to it's original, which was requested by the repo owners. </p> <p>The...
28,280
3,022,433
2023-10-04 05:59:48
59,654,694
32
2020-01-08 22:27:55
86,072
2020-01-08 22:27:55
https://stackoverflow.com/q/59652396
https://stackoverflow.com/a/59654694
<p>You need to find the ID of a commit before the one where you modified <code>package-lock.json</code>, and restore the content of <code>package-lock.json</code> from that commit.</p> <hr> <p>Using the command line (open <code>git-bash</code> for example) :</p> <ul> <li><p>You can view the list of commits that modi...
<p>You need to find the ID of a commit before the one where you modified <code>package-lock.json</code>, and restore the content of <code>package-lock.json</code> from that commit.</p> <hr> <p>Using the command line (open <code>git-bash</code> for example) :</p> <ul> <li><p>You can view the list of commits that modi...
119, 61387
git, npm
<h1>change package-lock.json package back to original repo version</h1> <p>I'm working on a git pull request for Mocha.</p> <p>I'm running into an error related to my package-lock.json file in where I accidentally updated the package ansi-regex from 2.1.1 to 3.0.0</p> <p>I'm now having issues getting this version bac...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,789
git
# change package-lock.json package back to original repo version I'm working on a git pull request for Mocha. I'm running into an error related to my package-lock.json file in where I accidentally updated the package ansi-regex from 2.1.1 to 3.0.0 I'm now having issues getting this version back to it's original, whi...
You need to find the ID of a commit before the one where you modified `package-lock.json`, and restore the content of `package-lock.json` from that commit. --- Using the command line (open `git-bash` for example) : - You can view the list of commits that modified `package-lock.json` using : ``` git log package-...
28927478
Reset git settings
11
2015-03-08 14:21:08
<p>When I try downloading <a href="https://git01.codeplex.com/casablanca" rel="noreferrer">this</a> git repo I keep getting <code>error: RPC failed; result=56, HTTP code = 200</code> and I think this is because I messed up some settings (i was playing about with <code>--config</code> and <code>--bare</code> today)</p> ...
37,745
3,549,629
2015-03-08 14:25:30
28,927,520
32
2015-03-08 14:25:30
229,044
2015-03-08 14:25:30
https://stackoverflow.com/q/28927478
https://stackoverflow.com/a/28927520
<p>Git settings are stored in <code>~/.gitconfig</code>. Just delete that file.</p>
<p>Git settings are stored in <code>~/.gitconfig</code>. Just delete that file.</p>
119
git
<h1>Reset git settings</h1> <p>When I try downloading <a href="https://git01.codeplex.com/casablanca" rel="noreferrer">this</a> git repo I keep getting <code>error: RPC failed; result=56, HTTP code = 200</code> and I think this is because I messed up some settings (i was playing about with <code>--config</code> and <co...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,790
git
# Reset git settings When I try downloading [this](https://git01.codeplex.com/casablanca) git repo I keep getting `error: RPC failed; result=56, HTTP code = 200` and I think this is because I messed up some settings (i was playing about with `--config` and `--bare` today) Is there a way how I can reset my git configu...
Git settings are stored in `~/.gitconfig`. Just delete that file.
19495141
Add local repo for existing Xcode 5 Project
8
2013-10-21 12:55:30
<p>I've running through a Xcode 5 tutorial and want to make some significant changes, but want to make this Xcode 5 project into a repository.</p> <p>I've done some reading and you can add a repository by going to Xcode -> Preferences -> Accounts -> Add Respository -> Enter the repository address:</p> <p>So what woul...
14,482
2,608,538
2014-09-12 08:43:04
19,495,244
32
2013-10-21 12:58:55
299,924
2014-09-12 08:43:04
https://stackoverflow.com/q/19495141
https://stackoverflow.com/a/19495244
<p>I would do this from the command line.</p> <ol> <li>Close <code>Xcode.app</code></li> <li>Open <code>Terminal.app</code></li> <li><code>$ cd /path/to/project/dir</code></li> <li><code>$ git init .</code></li> <li>Create a <code>.gitignore</code> file to ignore some of the Xcode and output files that you don't want ...
<p>I would do this from the command line.</p> <ol> <li>Close <code>Xcode.app</code></li> <li>Open <code>Terminal.app</code></li> <li><code>$ cd /path/to/project/dir</code></li> <li><code>$ git init .</code></li> <li>Create a <code>.gitignore</code> file to ignore some of the Xcode and output files that you don't want ...
119, 908, 58338, 92815
git, ios, xcode, xcode5
<h1>Add local repo for existing Xcode 5 Project</h1> <p>I've running through a Xcode 5 tutorial and want to make some significant changes, but want to make this Xcode 5 project into a repository.</p> <p>I've done some reading and you can add a repository by going to Xcode -> Preferences -> Accounts -> Add Respository ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,791
git
# Add local repo for existing Xcode 5 Project I've running through a Xcode 5 tutorial and want to make some significant changes, but want to make this Xcode 5 project into a repository. I've done some reading and you can add a repository by going to Xcode -> Preferences -> Accounts -> Add Respository -> Enter the rep...
I would do this from the command line. 1. Close `Xcode.app` 2. Open `Terminal.app` 3. `$ cd /path/to/project/dir` 4. `$ git init .` 5. Create a `.gitignore` file to ignore some of the Xcode and output files that you don't want tracked (see below). 6. `$ git add .gitignore` 7. `$ git add .` 8. `$ git commit -a -m Initi...
3158597
How can I add a specific folder from a git repo as a git submodule?
68
2010-07-01 14:13:11
<p>I have a git repo and I want to add a submodule to it. Problem is, the submodule exists as a folder inside another repo. Can I add only that folder as a submodule?</p>
56,560
248,874
2022-10-22 08:54:51
3,158,819
31
2010-07-01 14:39:19
6,309
2022-10-22 08:54:51
https://stackoverflow.com/q/3158597
https://stackoverflow.com/a/3158819
<p>If you really need to include part of an other repository within the history of your own repo, then the <a href="http://www.kernel.org/pub/software/scm/git/docs/howto/using-merge-subtree.html" rel="nofollow noreferrer">subtree merge strategy</a> is more adequate than submodules.</p> <blockquote> <ul> <li>name the ot...
<p>If you really need to include part of an other repository within the history of your own repo, then the <a href="http://www.kernel.org/pub/software/scm/git/docs/howto/using-merge-subtree.html" rel="nofollow noreferrer">subtree merge strategy</a> is more adequate than submodules.</p> <blockquote> <ul> <li>name the ot...
119, 41612
git, git-submodules
<h1>How can I add a specific folder from a git repo as a git submodule?</h1> <p>I have a git repo and I want to add a submodule to it. Problem is, the submodule exists as a folder inside another repo. Can I add only that folder as a submodule?</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,794
git
# How can I add a specific folder from a git repo as a git submodule? I have a git repo and I want to add a submodule to it. Problem is, the submodule exists as a folder inside another repo. Can I add only that folder as a submodule?
If you really need to include part of an other repository within the history of your own repo, then the [subtree merge strategy](http://www.kernel.org/pub/software/scm/git/docs/howto/using-merge-subtree.html) is more adequate than submodules. > - name the other project "repo1", and fetch. > - prepare for the later ste...
1817370
Using ediff as git mergetool
57
2009-11-30 00:53:49
<p>I would like to be able to use ediff with "git mergetool".</p> <p>I found some patches that alter the source code, which I don't want to do. Instead, I'd like to add ediff support with my .gitconfig.</p> <p>I know git has builtin support for emerge, but I prefer ediff.</p> <p>I attempted to add these lines to my ...
30,994
205,756
2017-06-19 13:30:45
1,818,855
31
2009-11-30 09:54:33
51,019
2015-05-13 14:09:55
https://stackoverflow.com/q/1817370
https://stackoverflow.com/a/1818855
<p>I use a a more complicated command. As far as I remember I got it from this thread <a href="http://kerneltrap.org/mailarchive/git/2007/6/28/250230" rel="noreferrer">http://kerneltrap.org/mailarchive/git/2007/6/28/250230</a> (probably the same as what you are referring to).</p> <pre><code>[mergetool.ediff] cmd ...
<p>I use a a more complicated command. As far as I remember I got it from this thread <a href="http://kerneltrap.org/mailarchive/git/2007/6/28/250230" rel="noreferrer">http://kerneltrap.org/mailarchive/git/2007/6/28/250230</a> (probably the same as what you are referring to).</p> <pre><code>[mergetool.ediff] cmd ...
119, 371, 717
emacs, git, merge
<h1>Using ediff as git mergetool</h1> <p>I would like to be able to use ediff with "git mergetool".</p> <p>I found some patches that alter the source code, which I don't want to do. Instead, I'd like to add ediff support with my .gitconfig.</p> <p>I know git has builtin support for emerge, but I prefer ediff.</p> <p...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,795
git
# Using ediff as git mergetool I would like to be able to use ediff with "git mergetool". I found some patches that alter the source code, which I don't want to do. Instead, I'd like to add ediff support with my .gitconfig. I know git has builtin support for emerge, but I prefer ediff. I attempted to add these line...
I use a a more complicated command. As far as I remember I got it from this thread <http://kerneltrap.org/mailarchive/git/2007/6/28/250230> (probably the same as what you are referring to). ``` [mergetool.ediff] cmd = emacs --eval \"\ (progn\ (defun ediff-write-merge-buffer ()\ (let ((file ediff-merge-store-...
4215722
Difference between patch and diff files
55
2010-11-18 14:21:24
<p>Could somebody explain me the difference between a <strong>.diff</strong> file and <strong>.patch</strong> file.</p>
17,483
449,378
2023-04-14 18:39:20
4,215,933
31
2010-11-18 14:40:51
119,963
2010-11-18 14:40:51
https://stackoverflow.com/q/4215722
https://stackoverflow.com/a/4215933
<p>What matters is the content of the file, not the extension. Both of those extensions imply that some sort of diff utility (<code>diff</code>, <code>git diff</code>, <code>git format-patch</code>, <code>svn diff</code>) produced the output. </p> <p>Many diff utilities produce output which can be applied by the <code...
<p>What matters is the content of the file, not the extension. Both of those extensions imply that some sort of diff utility (<code>diff</code>, <code>git diff</code>, <code>git format-patch</code>, <code>svn diff</code>) produced the output. </p> <p>Many diff utilities produce output which can be applied by the <code...
58, 63, 119
git, linux, svn
<h1>Difference between patch and diff files</h1> <p>Could somebody explain me the difference between a <strong>.diff</strong> file and <strong>.patch</strong> file.</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,797
git
# Difference between patch and diff files Could somebody explain me the difference between a **.diff** file and **.patch** file.
What matters is the content of the file, not the extension. Both of those extensions imply that some sort of diff utility (`diff`, `git diff`, `git format-patch`, `svn diff`) produced the output. Many diff utilities produce output which can be applied by the `patch` command. You will frequently need to use the `-d` an...
10728104
Where can I report a git bug
50
2012-05-23 21:26:52
<p>I am trying to use the <code>mailmap.file</code> config option for git. The path is however not shell expanded, meaning I can't write <code>$HOME/.mailmap</code> or <code>~/.mailmap</code>. This is quite annoying if you are synchronizing your dotfiles with something like <a href="https://github.com/technicalpickles/...
11,426
339,505
2025-10-22 04:38:05
10,733,251
31
2012-05-24 07:45:39
6,309
2025-10-22 04:38:05
https://stackoverflow.com/q/10728104
https://stackoverflow.com/a/10733251
<p>TLDR; as <a href="https://public-inbox.org/git/fe75dd24-344b-4c9b-b08f-af12f3beff11@app.fastmail.com/T/#u" rel="nofollow noreferrer">mentioned in the Git mailing list</a>:</p> <ol> <li>Change directory to a directory where you have file creation and write permissions.</li> <li>Run <code>git bugreport</code> to creat...
<p>TLDR; as <a href="https://public-inbox.org/git/fe75dd24-344b-4c9b-b08f-af12f3beff11@app.fastmail.com/T/#u" rel="nofollow noreferrer">mentioned in the Git mailing list</a>:</p> <ol> <li>Change directory to a directory where you have file creation and write permissions.</li> <li>Run <code>git bugreport</code> to creat...
119
git
<h1>Where can I report a git bug</h1> <p>I am trying to use the <code>mailmap.file</code> config option for git. The path is however not shell expanded, meaning I can't write <code>$HOME/.mailmap</code> or <code>~/.mailmap</code>. This is quite annoying if you are synchronizing your dotfiles with something like <a href...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,798
git
# Where can I report a git bug I am trying to use the `mailmap.file` config option for git. The path is however not shell expanded, meaning I can't write `$HOME/.mailmap` or `~/.mailmap`. This is quite annoying if you are synchronizing your dotfiles with something like [homesick](https://github.com/technicalpickles/ho...
TLDR; as [mentioned in the Git mailing list](https://public-inbox.org/git/fe75dd24-344b-4c9b-b08f-af12f3beff11@app.fastmail.com/T/#u): 1. Change directory to a directory where you have file creation and write permissions. 2. Run `git bugreport` to create a template report file (in your current directory). 3. Edit the ...
11792538
What is the difference between a commit and a revision in Git?
48
2012-08-03 08:59:03
<p>There are a number of git commands, such as <code>git clone --depth 10 &lt;repo&gt;</code>, that require the number of revisions [<code>git help revisions</code>] to be given. </p> <p>What is the distinction between a commit and a revision (in git, <a href="https://stackoverflow.com/questions/8586601/whats-the-diff...
35,520
717,355
2024-11-12 13:55:21
11,792,712
31
2012-08-03 09:10:35
6,309
2016-01-06 09:52:58
https://stackoverflow.com/q/11792538
https://stackoverflow.com/a/11792712
<p>See "<a href="http://git-scm.com/docs/git-rev-parse#_specifying_revisions" rel="noreferrer">SPECIFYING REVISIONS</a>" of <a href="http://git-scm.com/docs/git-rev-parse" rel="noreferrer">git rev-parse</a>:</p> <blockquote> <p>A revision parameter <code>&lt;rev&gt;</code> typically, but not necessarily, names a com...
<p>See "<a href="http://git-scm.com/docs/git-rev-parse#_specifying_revisions" rel="noreferrer">SPECIFYING REVISIONS</a>" of <a href="http://git-scm.com/docs/git-rev-parse" rel="noreferrer">git rev-parse</a>:</p> <blockquote> <p>A revision parameter <code>&lt;rev&gt;</code> typically, but not necessarily, names a com...
119, 456, 3819
git, terminology, version-control
<h1>What is the difference between a commit and a revision in Git?</h1> <p>There are a number of git commands, such as <code>git clone --depth 10 &lt;repo&gt;</code>, that require the number of revisions [<code>git help revisions</code>] to be given. </p> <p>What is the distinction between a commit and a revision (in ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,799
git
# What is the difference between a commit and a revision in Git? There are a number of git commands, such as `git clone --depth 10 <repo>`, that require the number of revisions [`git help revisions`] to be given. What is the distinction between a commit and a revision (in git, [rather than say svn](https://stackoverf...
See "[SPECIFYING REVISIONS](http://git-scm.com/docs/git-rev-parse#_specifying_revisions)" of [git rev-parse](http://git-scm.com/docs/git-rev-parse): > A revision parameter `<rev>` typically, but not necessarily, names a commit object. > It uses what is called an extended SHA1 syntax, [and includes] various ways to s...
7685246
Should I store git repository in Home or Eclipse Workspace?
46
2011-10-07 09:18:35
<p>I'm just moving from svn to git, and am keen to lay some good foundations.</p> <p>By default Eclipse wants to store my local clone repository in ~/git. I'm more comfortable keeping all data for a task in the same workspace - so I'm inclined to keep it in my workspace.</p> <p>Are there any significant pros/cons I ...
28,149
92,441
2014-12-17 12:07:03
7,694,318
31
2011-10-08 02:00:01
277,304
2013-05-17 13:46:42
https://stackoverflow.com/q/7685246
https://stackoverflow.com/a/7694318
<p>I'm too switching to Git in Eclipse, and reading about this issue. It seems that <a href="http://wiki.eclipse.org/EGit/User_Guide#Considerations_for_Git_Repositories_to_be_used_in_Eclipse">current wisdom</a> (though not everyone agrees) is:</p> <ul> <li><p>Get used to NOT having your projects below the workspace d...
<p>I'm too switching to Git in Eclipse, and reading about this issue. It seems that <a href="http://wiki.eclipse.org/EGit/User_Guide#Considerations_for_Git_Repositories_to_be_used_in_Eclipse">current wisdom</a> (though not everyone agrees) is:</p> <ul> <li><p>Get used to NOT having your projects below the workspace d...
17, 53, 119
eclipse, git, java
<h1>Should I store git repository in Home or Eclipse Workspace?</h1> <p>I'm just moving from svn to git, and am keen to lay some good foundations.</p> <p>By default Eclipse wants to store my local clone repository in ~/git. I'm more comfortable keeping all data for a task in the same workspace - so I'm inclined to ke...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,800
git
# Should I store git repository in Home or Eclipse Workspace? I'm just moving from svn to git, and am keen to lay some good foundations. By default Eclipse wants to store my local clone repository in ~/git. I'm more comfortable keeping all data for a task in the same workspace - so I'm inclined to keep it in my works...
I'm too switching to Git in Eclipse, and reading about this issue. It seems that [current wisdom](http://wiki.eclipse.org/EGit/User_Guide#Considerations_for_Git_Repositories_to_be_used_in_Eclipse) (though not everyone agrees) is: - Get used to NOT having your projects below the workspace directory. - Have one git repo...
21122094
git line endings - can't stash, reset and now can't rebase over spurious line endings commit
45
2014-01-14 19:19:44
<p>I have a repo I added a <code>gitattributes</code> to it and was working on it fine. I sync it via dropbox to another machine. When I opened it to the other machine a bunch of files <strong>suddenly appeared</strong> on the unstaged area as total diffs (all the file a huge diff which means line endings diff) - my c...
14,910
281,545
2024-11-11 14:37:43
53,937,415
31
2018-12-26 21:35:06
281,545
2018-12-26 21:35:06
https://stackoverflow.com/q/21122094
https://stackoverflow.com/a/53937415
<p>Finally after 5 years here is a complete answer, thanks to Torsten Bögershausen. </p> <p>The way to debug this eol situation is to investigate using the <a href="https://stackoverflow.com/a/27577906/281545">--eol switch to git ls-files</a> added by Torsten Bögershausen. Turns out that the file(s) in question were c...
<p>Finally after 5 years here is a complete answer, thanks to Torsten Bögershausen. </p> <p>The way to debug this eol situation is to investigate using the <a href="https://stackoverflow.com/a/27577906/281545">--eol switch to git ls-files</a> added by Torsten Bögershausen. Turns out that the file(s) in question were c...
119, 8329
git, line-endings
<h1>git line endings - can't stash, reset and now can't rebase over spurious line endings commit</h1> <p>I have a repo I added a <code>gitattributes</code> to it and was working on it fine. I sync it via dropbox to another machine. When I opened it to the other machine a bunch of files <strong>suddenly appeared</stron...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,801
git
# git line endings - can't stash, reset and now can't rebase over spurious line endings commit I have a repo I added a `gitattributes` to it and was working on it fine. I sync it via dropbox to another machine. When I opened it to the other machine a bunch of files **suddenly appeared** on the unstaged area as total d...
Finally after 5 years here is a complete answer, thanks to Torsten Bögershausen. The way to debug this eol situation is to investigate using the [--eol switch to git ls-files](https://stackoverflow.com/a/27577906/281545) added by Torsten Bögershausen. Turns out that the file(s) in question were committed with CRLF whi...
19143139
How do you “update” a stash?
43
2013-10-02 17:32:18
<p>In my current branch I have several stashes:</p> <ul> <li><code>stash@{0}</code></li> <li><code>stash@{1}</code></li> <li><code>stash@{2}</code></li> </ul> <ol> <li><p>If I apply <code>stash@{0}</code>:</p> <pre><code>$ git stash apply stash{0} </code></pre></li> <li><p>Modify this stash</p></li> <li><p>I want ...
16,246
56,256
2022-12-30 21:13:15
19,143,269
31
2013-10-02 17:39:05
309,412
2013-10-02 17:56:37
https://stackoverflow.com/q/19143139
https://stackoverflow.com/a/19143269
<p>You can stash your working tree and then drop the old one that you don't need.</p> <pre><code>git stash apply # Make changes git stash git stash drop stash@{1} </code></pre> <p>Alternatively, you can pop instead of apply, which will drop the stash at the same time:</p> <pre><code>git stash pop # make changes git...
<p>You can stash your working tree and then drop the old one that you don't need.</p> <pre><code>git stash apply # Make changes git stash git stash drop stash@{1} </code></pre> <p>Alternatively, you can pop instead of apply, which will drop the stash at the same time:</p> <pre><code>git stash pop # make changes git...
119, 13091
git, git-stash
<h1>How do you “update” a stash?</h1> <p>In my current branch I have several stashes:</p> <ul> <li><code>stash@{0}</code></li> <li><code>stash@{1}</code></li> <li><code>stash@{2}</code></li> </ul> <ol> <li><p>If I apply <code>stash@{0}</code>:</p> <pre><code>$ git stash apply stash{0} </code></pre></li> <li><p>Mod...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,804
git
# How do you “update” a stash? In my current branch I have several stashes: - `stash@{0}` - `stash@{1}` - `stash@{2}` 1. If I apply `stash@{0}`: ``` $ git stash apply stash{0} ``` 2. Modify this stash 3. I want to save the changes to the current stash `stash@{0}` I don't want to create a 4th stash I just ...
You can stash your working tree and then drop the old one that you don't need. ``` git stash apply # Make changes git stash git stash drop stash@{1} ``` Alternatively, you can pop instead of apply, which will drop the stash at the same time: ``` git stash pop # make changes git stash ``` Another alternative, if yo...
15128541
How can I push my existing Git repository to Team Foundation Service
43
2013-02-28 06:01:45
<p>Microsoft now has support for Git repositories on their Team Foundation Service. I have an account on Team Foundation Service, and I'd like to push my existing Git repository to a project there.</p> <p>Whenever I try to do searches, I keep finding things like TFS-GIT, or GIT-TF. I'm pretty sure I don't want those, ...
29,422
8,384
2022-07-14 16:46:43
15,180,524
31
2013-03-02 23:11:54
8,384
2013-03-02 23:11:54
https://stackoverflow.com/q/15128541
https://stackoverflow.com/a/15180524
<p>Okay, I was apparently overcomplicating this. Here's what I did.</p> <ol> <li>Created a new project in TFService</li> <li>Connected to that project in Visual Studio</li> <li>Cloned that project in Visual Studio</li> <li><code>git pull c:\source\oldGitProject</code></li> </ol> <p>That was it, it pulled all of the c...
<p>Okay, I was apparently overcomplicating this. Here's what I did.</p> <ol> <li>Created a new project in TFService</li> <li>Connected to that project in Visual Studio</li> <li>Cloned that project in Visual Studio</li> <li><code>git pull c:\source\oldGitProject</code></li> </ol> <p>That was it, it pulled all of the c...
97, 119, 116537
azure-devops, git, migration
<h1>How can I push my existing Git repository to Team Foundation Service</h1> <p>Microsoft now has support for Git repositories on their Team Foundation Service. I have an account on Team Foundation Service, and I'd like to push my existing Git repository to a project there.</p> <p>Whenever I try to do searches, I kee...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,805
git
# How can I push my existing Git repository to Team Foundation Service Microsoft now has support for Git repositories on their Team Foundation Service. I have an account on Team Foundation Service, and I'd like to push my existing Git repository to a project there. Whenever I try to do searches, I keep finding things...
Okay, I was apparently overcomplicating this. Here's what I did. 1. Created a new project in TFService 2. Connected to that project in Visual Studio 3. Cloned that project in Visual Studio 4. `git pull c:\source\oldGitProject` That was it, it pulled all of the changes from the old location, and I could push that up t...
343675
What are your pros and cons of git after having used it?
43
2008-12-05 12:32:54
<p>I'm using SVN right now, and I've used CVS and VSS in the past. SVN is the current favourite in my books, but I've been hearing a lot about git. Of the people that have used git, what are the pros and cons from your experience?</p>
25,314
15,852
2010-12-11 21:30:52
343,691
31
2008-12-05 12:39:24
22,656
2008-12-05 12:39:24
https://stackoverflow.com/q/343675
https://stackoverflow.com/a/343691
<p>I don't have a <em>lot</em> of experience with git, but:</p> <p>Pros:</p> <ul> <li>It's really quick</li> <li>Local commits rock</li> <li>Quick to start a new repository (no configuration etc)</li> <li>github is easy to use</li> </ul> <p>(I haven't really "needed" the distributed side of things yet, beyond being ...
<p>I don't have a <em>lot</em> of experience with git, but:</p> <p>Pros:</p> <ul> <li>It's really quick</li> <li>Local commits rock</li> <li>Quick to start a new repository (no configuration etc)</li> <li>github is easy to use</li> </ul> <p>(I haven't really "needed" the distributed side of things yet, beyond being ...
119, 456
git, version-control
<h1>What are your pros and cons of git after having used it?</h1> <p>I'm using SVN right now, and I've used CVS and VSS in the past. SVN is the current favourite in my books, but I've been hearing a lot about git. Of the people that have used git, what are the pros and cons from your experience?</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,806
git
# What are your pros and cons of git after having used it? I'm using SVN right now, and I've used CVS and VSS in the past. SVN is the current favourite in my books, but I've been hearing a lot about git. Of the people that have used git, what are the pros and cons from your experience?
I don't have a *lot* of experience with git, but: Pros: - It's really quick - Local commits rock - Quick to start a new repository (no configuration etc) - github is easy to use (I haven't really "needed" the distributed side of things yet, beyond being able to have a local repository and push to a public one.) Con...
15439527
git: Why "Merge branch 'master' of ... "? when pull and push
40
2013-03-15 18:21:12
<p>I'm still git newbie. I modified some source files and committed. Then, I did <code>git push</code>. But, I got this error.</p> <pre><code>To /foo/bar/ ! [rejected] master -&gt; master (non-fast-forward) error: failed to push some refs to '/foo/bar/' To prevent you from losing history, non-fast-forward upda...
48,093
614,702
2018-08-30 21:48:34
15,439,625
31
2013-03-15 18:26:08
567,555
2013-03-15 18:26:08
https://stackoverflow.com/q/15439527
https://stackoverflow.com/a/15439625
<p>When you did a <code>git-pull</code>, modifications from the remote branch were merged into your local branch. The automatically generated commit signifies that.</p> <p>Merging could have resulted in conflicts, which would then need to be resolved manually. In your particular case, this did not happen and git could...
<p>When you did a <code>git-pull</code>, modifications from the remote branch were merged into your local branch. The automatically generated commit signifies that.</p> <p>Merging could have resulted in conflicts, which would then need to be resolved manually. In your particular case, this did not happen and git could...
119, 28896, 28898, 53850
git, git-commit, git-pull, git-push
<h1>git: Why "Merge branch 'master' of ... "? when pull and push</h1> <p>I'm still git newbie. I modified some source files and committed. Then, I did <code>git push</code>. But, I got this error.</p> <pre><code>To /foo/bar/ ! [rejected] master -&gt; master (non-fast-forward) error: failed to push some refs to...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,809
git
# git: Why "Merge branch 'master' of ... "? when pull and push I'm still git newbie. I modified some source files and committed. Then, I did `git push`. But, I got this error. ``` To /foo/bar/ ! [rejected] master -> master (non-fast-forward) error: failed to push some refs to '/foo/bar/' To prevent you from l...
When you did a `git-pull`, modifications from the remote branch were merged into your local branch. The automatically generated commit signifies that. Merging could have resulted in conflicts, which would then need to be resolved manually. In your particular case, this did not happen and git could take care of everyth...
45198277
Pycharm asks me if I want to add .idea\vcs.xml to Git
38
2017-07-19 18:22:17
<p>When using Pycharm I got a popup out of nowhere asking me if I wanted to add this file to Git, and noting that I could do it manually later if I wanted. What is this file, and why is this recommendation being given to me?</p>
32,428
783,314
2019-03-19 15:33:50
45,198,381
31
2017-07-19 18:27:32
6,487,831
2017-07-19 18:27:32
https://stackoverflow.com/q/45198277
https://stackoverflow.com/a/45198381
<p>All the project specific settings for project are stored under the .idea folder. </p> <p>While working, a new file (<code>vcs.xml</code>) was created and hence it gives you the option to add it to Git. The files in the <code>.idea/</code> should generally not reach Git, and it's usually better to add it to <code>.g...
<p>All the project specific settings for project are stored under the .idea folder. </p> <p>While working, a new file (<code>vcs.xml</code>) was created and hence it gives you the option to add it to Git. The files in the <code>.idea/</code> should generally not reach Git, and it's usually better to add it to <code>.g...
119, 5794, 51298
git, jetbrains-ide, pycharm
<h1>Pycharm asks me if I want to add .idea\vcs.xml to Git</h1> <p>When using Pycharm I got a popup out of nowhere asking me if I wanted to add this file to Git, and noting that I could do it manually later if I wanted. What is this file, and why is this recommendation being given to me?</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,812
git
# Pycharm asks me if I want to add .idea\vcs.xml to Git When using Pycharm I got a popup out of nowhere asking me if I wanted to add this file to Git, and noting that I could do it manually later if I wanted. What is this file, and why is this recommendation being given to me?
All the project specific settings for project are stored under the .idea folder. While working, a new file (`vcs.xml`) was created and hence it gives you the option to add it to Git. The files in the `.idea/` should generally not reach Git, and it's usually better to add it to `.gitignore` file.
20834648
How do I rebase a chain of local git branches?
36
2013-12-30 06:45:34
<p>Suppose I have a chain of local git branches, like this:</p> <pre><code> master branch1 branch2 | | | o----o----o----A----B----C----D </code></pre> <p>I pull in an upstream change onto the master branch:</p> <pre><code> branch1 branch2 | ...
7,136
7,193
2023-07-30 08:03:35
20,836,211
31
2013-12-30 08:51:19
6,309
2023-07-30 08:03:35
https://stackoverflow.com/q/20834648
https://stackoverflow.com/a/20836211
<p>2022: I described last August in &quot;<a href="https://stackoverflow.com/a/73429249/6309">Git interactive rebase: how to move other branches (refs) automatically?</a>&quot; a <a href="https://git-scm.com/docs/git-rebase#Documentation/git-rebase.txt---update-refs" rel="noreferrer">new rebase option <code>--update-re...
<p>2022: I described last August in &quot;<a href="https://stackoverflow.com/a/73429249/6309">Git interactive rebase: how to move other branches (refs) automatically?</a>&quot; a <a href="https://git-scm.com/docs/git-rebase#Documentation/git-rebase.txt---update-refs" rel="noreferrer">new rebase option <code>--update-re...
119, 8974
git, rebase
<h1>How do I rebase a chain of local git branches?</h1> <p>Suppose I have a chain of local git branches, like this:</p> <pre><code> master branch1 branch2 | | | o----o----o----A----B----C----D </code></pre> <p>I pull in an upstream change onto the master branch:</p> <pre><code> ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,813
git
# How do I rebase a chain of local git branches? Suppose I have a chain of local git branches, like this: ``` master branch1 branch2 | | | o----o----o----A----B----C----D ``` I pull in an upstream change onto the master branch: ``` branch1 branch2 ...
2022: I described last August in "[Git interactive rebase: how to move other branches (refs) automatically?](https://stackoverflow.com/a/73429249/6309)" a [new rebase option `--update-refs`](https://git-scm.com/docs/git-rebase#Documentation/git-rebase.txt---update-refs) (Git 2.38, Q3 2022): > Automatically force-updat...
39128500
Working tree vs working directory
34
2016-08-24 16:23:30
<p>I was reading Git v2.9.1's <a href="https://github.com/git/git/blob/e0c1ceafc5bece92d35773a75fff59497e1d9bd5/Documentation/RelNotes/2.9.1.txt#L53" rel="noreferrer">release notes</a> and one of the changes reads:</p> <blockquote> <p>"git status" used to say "working directory" when it meant "working tree".</p> </b...
12,822
2,883,579
2024-12-25 09:58:02
39,129,157
31
2016-08-24 17:01:33
729,881
2020-10-27 16:19:12
https://stackoverflow.com/q/39128500
https://stackoverflow.com/a/39129157
<p>This was done to improve consistency and avoid ambiguity. As explained in the <a href="https://github.com/git/git/commit/2a0e6cdedab306eccbd297c051035c13d0266343" rel="noreferrer">commit that changed this behavior</a>:</p> <blockquote> <p>Working directory can be easily confused with the current directory.</p> </bl...
<p>This was done to improve consistency and avoid ambiguity. As explained in the <a href="https://github.com/git/git/commit/2a0e6cdedab306eccbd297c051035c13d0266343" rel="noreferrer">commit that changed this behavior</a>:</p> <blockquote> <p>Working directory can be easily confused with the current directory.</p> </bl...
119
git
<h1>Working tree vs working directory</h1> <p>I was reading Git v2.9.1's <a href="https://github.com/git/git/blob/e0c1ceafc5bece92d35773a75fff59497e1d9bd5/Documentation/RelNotes/2.9.1.txt#L53" rel="noreferrer">release notes</a> and one of the changes reads:</p> <blockquote> <p>"git status" used to say "working direc...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,814
git
# Working tree vs working directory I was reading Git v2.9.1's [release notes](https://github.com/git/git/blob/e0c1ceafc5bece92d35773a75fff59497e1d9bd5/Documentation/RelNotes/2.9.1.txt#L53) and one of the changes reads: > "git status" used to say "working directory" when it meant "working tree". What's the differenc...
This was done to improve consistency and avoid ambiguity. As explained in the [commit that changed this behavior](https://github.com/git/git/commit/2a0e6cdedab306eccbd297c051035c13d0266343): > Working directory can be easily confused with the current directory. So this change was made to better disambiguate between t...
32681850
Is there a fast way to rebase a long history of commits to master branch?
34
2015-09-20 16:47:23
<p>I've been working for the past two weeks on a feature, and I created a separate branch for it. The problem is that the task took me a long time, and I didn't rebase my branch to master periodically. I ended up with 100+ commits and now when I'm trying to rebase the branch to master using <code>git rebase master</cod...
29,142
1,080,046
2022-01-15 11:28:29
32,682,265
31
2015-09-20 17:30:00
3,177,124
2020-10-30 06:58:05
https://stackoverflow.com/q/32681850
https://stackoverflow.com/a/32682265
<p>This depends in part how you've done your 100+ commits and what's been happening in the meantime. Four strategies might be useful:</p> <h1>Reduce the number of commits to rebase</h1> <p>If you have a beautiful clear stream of 100 commits that never modify the same code twice, I'm sorry, but you are stuck.</p> <p>How...
<p>This depends in part how you've done your 100+ commits and what's been happening in the meantime. Four strategies might be useful:</p> <h1>Reduce the number of commits to rebase</h1> <p>If you have a beautiful clear stream of 100 commits that never modify the same code twice, I'm sorry, but you are stuck.</p> <p>How...
119, 8974, 29934
git, git-rebase, rebase
<h1>Is there a fast way to rebase a long history of commits to master branch?</h1> <p>I've been working for the past two weeks on a feature, and I created a separate branch for it. The problem is that the task took me a long time, and I didn't rebase my branch to master periodically. I ended up with 100+ commits and no...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,815
git
# Is there a fast way to rebase a long history of commits to master branch? I've been working for the past two weeks on a feature, and I created a separate branch for it. The problem is that the task took me a long time, and I didn't rebase my branch to master periodically. I ended up with 100+ commits and now when I'...
This depends in part how you've done your 100+ commits and what's been happening in the meantime. Four strategies might be useful: # Reduce the number of commits to rebase If you have a beautiful clear stream of 100 commits that never modify the same code twice, I'm sorry, but you are stuck. However, from 100 commit...
28763699
What is git hawser?
34
2015-02-27 11:11:01
<p>I recently discovered my <code>.gitconfig</code> had been appended these few additional lines:</p> <pre><code>[filter "hawser"] clean = git hawser clean %f smudge = git hawser smudge %f required = true </code></pre> <p>Since it is version-controlled, I am sure I did not add them. It seems I am <a href=...
4,443
594,053
2016-10-27 20:40:38
28,769,786
31
2015-02-27 16:30:26
2,250,791
2015-04-28 04:49:46
https://stackoverflow.com/q/28763699
https://stackoverflow.com/a/28769786
<p>I found the change in my <code>.gitconfig</code> coincided with an update to github for mac exactly, which is why I labeled it as such in my repo.</p> <p>As to what Hawser actually is, Github for mac has it bundled at the <code>/Applications/GitHub.app/Contents/Resources/hawser/bin/git-hawser</code> path.</p> <p>r...
<p>I found the change in my <code>.gitconfig</code> coincided with an update to github for mac exactly, which is why I labeled it as such in my repo.</p> <p>As to what Hawser actually is, Github for mac has it bundled at the <code>/Applications/GitHub.app/Contents/Resources/hawser/bin/git-hawser</code> path.</p> <p>r...
119, 32868
git, git-config
<h1>What is git hawser?</h1> <p>I recently discovered my <code>.gitconfig</code> had been appended these few additional lines:</p> <pre><code>[filter "hawser"] clean = git hawser clean %f smudge = git hawser smudge %f required = true </code></pre> <p>Since it is version-controlled, I am sure I did not add...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
18,816
git
# What is git hawser? I recently discovered my `.gitconfig` had been appended these few additional lines: ``` [filter "hawser"] clean = git hawser clean %f smudge = git hawser smudge %f required = true ``` Since it is version-controlled, I am sure I did not add them. It seems I am [not](https://github.co...
I found the change in my `.gitconfig` coincided with an update to github for mac exactly, which is why I labeled it as such in my repo. As to what Hawser actually is, Github for mac has it bundled at the `/Applications/GitHub.app/Contents/Resources/hawser/bin/git-hawser` path. running the executable with `--help=fals...