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
39818331
Check if a file was changed in during commit in git
8
2016-10-02 15:05:12
<p>Is there any git command which allows to check if a file was changed during last commit?</p> <p>I'd like to check if a file which contains a version number was updated, otherwise the dev shall receive a warning not to release the software to an integration environment before a the version was bumped up.</p>
7,835
5,039,582
2021-11-15 07:45:29
39,818,369
20
2016-10-02 15:09:20
1,863,229
2016-10-02 15:09:20
https://stackoverflow.com/q/39818331
https://stackoverflow.com/a/39818369
<p>Try this:</p> <pre><code>git diff --name-only HEAD~1 HEAD | grep somefile.txt </code></pre> <p>This command assumes that you want to check whether the file <code>somefile.txt</code> changed in the last commit. If you want to check whether <code>somefile.txt</code> changed between any two commits, then use</p> <p...
<p>Try this:</p> <pre><code>git diff --name-only HEAD~1 HEAD | grep somefile.txt </code></pre> <p>This command assumes that you want to check whether the file <code>somefile.txt</code> changed in the last commit. If you want to check whether <code>somefile.txt</code> changed between any two commits, then use</p> <p...
119, 5792
git, version
<h1>Check if a file was changed in during commit in git</h1> <p>Is there any git command which allows to check if a file was changed during last commit?</p> <p>I'd like to check if a file which contains a version number was updated, otherwise the dev shall receive a warning not to release the software to an integratio...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,670
git
# Check if a file was changed in during commit in git Is there any git command which allows to check if a file was changed during last commit? I'd like to check if a file which contains a version number was updated, otherwise the dev shall receive a warning not to release the software to an integration environment be...
Try this: ``` git diff --name-only HEAD~1 HEAD | grep somefile.txt ``` This command assumes that you want to check whether the file `somefile.txt` changed in the last commit. If you want to check whether `somefile.txt` changed between any two commits, then use ``` git diff --name-only SHA1 SHA2 | grep somefile.txt `...
34149356
What exactly is the difference between all the Git Reset modes?
8
2015-12-08 06:24:04
<p>I'm trying to add succinct summaries of Git's reset modes for the Git-Savvy Sublime extension. It's hard!</p> <p>I have this:</p> <pre><code>mixed (default): update index soft: move branch pointer only hard: update index &amp; working dir, discard local changes merge: update index &amp; working dir, keep local ch...
3,234
263,268
2018-12-21 11:23:13
34,155,307
20
2015-12-08 11:58:00
263,268
2018-12-21 11:23:13
https://stackoverflow.com/q/34149356
https://stackoverflow.com/a/34155307
<p>Ok, since I can't find a complete side-by-side analysis of the different modes, I'll make a table, using language which is hopefully more understandable to the user. I'm also including <code>git checkout</code>.</p> <p>For clarity, the "Effect on..."</p> <ul> <li>"HEAD": what HEAD points to after the operation</li...
<p>Ok, since I can't find a complete side-by-side analysis of the different modes, I'll make a table, using language which is hopefully more understandable to the user. I'm also including <code>git checkout</code>.</p> <p>For clarity, the "Effect on..."</p> <ul> <li>"HEAD": what HEAD points to after the operation</li...
119, 51381
git, git-reset
<h1>What exactly is the difference between all the Git Reset modes?</h1> <p>I'm trying to add succinct summaries of Git's reset modes for the Git-Savvy Sublime extension. It's hard!</p> <p>I have this:</p> <pre><code>mixed (default): update index soft: move branch pointer only hard: update index &amp; working dir, d...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,671
git
# What exactly is the difference between all the Git Reset modes? I'm trying to add succinct summaries of Git's reset modes for the Git-Savvy Sublime extension. It's hard! I have this: ``` mixed (default): update index soft: move branch pointer only hard: update index & working dir, discard local changes merge: upd...
Ok, since I can't find a complete side-by-side analysis of the different modes, I'll make a table, using language which is hopefully more understandable to the user. I'm also including `git checkout`. For clarity, the "Effect on..." - "HEAD": what HEAD points to after the operation - "Branch pointer": if we are curre...
14253913
Capistrano deploy from Git HTTP repo
8
2013-01-10 08:50:34
<p>Has anyone experience with Capistrano deployment from a Git repository over HTTP?</p> <p>The following <em>deploy.rb</em> is not working:</p> <pre><code>set :repository, 'http://git.repository-domain.com:4442/git/repo.git' set :scm_username, "git_username" set :scm_password, "git_password" set :scm, :git </code><...
10,812
1,373,324
2020-04-14 14:33:08
17,566,686
20
2013-07-10 09:11:40
1,373,324
2020-04-14 14:33:08
https://stackoverflow.com/q/14253913
https://stackoverflow.com/a/17566686
<p>Capistrano Git HTTPS authentication will be resolved in Capistrano 3 where you can set repository and its credentials with:</p> <pre><code>set :repo_url, 'https://git.repository-domain.com:4442/git/repo.git' set :git_http_username, 'username' set :git_http_password, 'password' </code></pre> <p>Also, what already w...
<p>Capistrano Git HTTPS authentication will be resolved in Capistrano 3 where you can set repository and its credentials with:</p> <pre><code>set :repo_url, 'https://git.repository-domain.com:4442/git/repo.git' set :git_http_username, 'username' set :git_http_password, 'password' </code></pre> <p>Also, what already w...
119, 190, 2831, 4984, 5210
capistrano, deployment, git, http, ruby-on-rails
<h1>Capistrano deploy from Git HTTP repo</h1> <p>Has anyone experience with Capistrano deployment from a Git repository over HTTP?</p> <p>The following <em>deploy.rb</em> is not working:</p> <pre><code>set :repository, 'http://git.repository-domain.com:4442/git/repo.git' set :scm_username, "git_username" set :scm_pa...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,673
git
# Capistrano deploy from Git HTTP repo Has anyone experience with Capistrano deployment from a Git repository over HTTP? The following *deploy.rb* is not working: ``` set :repository, 'http://git.repository-domain.com:4442/git/repo.git' set :scm_username, "git_username" set :scm_password, "git_password" set :scm, :...
Capistrano Git HTTPS authentication will be resolved in Capistrano 3 where you can set repository and its credentials with: ``` set :repo_url, 'https://git.repository-domain.com:4442/git/repo.git' set :git_http_username, 'username' set :git_http_password, 'password' ``` Also, what already works in Capistrano 3, is th...
7645480
Why doesn't setting GIT_WORK_TREE work in a post-commit hook?
8
2011-10-04 09:01:07
<p>I'm trying to use the following <code>post-commit</code> hook to deploy to a particular directory after each successful commit:</p> <pre><code>#!/bin/sh export GIT_WORK_TREE=/var/www/example/ export GIT_DIR=/home/mark/test/.git/ git checkout -f </code></pre> <p>However, after committing I get the following error:<...
5,303
223,092
2015-12-04 20:40:12
7,645,492
20
2011-10-04 09:02:01
223,092
2011-10-04 09:02:01
https://stackoverflow.com/q/7645480
https://stackoverflow.com/a/7645492
<p>The problem here is that in <code>post-commit</code> hooks (and also <code>pre-commit</code>, <code>prepare-commit-msg</code> and <code>commit-msgt</code>) the <code>GIT_INDEX_FILE</code> environment variable is set to <code>.git/index</code>. (This isn't documented in the <a href="http://schacon.github.com/git/git...
<p>The problem here is that in <code>post-commit</code> hooks (and also <code>pre-commit</code>, <code>prepare-commit-msg</code> and <code>commit-msgt</code>) the <code>GIT_INDEX_FILE</code> environment variable is set to <code>.git/index</code>. (This isn't documented in the <a href="http://schacon.github.com/git/git...
119, 37230, 43087
git, git-checkout, githooks
<h1>Why doesn't setting GIT_WORK_TREE work in a post-commit hook?</h1> <p>I'm trying to use the following <code>post-commit</code> hook to deploy to a particular directory after each successful commit:</p> <pre><code>#!/bin/sh export GIT_WORK_TREE=/var/www/example/ export GIT_DIR=/home/mark/test/.git/ git checkout -f ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,674
git
# Why doesn't setting GIT_WORK_TREE work in a post-commit hook? I'm trying to use the following `post-commit` hook to deploy to a particular directory after each successful commit: ``` #!/bin/sh export GIT_WORK_TREE=/var/www/example/ export GIT_DIR=/home/mark/test/.git/ git checkout -f ``` However, after committing ...
The problem here is that in `post-commit` hooks (and also `pre-commit`, `prepare-commit-msg` and `commit-msgt`) the `GIT_INDEX_FILE` environment variable is set to `.git/index`. (This isn't documented in the [githooks documentation](http://schacon.github.com/git/githooks.html), but I've posted elsewhere [about the sett...
1862231
Git - remove and exclude configuration file
8
2009-12-07 19:15:42
<p>2 weeks ago, I commited config of my application which had my password, it's not very useful. How can I remove the file from the commit history and make sure it doesn't get re-commited?</p> <p>I want to remove the file from all commits tree because it contains my passwords.</p>
7,506
222,380
2015-08-28 13:20:05
1,862,265
20
2009-12-07 19:19:36
6,309
2012-10-19 07:18:49
https://stackoverflow.com/q/1862231
https://stackoverflow.com/a/1862265
<p>You can </p> <pre><code>git rm myConfigFile echo myConfigFile &gt; .gitignore git add .gitignore git commit -m "from now on, no more myConfigFile" </code></pre> <p>The other extreme approach (dangerous especially if you have already pushed your repo to a remote one) would be to entirely remove that file from the h...
<p>You can </p> <pre><code>git rm myConfigFile echo myConfigFile &gt; .gitignore git add .gitignore git commit -m "from now on, no more myConfigFile" </code></pre> <p>The other extreme approach (dangerous especially if you have already pushed your repo to a remote one) would be to entirely remove that file from the h...
119, 456, 11675
configuration-management, git, version-control
<h1>Git - remove and exclude configuration file</h1> <p>2 weeks ago, I commited config of my application which had my password, it's not very useful. How can I remove the file from the commit history and make sure it doesn't get re-commited?</p> <p>I want to remove the file from all commits tree because it contains my...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,675
git
# Git - remove and exclude configuration file 2 weeks ago, I commited config of my application which had my password, it's not very useful. How can I remove the file from the commit history and make sure it doesn't get re-commited? I want to remove the file from all commits tree because it contains my passwords.
You can ``` git rm myConfigFile echo myConfigFile > .gitignore git add .gitignore git commit -m "from now on, no more myConfigFile" ``` The other extreme approach (dangerous especially if you have already pushed your repo to a remote one) would be to entirely remove that file from the history of said repo: ``` git f...
873740
GitPython and sending commands to the Git object
8
2009-05-17 02:04:40
<p><a href="http://gitorious.org/git-python" rel="noreferrer">GitPython</a> is a way of interacting with git from python. I'm trying to access the basic git commands (e.g. <code>git commit -m "message"</code>) from this module, which according to <a href="http://pysync.googlecode.com/files/GitPython.pdf" rel="noreferre...
10,507
67,600
2022-01-26 06:14:11
873,896
20
2009-05-17 04:27:46
19,208
2009-05-17 04:27:46
https://stackoverflow.com/q/873740
https://stackoverflow.com/a/873896
<p>I havn't tried it to verify yet but it seems git.Git.execute expects a list of commandline arguments (if you give it a string it'll look for an executable exactly matching the string, spaces and everything - which naturally wouldn't be found), so something like this I think would work:</p> <pre><code>import git imp...
<p>I havn't tried it to verify yet but it seems git.Git.execute expects a list of commandline arguments (if you give it a string it'll look for an executable exactly matching the string, spaces and everything - which naturally wouldn't be found), so something like this I think would work:</p> <pre><code>import git imp...
16, 119
git, python
<h1>GitPython and sending commands to the Git object</h1> <p><a href="http://gitorious.org/git-python" rel="noreferrer">GitPython</a> is a way of interacting with git from python. I'm trying to access the basic git commands (e.g. <code>git commit -m "message"</code>) from this module, which according to <a href="http:/...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,676
git
# GitPython and sending commands to the Git object [GitPython](http://gitorious.org/git-python) is a way of interacting with git from python. I'm trying to access the basic git commands (e.g. `git commit -m "message"`) from this module, which according to [this](http://pysync.googlecode.com/files/GitPython.pdf) should...
I havn't tried it to verify yet but it seems git.Git.execute expects a list of commandline arguments (if you give it a string it'll look for an executable exactly matching the string, spaces and everything - which naturally wouldn't be found), so something like this I think would work: ``` import git import os, os.pat...
41403760
Git rebase/merge branch with many moved files and folders
7
2016-12-30 23:00:29
<p>I have a Git repository with two main branches: master and dev. It currently looks like this:</p> <pre><code>master ( )----( )----(A)----(B)----(C) \ \ dev ( )----( )----( )----( )----(~ 30 additional commits...) </code></pre> <p>Pretty simple, except that commit <str...
6,799
19,036
2016-12-31 00:47:21
41,404,455
20
2016-12-31 00:47:21
5,227,053
2016-12-31 00:47:21
https://stackoverflow.com/q/41403760
https://stackoverflow.com/a/41404455
<p>Yes, there is a sane way to do this. </p> <h1>Preface</h1> <p><code>master</code> is now (if I understood correctly):</p> <pre><code>project src file.c </code></pre> <p><code>dev</code> is, since it did not contain commit <code>A</code>:</p> <pre><code>src file.c # with some changes </code></p...
<p>Yes, there is a sane way to do this. </p> <h1>Preface</h1> <p><code>master</code> is now (if I understood correctly):</p> <pre><code>project src file.c </code></pre> <p><code>dev</code> is, since it did not contain commit <code>A</code>:</p> <pre><code>src file.c # with some changes </code></p...
119
git
<h1>Git rebase/merge branch with many moved files and folders</h1> <p>I have a Git repository with two main branches: master and dev. It currently looks like this:</p> <pre><code>master ( )----( )----(A)----(B)----(C) \ \ dev ( )----( )----( )----( )----(~ 30 additional c...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,678
git
# Git rebase/merge branch with many moved files and folders I have a Git repository with two main branches: master and dev. It currently looks like this: ``` master ( )----( )----(A)----(B)----(C) \ \ dev ( )----( )----( )----( )----(~ 30 additional commits...) ``` Pret...
Yes, there is a sane way to do this. # Preface `master` is now (if I understood correctly): ``` project src file.c ``` `dev` is, since it did not contain commit `A`: ``` src file.c # with some changes ``` Your branches are like this: ``` master ( )----(A0)----(A)----(B)----(C) ...
37606168
How to undo a git push?
7
2016-06-03 04:51:04
<p>I pushed up some files up to github using <code>git push &lt;branch_name&gt;</code>. When I open a PR, the files show up in the changes. How do I undo this <code>git push</code>? In short, I tried to do a <code>git reset</code> of that file before pushing but apparently I mistyped the filename. Now what do I do?</p>...
40,576
2,714,301
2016-06-03 05:03:08
37,606,291
20
2016-06-03 05:03:08
145,279
2016-06-03 05:03:08
https://stackoverflow.com/q/37606168
https://stackoverflow.com/a/37606291
<p>First, make a backup, in case something goes wrong. Clone your repository as <code>&lt;repository&gt;-backup</code> with <code>-b &lt;branchname&gt;</code> and don't touch that one.</p> <p>Second, find the commit hash of the last good commit in <code>git log</code>.</p> <p>Then run:</p> <pre><code>git push --forc...
<p>First, make a backup, in case something goes wrong. Clone your repository as <code>&lt;repository&gt;-backup</code> with <code>-b &lt;branchname&gt;</code> and don't touch that one.</p> <p>Second, find the commit hash of the last good commit in <code>git log</code>.</p> <p>Then run:</p> <pre><code>git push --forc...
119
git
<h1>How to undo a git push?</h1> <p>I pushed up some files up to github using <code>git push &lt;branch_name&gt;</code>. When I open a PR, the files show up in the changes. How do I undo this <code>git push</code>? In short, I tried to do a <code>git reset</code> of that file before pushing but apparently I mistyped th...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,679
git
# How to undo a git push? I pushed up some files up to github using `git push <branch_name>`. When I open a PR, the files show up in the changes. How do I undo this `git push`? In short, I tried to do a `git reset` of that file before pushing but apparently I mistyped the filename. Now what do I do? How do I undo pus...
First, make a backup, in case something goes wrong. Clone your repository as `<repository>-backup` with `-b <branchname>` and don't touch that one. Second, find the commit hash of the last good commit in `git log`. Then run: ``` git push --force origin <last good commit hash>:<branch> ``` Note that rewriting histor...
30388636
git: error: SDK "macosx" cannot be located
7
2015-05-22 04:55:50
<p>Just updated my machine to Yosemite. I'm getting this error from Git now:</p> <pre><code>git: error: SDK "macosx" cannot be located </code></pre> <p>I'm able to run <code>git status</code> with no issue, but anything like <code>git add</code> seems to work, but then throws this error. Command Line Tools are instal...
10,721
867,620
2019-10-03 20:31:13
30,428,330
20
2015-05-24 21:06:11
867,620
2015-05-24 21:06:11
https://stackoverflow.com/q/30388636
https://stackoverflow.com/a/30428330
<p>Not sure exactly what, but something got out of whack during the upgrade. Uninstall CommandLineTools by typing <code>sudo rm -r /Library/Developer/CommandLineTools</code> then reinstall. I just typed some git command like: <code>git status</code> and let the OS prompt me to install the CommandLineTools. Everything i...
<p>Not sure exactly what, but something got out of whack during the upgrade. Uninstall CommandLineTools by typing <code>sudo rm -r /Library/Developer/CommandLineTools</code> then reinstall. I just typed some git command like: <code>git status</code> and let the OS prompt me to install the CommandLineTools. Everything i...
119, 369, 104811
git, macos, osx-yosemite
<h1>git: error: SDK "macosx" cannot be located</h1> <p>Just updated my machine to Yosemite. I'm getting this error from Git now:</p> <pre><code>git: error: SDK "macosx" cannot be located </code></pre> <p>I'm able to run <code>git status</code> with no issue, but anything like <code>git add</code> seems to work, but t...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,680
git
# git: error: SDK "macosx" cannot be located Just updated my machine to Yosemite. I'm getting this error from Git now: ``` git: error: SDK "macosx" cannot be located ``` I'm able to run `git status` with no issue, but anything like `git add` seems to work, but then throws this error. Command Line Tools are installed...
Not sure exactly what, but something got out of whack during the upgrade. Uninstall CommandLineTools by typing `sudo rm -r /Library/Developer/CommandLineTools` then reinstall. I just typed some git command like: `git status` and let the OS prompt me to install the CommandLineTools. Everything is happy now.
29322582
How to calculate center of bounds without GoogleMaps?
7
2015-03-28 21:02:51
<p>I have the following bounds:</p> <pre><code>var bounds = { southwest: {lat: 54.69726685890506, lng: -2.7379201682812226}, northeast: {lat: 55.38942944437183, lng: -1.2456105979687226} }; </code></pre> <p>By using google maps API I could calculate canter of the bounds above like the following:</p> <pre><co...
8,143
1,006,884
2019-03-15 04:08:40
29,324,082
20
2015-03-29 00:01:08
1,210,329
2019-03-15 04:07:27
https://stackoverflow.com/q/29322582
https://stackoverflow.com/a/29324082
<pre><code>var bounds = { southwest: {lat: 54.69726685890506, lng: -2.7379201682812226}, northeast: {lat: 55.38942944437183, lng: -1.2456105979687226} }; center lat = (southwest.lat + northeast.lat)/2 = 55.043348151638 center lng = (southwest.lng + northeast.lng)/2 = -1.991765383125 </code></pre> <p><strong>I...
<pre><code>var bounds = { southwest: {lat: 54.69726685890506, lng: -2.7379201682812226}, northeast: {lat: 55.38942944437183, lng: -1.2456105979687226} }; center lat = (southwest.lat + northeast.lat)/2 = 55.043348151638 center lng = (southwest.lng + northeast.lng)/2 = -1.991765383125 </code></pre> <p><strong>I...
1819, 20301, 37775
bounds, google-maps, latitude-longitude
<h1>How to calculate center of bounds without GoogleMaps?</h1> <p>I have the following bounds:</p> <pre><code>var bounds = { southwest: {lat: 54.69726685890506, lng: -2.7379201682812226}, northeast: {lat: 55.38942944437183, lng: -1.2456105979687226} }; </code></pre> <p>By using google maps API I could calcula...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,681
git
# How to calculate center of bounds without GoogleMaps? I have the following bounds: ``` var bounds = { southwest: {lat: 54.69726685890506, lng: -2.7379201682812226}, northeast: {lat: 55.38942944437183, lng: -1.2456105979687226} }; ``` By using google maps API I could calculate canter of the bounds above lik...
``` var bounds = { southwest: {lat: 54.69726685890506, lng: -2.7379201682812226}, northeast: {lat: 55.38942944437183, lng: -1.2456105979687226} }; center lat = (southwest.lat + northeast.lat)/2 = 55.043348151638 center lng = (southwest.lng + northeast.lng)/2 = -1.991765383125 ``` **If you need to handle cross...
27912411
Update a single file from git
7
2015-01-12 23:16:02
<p>I would like to update a specific file in a repository that I use.</p> <p>Basically I have repo X, which has N files.</p> <p>For one test, I need to have the latest and greatest of a specific file, since my application is already loaded, I can't just download the whole project again.</p> <p>Is there a way to tell...
33,654
null
2015-01-12 23:22:22
27,912,489
20
2015-01-12 23:22:22
729,539
2015-01-12 23:22:22
https://stackoverflow.com/q/27912411
https://stackoverflow.com/a/27912489
<p>First make sure you have the latest and greatest version available in your local git repo:</p> <pre><code>git fetch origin </code></pre> <p>Then retrieve the one specific file you're looking for</p> <pre><code>git checkout origin/master -- path/to/the/file </code></pre> <p>The <code>--</code> tells <code>git</co...
<p>First make sure you have the latest and greatest version available in your local git repo:</p> <pre><code>git fetch origin </code></pre> <p>Then retrieve the one specific file you're looking for</p> <pre><code>git checkout origin/master -- path/to/the/file </code></pre> <p>The <code>--</code> tells <code>git</co...
119
git
<h1>Update a single file from git</h1> <p>I would like to update a specific file in a repository that I use.</p> <p>Basically I have repo X, which has N files.</p> <p>For one test, I need to have the latest and greatest of a specific file, since my application is already loaded, I can't just download the whole projec...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,682
git
# Update a single file from git I would like to update a specific file in a repository that I use. Basically I have repo X, which has N files. For one test, I need to have the latest and greatest of a specific file, since my application is already loaded, I can't just download the whole project again. Is there a wa...
First make sure you have the latest and greatest version available in your local git repo: ``` git fetch origin ``` Then retrieve the one specific file you're looking for ``` git checkout origin/master -- path/to/the/file ``` The `--` tells `git` that all other arguments are files, not parameters.
13106288
How to move Egit repository and working directory
7
2012-10-28 04:06:43
<p>I am new to Egit and created a new repository for a GWT project I'm working on. Unfortunately, I let it create the repository under my Dropbox folder, and now I'm regretting it because I'm syncing megabytes of temp files (e.g. *.class) over the internet. The "create repository" wizard also moved the project's file...
21,788
564,626
2013-12-30 20:48:19
13,112,821
20
2012-10-28 20:41:19
564,626
2012-10-28 20:41:19
https://stackoverflow.com/q/13106288
https://stackoverflow.com/a/13112821
<p>I managed to do it myself, here's how:</p> <ul> <li>In Eclipse, right-click MyApp project, <code>Refactor-&gt;Move</code>. Move the Eclipse project to a new spot on disk. Note that I kept the <code>.../GitRepositories/MyApp/MyApp</code> dir structure, it's just that I moved the location of GitRepositories to a ne...
<p>I managed to do it myself, here's how:</p> <ul> <li>In Eclipse, right-click MyApp project, <code>Refactor-&gt;Move</code>. Move the Eclipse project to a new spot on disk. Note that I kept the <code>.../GitRepositories/MyApp/MyApp</code> dir structure, it's just that I moved the location of GitRepositories to a ne...
53, 119, 43702
eclipse, egit, git
<h1>How to move Egit repository and working directory</h1> <p>I am new to Egit and created a new repository for a GWT project I'm working on. Unfortunately, I let it create the repository under my Dropbox folder, and now I'm regretting it because I'm syncing megabytes of temp files (e.g. *.class) over the internet. T...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,684
git
# How to move Egit repository and working directory I am new to Egit and created a new repository for a GWT project I'm working on. Unfortunately, I let it create the repository under my Dropbox folder, and now I'm regretting it because I'm syncing megabytes of temp files (e.g. *.class) over the internet. The "create ...
I managed to do it myself, here's how: - In Eclipse, right-click MyApp project, `Refactor->Move`. Move the Eclipse project to a new spot on disk. Note that I kept the `.../GitRepositories/MyApp/MyApp` dir structure, it's just that I moved the location of GitRepositories to a new place. Also note that this left the old...
38324782
.gitignore isn't ignoring my files
6
2016-07-12 09:21:10
<p>I'm currently using BitBucket for my repos with the git engine. I'm not using github since is a private project, so I can't set it public. </p> <p>When I create my <code>.gitignore</code> file with gitignore.io, trying to ignore PhpStorm and WebStorm, Gitkraken (which is my git client on Mac) it isn't ignoring the ...
6,302
5,784,743
2023-12-11 17:00:35
38,325,318
20
2016-07-12 09:46:12
1,492,276
2023-12-11 17:00:35
https://stackoverflow.com/q/38324782
https://stackoverflow.com/a/38325318
<p>Update your <code>.gitignore</code> file. For instance, add one more folder for those you want to untrack in <code>.gitignore</code>: <code>foldername</code>.</p> <p>To stop tracking a file, you need to remove it from the index. This can be achieved with the below command.</p> <p>Remove all tracked files, including ...
<p>Update your <code>.gitignore</code> file. For instance, add one more folder for those you want to untrack in <code>.gitignore</code>: <code>foldername</code>.</p> <p>To stop tracking a file, you need to remove it from the index. This can be achieved with the below command.</p> <p>Remove all tracked files, including ...
119, 8337, 25056, 66821, 119628
bitbucket, git, gitignore, gitkraken, phpstorm
<h1>.gitignore isn't ignoring my files</h1> <p>I'm currently using BitBucket for my repos with the git engine. I'm not using github since is a private project, so I can't set it public. </p> <p>When I create my <code>.gitignore</code> file with gitignore.io, trying to ignore PhpStorm and WebStorm, Gitkraken (which is ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,688
git
# .gitignore isn't ignoring my files I'm currently using BitBucket for my repos with the git engine. I'm not using github since is a private project, so I can't set it public. When I create my `.gitignore` file with gitignore.io, trying to ignore PhpStorm and WebStorm, Gitkraken (which is my git client on Mac) it isn...
Update your `.gitignore` file. For instance, add one more folder for those you want to untrack in `.gitignore`: `foldername`. To stop tracking a file, you need to remove it from the index. This can be achieved with the below command. Remove all tracked files, including wanted and unwanted: ``` git rm --cached . ``` ...
31857606
What files should I add to the .gitignore when using MATLAB and Simulink?
6
2015-08-06 13:50:23
<p>I would like to know what files I should add to the <code>.gitignore</code> file when I am using MATLAB and Simulink.</p> <p>Should the files <code>slx.original</code> be added?</p>
11,429
3,705,840
2019-03-18 14:41:07
31,858,071
20
2015-08-06 14:12:55
2,957,601
2019-03-18 14:41:07
https://stackoverflow.com/q/31857606
https://stackoverflow.com/a/31858071
<p>Github has a nice <a href="https://github.com/github/gitignore/" rel="noreferrer">gitignore</a> repo</p> <p>Specifically for Matlab projects, the <a href="https://github.com/github/gitignore/blob/master/Global/MATLAB.gitignore" rel="noreferrer">template</a> is:</p> <pre><code>##------------------------------------...
<p>Github has a nice <a href="https://github.com/github/gitignore/" rel="noreferrer">gitignore</a> repo</p> <p>Specifically for Matlab projects, the <a href="https://github.com/github/gitignore/blob/master/Global/MATLAB.gitignore" rel="noreferrer">template</a> is:</p> <pre><code>##------------------------------------...
854, 3788, 25056
gitignore, matlab, simulink
<h1>What files should I add to the .gitignore when using MATLAB and Simulink?</h1> <p>I would like to know what files I should add to the <code>.gitignore</code> file when I am using MATLAB and Simulink.</p> <p>Should the files <code>slx.original</code> be added?</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,689
git
# What files should I add to the .gitignore when using MATLAB and Simulink? I would like to know what files I should add to the `.gitignore` file when I am using MATLAB and Simulink. Should the files `slx.original` be added?
Github has a nice [gitignore](https://github.com/github/gitignore/) repo Specifically for Matlab projects, the [template](https://github.com/github/gitignore/blob/master/Global/MATLAB.gitignore) is: ``` ##--------------------------------------------------- ## Remove autosaves generated by the Matlab editor ## We have...
23913148
How to resolve git MERGING state?
6
2014-05-28 13:34:35
<p>I have a pull request from a source branch to a target branch.</p> <p>I have run: </p> <pre><code>$&gt; git checkout target-branch $&gt; git pull $&gt; git checkout source-branch $&gt; git merge target-branch </code></pre> <p>There were some conflicts which I have resolved with:</p> <pre><code>$&gt; git mergeto...
15,036
117,507
2014-05-28 13:37:45
23,913,220
20
2014-05-28 13:37:45
2,167,436
2014-05-28 13:37:45
https://stackoverflow.com/q/23913148
https://stackoverflow.com/a/23913220
<p>Most likely you need to <code>git commit</code> to commit your merge to your local repository. </p>
<p>Most likely you need to <code>git commit</code> to commit your merge to your local repository. </p>
119, 717, 28897
git, git-merge, merge
<h1>How to resolve git MERGING state?</h1> <p>I have a pull request from a source branch to a target branch.</p> <p>I have run: </p> <pre><code>$&gt; git checkout target-branch $&gt; git pull $&gt; git checkout source-branch $&gt; git merge target-branch </code></pre> <p>There were some conflicts which I have resol...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,690
git
# How to resolve git MERGING state? I have a pull request from a source branch to a target branch. I have run: ``` $> git checkout target-branch $> git pull $> git checkout source-branch $> git merge target-branch ``` There were some conflicts which I have resolved with: ``` $> git mergetool ``` This merge wasn't...
Most likely you need to `git commit` to commit your merge to your local repository.
10423143
How to exclude certain directories/files from a Git grep search
209
2012-05-02 23:31:46
<p>Is there a way to exclude certain paths/directories/files when searching a Git repository using <code>git grep</code>? Something similar to the <code>--exclude</code> option in the normal <code>grep</code> command?</p> <p>I need to use <code>git grep</code> because using <code>grep</code> directly runs too slowly on...
74,563
2,344,982
2025-05-30 18:52:50
10,423,194
19
2012-05-02 23:37:17
11,343
2025-05-30 18:33:08
https://stackoverflow.com/q/10423143
https://stackoverflow.com/a/10423194
<p>It is not possible in older versions of Git, but it <a href="http://git.661346.n2.nabble.com/git-grep-while-excluding-files-in-a-blacklist-td7195648.html" rel="nofollow noreferrer">was discussed</a>. A proposed workaround is in the link:</p> <blockquote> <p>You can put <code>*.dll</code> to .gitignore file then <cod...
<p>It is not possible in older versions of Git, but it <a href="http://git.661346.n2.nabble.com/git-grep-while-excluding-files-in-a-blacklist-td7195648.html" rel="nofollow noreferrer">was discussed</a>. A proposed workaround is in the link:</p> <blockquote> <p>You can put <code>*.dll</code> to .gitignore file then <cod...
119, 1271
git, grep
<h1>How to exclude certain directories/files from a Git grep search</h1> <p>Is there a way to exclude certain paths/directories/files when searching a Git repository using <code>git grep</code>? Something similar to the <code>--exclude</code> option in the normal <code>grep</code> command?</p> <p>I need to use <code>gi...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,691
git
# How to exclude certain directories/files from a Git grep search Is there a way to exclude certain paths/directories/files when searching a Git repository using `git grep`? Something similar to the `--exclude` option in the normal `grep` command? I need to use `git grep` because using `grep` directly runs too slowly...
It is not possible in older versions of Git, but it [was discussed](http://git.661346.n2.nabble.com/git-grep-while-excluding-files-in-a-blacklist-td7195648.html). A proposed workaround is in the link: > You can put `*.dll` to .gitignore file then `git grep --exclude-standard`. See also [onlynone's answer](https://sta...
12397752
How to Conclude a Git Cherry-Pick?
91
2012-09-13 00:14:47
<p>Yesterday I cherry-picked two commits into my main branch, one of them caused merge conflicts and I resolved them, committed and pushed them to origin. Today I am attempting to pull from the server when I get the following error:</p> <pre><code>$ git pull fatal: You have not concluded your cherry-pick (CHERRY_PICK_...
79,376
347,339
2019-07-21 03:31:36
12,398,108
19
2012-09-13 01:08:43
347,339
2012-09-13 01:08:43
https://stackoverflow.com/q/12397752
https://stackoverflow.com/a/12398108
<p>Solved with the following: <code>rm .git/CHERRY_PICK_HEAD</code> I realize this is dangerous as this doesn't guarantee internal consistency within git, but no issues for me so far...</p>
<p>Solved with the following: <code>rm .git/CHERRY_PICK_HEAD</code> I realize this is dangerous as this doesn't guarantee internal consistency within git, but no issues for me so far...</p>
119, 456, 36489, 78810
cherry-pick, git, git-cherry-pick, version-control
<h1>How to Conclude a Git Cherry-Pick?</h1> <p>Yesterday I cherry-picked two commits into my main branch, one of them caused merge conflicts and I resolved them, committed and pushed them to origin. Today I am attempting to pull from the server when I get the following error:</p> <pre><code>$ git pull fatal: You have ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,692
git
# How to Conclude a Git Cherry-Pick? Yesterday I cherry-picked two commits into my main branch, one of them caused merge conflicts and I resolved them, committed and pushed them to origin. Today I am attempting to pull from the server when I get the following error: ``` $ git pull fatal: You have not concluded your c...
Solved with the following: `rm .git/CHERRY_PICK_HEAD` I realize this is dangerous as this doesn't guarantee internal consistency within git, but no issues for me so far...
66508158
Git Pull Failed: Invocation failed Unexpected end of file from server
90
2021-03-06 16:47:11
<p>I'm trying to execute a <code>git pull</code> using Android Studio's built-in button, but it fails with this message:</p> <pre><code>Git Pull Failed Invocation failed Unexpected end of file from server java.lang.RuntimeException: Invocation failed Unexpected end of file from server ...
56,746
9,820,088
2023-01-02 18:42:26
67,673,867
19
2021-05-24 14:30:28
11,779,588
2022-07-27 14:07:54
https://stackoverflow.com/q/66508158
https://stackoverflow.com/a/67673867
<p>The error originates from the Android Studio Preview version (Bumblebee, Chipmunk, etc.). You can either update your Android Studio to a newer version, or you can use the inbuilt terminal and type the command below:</p> <pre><code>$ git pull </code></pre> <p>You may be prompted to re-enter a password or token.</p>
<p>The error originates from the Android Studio Preview version (Bumblebee, Chipmunk, etc.). You can either update your Android Studio to a newer version, or you can use the inbuilt terminal and type the command below:</p> <pre><code>$ git pull </code></pre> <p>You may be prompted to re-enter a password or token.</p>
119, 4860, 91905
android-studio, git, pull
<h1>Git Pull Failed: Invocation failed Unexpected end of file from server</h1> <p>I'm trying to execute a <code>git pull</code> using Android Studio's built-in button, but it fails with this message:</p> <pre><code>Git Pull Failed Invocation failed Unexpected end of file from server java...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,693
git
# Git Pull Failed: Invocation failed Unexpected end of file from server I'm trying to execute a `git pull` using Android Studio's built-in button, but it fails with this message: ``` Git Pull Failed Invocation failed Unexpected end of file from server java.lang.RuntimeException: Invoca...
The error originates from the Android Studio Preview version (Bumblebee, Chipmunk, etc.). You can either update your Android Studio to a newer version, or you can use the inbuilt terminal and type the command below: ``` $ git pull ``` You may be prompted to re-enter a password or token.
15628720
fatal: bad default revision 'HEAD'
82
2013-03-26 03:14:04
<p>I'm using GIT as my source control system. We have it installed on one of our Linux boxes. Tortoise GIT is my windows client.</p> <p>This morning I checked in some changes, and tagged the code. I then did a push of my local repository to the remote repository.</p> <p>When I go to my repository on the unix box and ...
182,435
1,600,419
2024-08-20 14:13:56
15,629,060
19
2013-03-26 03:47:41
1,290,731
2013-03-26 05:56:14
https://stackoverflow.com/q/15628720
https://stackoverflow.com/a/15629060
<p>Your repo is yours, what goes on in it is entirely your business until you push or (allow a) fetch or clone. When you deleted your windows repo -- that folder didn't represent your local repo, it was your actual local repo, you deleted everything done in it that was never pushed, fetched or cloned.</p> <p><em><stro...
<p>Your repo is yours, what goes on in it is entirely your business until you push or (allow a) fetch or clone. When you deleted your windows repo -- that folder didn't represent your local repo, it was your actual local repo, you deleted everything done in it that was never pushed, fetched or cloned.</p> <p><em><stro...
119
git
<h1>fatal: bad default revision 'HEAD'</h1> <p>I'm using GIT as my source control system. We have it installed on one of our Linux boxes. Tortoise GIT is my windows client.</p> <p>This morning I checked in some changes, and tagged the code. I then did a push of my local repository to the remote repository.</p> <p>Whe...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,694
git
# fatal: bad default revision 'HEAD' I'm using GIT as my source control system. We have it installed on one of our Linux boxes. Tortoise GIT is my windows client. This morning I checked in some changes, and tagged the code. I then did a push of my local repository to the remote repository. When I go to my repository...
Your repo is yours, what goes on in it is entirely your business until you push or (allow a) fetch or clone. When you deleted your windows repo -- that folder didn't represent your local repo, it was your actual local repo, you deleted everything done in it that was never pushed, fetched or cloned. ***edit:*** Ah, oka...
28947201
Multiple staging areas
63
2015-03-09 16:35:43
<p>Can I have multiple staging areas or achieve a similar effect using git?</p> <p>My typical work flow is along the lines of:</p> <ul> <li>work, work, work</li> <li>now I have an idea of something useful, let's commit it <code>git add -p</code>, <code>y</code>, <code>y</code></li> <li>but first these smaller style c...
4,584
688,106
2025-08-23 21:14:41
28,948,072
19
2015-03-09 17:23:17
1,256,452
2020-05-31 00:45:02
https://stackoverflow.com/q/28947201
https://stackoverflow.com/a/28948072
<p><strong>Edit, 30 May 2020</strong>: In Git 2.15 or later I recommend using <code>git worktree</code> instead of trying to do the below. There are some restrictions on added work-trees that make them somewhat annoying for this kind of work-flow, but it <em>can</em> work, and is built in to modern Git.</p> <p>Note t...
<p><strong>Edit, 30 May 2020</strong>: In Git 2.15 or later I recommend using <code>git worktree</code> instead of trying to do the below. There are some restrictions on added work-trees that make them somewhat annoying for this kind of work-flow, but it <em>can</em> work, and is built in to modern Git.</p> <p>Note t...
119
git
<h1>Multiple staging areas</h1> <p>Can I have multiple staging areas or achieve a similar effect using git?</p> <p>My typical work flow is along the lines of:</p> <ul> <li>work, work, work</li> <li>now I have an idea of something useful, let's commit it <code>git add -p</code>, <code>y</code>, <code>y</code></li> <li...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,695
git
# Multiple staging areas Can I have multiple staging areas or achieve a similar effect using git? My typical work flow is along the lines of: - work, work, work - now I have an idea of something useful, let's commit it `git add -p`, `y`, `y` - but first these smaller style changes: `git reset HEAD .` - `git add -p`,...
**Edit, 30 May 2020**: In Git 2.15 or later I recommend using `git worktree` instead of trying to do the below. There are some restrictions on added work-trees that make them somewhat annoying for this kind of work-flow, but it *can* work, and is built in to modern Git. Note that if you *do* do something like I descri...
11534655
Git keyword substitution like those in Subversion?
56
2012-07-18 05:14:07
<p>I used to work under Subversion/SVN and was instantly using nice feature called keyword substitution. Just putting in source files smth like:</p> <pre><code>/* * $Author: ivanovpv $ * $Rev: 42 $ * $LastChangedDate: 2012-05-25 21:47:42 +0200 (Fri, 25 May 2012) $ */ </code></pre> <p>And each time Subversio...
35,169
472,270
2022-07-14 18:47:38
17,242,693
19
2013-06-21 19:13:44
1,775,715
2017-08-18 09:48:00
https://stackoverflow.com/q/11534655
https://stackoverflow.com/a/17242693
<h2>Solution</h2> <p>Well, you could easily implement such a feature yourself.</p> <p>Basically I embedded the commit command into a shell script. This script will first substitute the desired macros and then commit the changes. The project consists of two files:</p> <h2>Content?</h2> <p><code>keysub</code>, a bash...
<h2>Solution</h2> <p>Well, you could easily implement such a feature yourself.</p> <p>Basically I embedded the commit command into a shell script. This script will first substitute the desired macros and then commit the changes. The project consists of two files:</p> <h2>Content?</h2> <p><code>keysub</code>, a bash...
63, 119, 456, 82746
git, svn, version-control, version-control-keywords
<h1>Git keyword substitution like those in Subversion?</h1> <p>I used to work under Subversion/SVN and was instantly using nice feature called keyword substitution. Just putting in source files smth like:</p> <pre><code>/* * $Author: ivanovpv $ * $Rev: 42 $ * $LastChangedDate: 2012-05-25 21:47:42 +0200 (Fri, ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,696
git
# Git keyword substitution like those in Subversion? I used to work under Subversion/SVN and was instantly using nice feature called keyword substitution. Just putting in source files smth like: ``` /* * $Author: ivanovpv $ * $Rev: 42 $ * $LastChangedDate: 2012-05-25 21:47:42 +0200 (Fri, 25 May 2012) $ */ `...
## Solution Well, you could easily implement such a feature yourself. Basically I embedded the commit command into a shell script. This script will first substitute the desired macros and then commit the changes. The project consists of two files: ## Content? `keysub`, a bash shell script and `keysub.awk` an awk sc...
8507368
Programmatically (not manually) finding the path where Git is installed on a Windows system
52
2011-12-14 15:47:16
<p>I'd like to write a small build helper tool that shall read some properties of the current Git working directory, like the last commit hash, whether there's modified files and so on. I found that it is easier to use the installed Git binaries instead of reading the .git directory with its compressed files in an unkn...
90,043
143,684
2021-05-21 16:00:43
8,761,099
19
2012-01-06 16:32:23
1,127,485
2016-01-10 16:26:24
https://stackoverflow.com/q/8507368
https://stackoverflow.com/a/8761099
<p>I'm using the following batch file to find out where Git for Windows has been installed:</p> <pre><code>@echo off setlocal enabledelayedexpansion rem Read the Git for Windows installation path from the Registry. for %%k in (HKCU HKLM) do ( for %%w in (\ \Wow6432Node\) do ( for /f "skip=2 delims=: toke...
<p>I'm using the following batch file to find out where Git for Windows has been installed:</p> <pre><code>@echo off setlocal enabledelayedexpansion rem Read the Git for Windows installation path from the Registry. for %%k in (HKCU HKLM) do ( for %%w in (\ \Wow6432Node\) do ( for /f "skip=2 delims=: toke...
64, 119
git, windows
<h1>Programmatically (not manually) finding the path where Git is installed on a Windows system</h1> <p>I'd like to write a small build helper tool that shall read some properties of the current Git working directory, like the last commit hash, whether there's modified files and so on. I found that it is easier to use ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,698
git
# Programmatically (not manually) finding the path where Git is installed on a Windows system I'd like to write a small build helper tool that shall read some properties of the current Git working directory, like the last commit hash, whether there's modified files and so on. I found that it is easier to use the insta...
I'm using the following batch file to find out where Git for Windows has been installed: ``` @echo off setlocal enabledelayedexpansion rem Read the Git for Windows installation path from the Registry. for %%k in (HKCU HKLM) do ( for %%w in (\ \Wow6432Node\) do ( for /f "skip=2 delims=: tokens=1*" %%a in ...
40262231
Are C++14 digit separators allowed in user defined literals?
42
2016-10-26 12:23:39
<p>While clang compiles the following line, g++ 6.1 complains about the digit separator (see <a href="http://coliru.stacked-crooked.com/a/7c86b6ff59d95d7b">live example on Coliru</a>):</p> <pre><code>auto time = 01'23s; </code></pre> <p>Which compiler, if any, is correct according to the C++14 standard (N3796)? </p> ...
2,917
831,725
2016-10-26 16:08:24
40,262,320
19
2016-10-26 12:27:50
2,456,565
2016-10-26 12:33:10
https://stackoverflow.com/q/40262231
https://stackoverflow.com/a/40262320
<p>If you look at the grammar, <em>user-defined-integer-literal</em> can be <em>octal-literal ud-suffix</em>, and <em>octal-literal</em> is defined as either <code>0</code> or <em>octal-literal ’<sub>opt</sub> octal-digit</em>.</p> <blockquote> <p>N4140 §2.14.8</p> <p><em>user-defined-literal</em>:</p> <ul...
<p>If you look at the grammar, <em>user-defined-integer-literal</em> can be <em>octal-literal ud-suffix</em>, and <em>octal-literal</em> is defined as either <code>0</code> or <em>octal-literal ’<sub>opt</sub> octal-digit</em>.</p> <blockquote> <p>N4140 §2.14.8</p> <p><em>user-defined-literal</em>:</p> <ul...
10, 38504, 62750, 106410, 114756
c++, c++14, digit-separator, language-lawyer, user-defined-literals
<h1>Are C++14 digit separators allowed in user defined literals?</h1> <p>While clang compiles the following line, g++ 6.1 complains about the digit separator (see <a href="http://coliru.stacked-crooked.com/a/7c86b6ff59d95d7b">live example on Coliru</a>):</p> <pre><code>auto time = 01'23s; </code></pre> <p>Which compi...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,699
git
# Are C++14 digit separators allowed in user defined literals? While clang compiles the following line, g++ 6.1 complains about the digit separator (see [live example on Coliru](http://coliru.stacked-crooked.com/a/7c86b6ff59d95d7b)): ``` auto time = 01'23s; ``` Which compiler, if any, is correct according to the C++...
If you look at the grammar, *user-defined-integer-literal* can be *octal-literal ud-suffix*, and *octal-literal* is defined as either `0` or *octal-literal ’opt octal-digit*. > N4140 §2.14.8 > > *user-defined-literal*: > > - *user-defined-integer-literal* > - [...] > > *user-defined-integer-literal*: > > - *octal-lite...
42049390
.gitignore not ignoring node_modules
40
2017-02-05 06:59:17
<p>Even after adding the <code>.gitignore</code> file to the root of the <code>.git</code> repository, I cannot make git ignore the <code>node_modules</code> directory.</p> <p>The files have not been added for Git to track.</p> <p>I have gone through earlier stack overflow questions, and also tried adding a comment l...
70,672
5,127,319
2024-06-12 13:52:24
42,049,429
19
2017-02-05 07:04:59
641,955
2017-02-05 07:12:18
https://stackoverflow.com/q/42049390
https://stackoverflow.com/a/42049429
<blockquote> <p>Even after adding the .gitignore file to the root of the .git repository, I cannot make git ignore the node_modules directory.</p> </blockquote> <p>The <code>.gitignore</code> file should be placed in the root of the working tree (also known as the root of your project), which is just above the <code...
<blockquote> <p>Even after adding the .gitignore file to the root of the .git repository, I cannot make git ignore the node_modules directory.</p> </blockquote> <p>The <code>.gitignore</code> file should be placed in the root of the working tree (also known as the root of your project), which is just above the <code...
119
git
<h1>.gitignore not ignoring node_modules</h1> <p>Even after adding the <code>.gitignore</code> file to the root of the <code>.git</code> repository, I cannot make git ignore the <code>node_modules</code> directory.</p> <p>The files have not been added for Git to track.</p> <p>I have gone through earlier stack overflo...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,700
git
# .gitignore not ignoring node_modules Even after adding the `.gitignore` file to the root of the `.git` repository, I cannot make git ignore the `node_modules` directory. The files have not been added for Git to track. I have gone through earlier stack overflow questions, and also tried adding a comment line to the...
> Even after adding the .gitignore file to the root of the .git repository, I cannot make git ignore the node_modules directory. The `.gitignore` file should be placed in the root of the working tree (also known as the root of your project), which is just above the `.git` directory. Inside the `.git` directory the fil...
4640020
Progress indicator for git clone
36
2011-01-09 15:36:48
<p>Is it possible to get a progress bar when doing a <code>git clone</code>? I'm wondering because I am currently doing a git clone that has taken a few minutes so far and would be curious to know if it is going to finish soon.</p>
48,633
96,855
2023-12-31 17:33:04
38,783,446
19
2016-08-05 07:21:51
6,309
2020-04-18 15:56:21
https://stackoverflow.com/q/4640020
https://stackoverflow.com/a/38783446
<blockquote> <p>I am currently doing a git clone that has taken a few minutes so far and would be curious to know if it is going to finish soon.</p> </blockquote> <p>With Git 2.10 (Q3 2016), <code>git clone --progress</code> will be more verbose.</p> <p>See <a href="https://github.com/git/git/commit/38e590ea12336bc...
<blockquote> <p>I am currently doing a git clone that has taken a few minutes so far and would be curious to know if it is going to finish soon.</p> </blockquote> <p>With Git 2.10 (Q3 2016), <code>git clone --progress</code> will be more verbose.</p> <p>See <a href="https://github.com/git/git/commit/38e590ea12336bc...
119, 7060, 34099
git, git-clone, progress
<h1>Progress indicator for git clone</h1> <p>Is it possible to get a progress bar when doing a <code>git clone</code>? I'm wondering because I am currently doing a git clone that has taken a few minutes so far and would be curious to know if it is going to finish soon.</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,702
git
# Progress indicator for git clone Is it possible to get a progress bar when doing a `git clone`? I'm wondering because I am currently doing a git clone that has taken a few minutes so far and would be curious to know if it is going to finish soon.
> I am currently doing a git clone that has taken a few minutes so far and would be curious to know if it is going to finish soon. With Git 2.10 (Q3 2016), `git clone --progress` will be more verbose. See [commit 38e590e](https://github.com/git/git/commit/38e590ea12336bcfae0310092885743e6ba79781) by Jeff King (`peff`...
1316364
git whitespace woes
35
2009-08-22 16:27:02
<h2>Conflicts on whitespace suck</h2> <p>Whitespace has ended up being a horrible pain for me while using git.</p> <pre><code>git config apply.whitespace=strip </code></pre> <p>seems to highten your chances of getting conflicts (as you strip unneeded whitespace and then other collaborators see the stripped whitespac...
22,449
69,993
2024-04-09 13:54:01
1,316,595
19
2009-08-22 17:59:55
6,309
2024-04-09 13:54:01
https://stackoverflow.com/q/1316364
https://stackoverflow.com/a/1316595
<p><a href="https://web.archive.org/web/20100214050837/http://www.kernel.org/pub/software/scm/git/docs/RelNotes-1.6.0.4.txt" rel="nofollow noreferrer">Git1.6.0.4</a> seems a bit old, especially if you consider that:</p> <ul> <li>in <a href="https://web.archive.org/web/20100214051742/http://www.kernel.org/pub/software/s...
<p><a href="https://web.archive.org/web/20100214050837/http://www.kernel.org/pub/software/scm/git/docs/RelNotes-1.6.0.4.txt" rel="nofollow noreferrer">Git1.6.0.4</a> seems a bit old, especially if you consider that:</p> <ul> <li>in <a href="https://web.archive.org/web/20100214051742/http://www.kernel.org/pub/software/s...
119, 602, 1084
git, settings, whitespace
<h1>git whitespace woes</h1> <h2>Conflicts on whitespace suck</h2> <p>Whitespace has ended up being a horrible pain for me while using git.</p> <pre><code>git config apply.whitespace=strip </code></pre> <p>seems to highten your chances of getting conflicts (as you strip unneeded whitespace and then other collaborato...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,703
git
# git whitespace woes ## Conflicts on whitespace suck Whitespace has ended up being a horrible pain for me while using git. ``` git config apply.whitespace=strip ``` seems to highten your chances of getting conflicts (as you strip unneeded whitespace and then other collaborators see the stripped whitespace as a cha...
[Git1.6.0.4](https://web.archive.org/web/20100214050837/http://www.kernel.org/pub/software/scm/git/docs/RelNotes-1.6.0.4.txt) seems a bit old, especially if you consider that: - in [1.6.3.4](https://web.archive.org/web/20100214051742/http://www.kernel.org/pub/software/scm/git/docs/RelNotes-1.6.3.4.txt), "`git apply --...
4444091
Update a development team with rewritten Git repo history, removing big files
34
2010-12-14 20:51:54
<p>I have a git repo with some very large binaries in it. I no longer need them, and I don't care about being able to checkout the files from earlier commits. So, to reduce the repo size, I want to delete the binaries from the history altogether.</p> <p>After a web search, I concluded that my best (only?) option is to...
14,305
284,681
2014-02-19 13:02:29
4,444,139
19
2010-12-14 20:55:49
501,250
2010-12-14 20:55:49
https://stackoverflow.com/q/4444091
https://stackoverflow.com/a/4444139
<p>Yes, your solution will work. You also have another option: instead of doing this on the central repo, run the filter on your clone and then push it back with <code>git push --force --all</code>. This will force the server to accept the new branches from your repository. This replaces step 2 only; the other steps...
<p>Yes, your solution will work. You also have another option: instead of doing this on the central repo, run the filter on your clone and then push it back with <code>git push --force --all</code>. This will force the server to accept the new branches from your repository. This replaces step 2 only; the other steps...
119, 659, 46509, 91259
git, git-filter-branch, git-rewrite-history, project-planning
<h1>Update a development team with rewritten Git repo history, removing big files</h1> <p>I have a git repo with some very large binaries in it. I no longer need them, and I don't care about being able to checkout the files from earlier commits. So, to reduce the repo size, I want to delete the binaries from the histor...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,705
git
# Update a development team with rewritten Git repo history, removing big files I have a git repo with some very large binaries in it. I no longer need them, and I don't care about being able to checkout the files from earlier commits. So, to reduce the repo size, I want to delete the binaries from the history altoget...
Yes, your solution will work. You also have another option: instead of doing this on the central repo, run the filter on your clone and then push it back with `git push --force --all`. This will force the server to accept the new branches from your repository. This replaces step 2 only; the other steps will be the same...
5215193
How to list files in specific revision in `git`?
33
2011-03-07 02:26:39
<p>I want to know file list in specific revision in git repository. How can I do this?</p>
7,819
246,776
2012-04-17 13:02:21
5,215,205
19
2011-03-07 02:29:43
23,845
2011-03-07 03:13:31
https://stackoverflow.com/q/5215193
https://stackoverflow.com/a/5215205
<p>See dannyp's answer.</p> <pre><code> git ls-tree -r --name-only $REV </code></pre>
<p>See dannyp's answer.</p> <pre><code> git ls-tree -r --name-only $REV </code></pre>
119, 1555, 5310, 5608
file, git, list, revision
<h1>How to list files in specific revision in `git`?</h1> <p>I want to know file list in specific revision in git repository. How can I do this?</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,706
git
# How to list files in specific revision in `git`? I want to know file list in specific revision in git repository. How can I do this?
See dannyp's answer. ``` git ls-tree -r --name-only $REV ```
19088396
Does "git push" push all commits from other branches?
31
2013-09-30 07:12:36
<p>If I have many unpushed commits spread among many branches in my local repo, what happens if I type <code>git push</code>? Will all of those commits be pushed or only those which belong to the current branch?</p>
26,850
1,554,899
2016-06-29 03:05:14
19,090,101
19
2013-09-30 08:53:20
6,309
2013-09-30 08:53:20
https://stackoverflow.com/q/19088396
https://stackoverflow.com/a/19090101
<p>It also depends on your <strong>push policies (<code>git config push.default</code>)</strong>. </p> <p>As I explain in "<a href="https://stackoverflow.com/a/13751847/6309">git - push current vs. push upstream (tracking)</a>", only the "matching" policy pushes more than the current branch.</p> <blockquote> <p><st...
<p>It also depends on your <strong>push policies (<code>git config push.default</code>)</strong>. </p> <p>As I explain in "<a href="https://stackoverflow.com/a/13751847/6309">git - push current vs. push upstream (tracking)</a>", only the "matching" policy pushes more than the current branch.</p> <blockquote> <p><st...
119, 28898
git, git-push
<h1>Does "git push" push all commits from other branches?</h1> <p>If I have many unpushed commits spread among many branches in my local repo, what happens if I type <code>git push</code>? Will all of those commits be pushed or only those which belong to the current branch?</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,710
git
# Does "git push" push all commits from other branches? If I have many unpushed commits spread among many branches in my local repo, what happens if I type `git push`? Will all of those commits be pushed or only those which belong to the current branch?
It also depends on your **push policies (`git config push.default`)**. As I explain in "[git - push current vs. push upstream (tracking)](https://stackoverflow.com/a/13751847/6309)", only the "matching" policy pushes more than the current branch. > **push all branches having the same name on both ends**. > This mak...
14759345
How to split a git repository and follow directory renames?
31
2013-02-07 19:27:04
<p>I currently have a big git repository that contains many projects, each one in its own subdirectory. I need to split it into individual repositories, each project in its own repo. </p> <p>I tried <code>git filter-branch --prune-empty --subdirectory-filter PROJECT master</code></p> <p>However, many project director...
4,997
331,862
2017-05-15 17:17:41
14,764,368
19
2013-02-08 01:37:52
331,862
2013-02-08 01:37:52
https://stackoverflow.com/q/14759345
https://stackoverflow.com/a/14764368
<p>Thanks to @Chronial, I was able to cook a script to massage my git repo according to my needs:</p> <pre><code>git filter-branch --prune-empty --index-filter ' # Delete files which are NOT needed git ls-files -z | egrep -zv "^(NAME1|NAME2|NAME3)" | xargs -0 -r git rm --cached -q # ...
<p>Thanks to @Chronial, I was able to cook a script to massage my git repo according to my needs:</p> <pre><code>git filter-branch --prune-empty --index-filter ' # Delete files which are NOT needed git ls-files -z | egrep -zv "^(NAME1|NAME2|NAME3)" | xargs -0 -r git rm --cached -q # ...
119, 46509
git, git-filter-branch
<h1>How to split a git repository and follow directory renames?</h1> <p>I currently have a big git repository that contains many projects, each one in its own subdirectory. I need to split it into individual repositories, each project in its own repo. </p> <p>I tried <code>git filter-branch --prune-empty --subdirector...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,711
git
# How to split a git repository and follow directory renames? I currently have a big git repository that contains many projects, each one in its own subdirectory. I need to split it into individual repositories, each project in its own repo. I tried `git filter-branch --prune-empty --subdirectory-filter PROJECT maste...
Thanks to @Chronial, I was able to cook a script to massage my git repo according to my needs: ``` git filter-branch --prune-empty --index-filter ' # Delete files which are NOT needed git ls-files -z | egrep -zv "^(NAME1|NAME2|NAME3)" | xargs -0 -r git rm --cached -q # Move files to ...
6458790
Is there a way to make git over http timeout?
31
2011-06-23 18:19:21
<p>I'm having a script running git clone/pull automatically (this is actually happening inside jenkins CI, but my question is more general). The remote git server is HTTPS based. The machine with the git client has a flaky DSL internet connection, so it sometimes reconnects and changes IP address, losing all its existi...
42,547
812,808
2025-03-11 14:41:15
6,462,136
19
2011-06-24 00:33:49
526,535
2023-05-20 09:23:46
https://stackoverflow.com/q/6458790
https://stackoverflow.com/a/6462136
<p>You can try using</p> <blockquote> <h2><code>http.lowSpeedLimit</code>, <code>http.lowSpeedTime</code>:</h2> <p>If the HTTP transfer speed, in <strong>bytes per second</strong>, is less than 'http.lowSpeedLimit' for longer than 'http.lowSpeedTime' seconds, the transfer is aborted.<br /> Can be overridden by the <cod...
<p>You can try using</p> <blockquote> <h2><code>http.lowSpeedLimit</code>, <code>http.lowSpeedTime</code>:</h2> <p>If the HTTP transfer speed, in <strong>bytes per second</strong>, is less than 'http.lowSpeedLimit' for longer than 'http.lowSpeedTime' seconds, the transfer is aborted.<br /> Can be overridden by the <cod...
119, 2702, 5210, 64999
git, http, jenkins, timeout
<h1>Is there a way to make git over http timeout?</h1> <p>I'm having a script running git clone/pull automatically (this is actually happening inside jenkins CI, but my question is more general). The remote git server is HTTPS based. The machine with the git client has a flaky DSL internet connection, so it sometimes r...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,712
git
# Is there a way to make git over http timeout? I'm having a script running git clone/pull automatically (this is actually happening inside jenkins CI, but my question is more general). The remote git server is HTTPS based. The machine with the git client has a flaky DSL internet connection, so it sometimes reconnects...
You can try using > ## `http.lowSpeedLimit`, `http.lowSpeedTime`: > > If the HTTP transfer speed, in **bytes per second**, is less than 'http.lowSpeedLimit' for longer than 'http.lowSpeedTime' seconds, the transfer is aborted. > Can be overridden by the `GIT_HTTP_LOW_SPEED_LIMIT` and > `GIT_HTTP_LOW_SPEED_TIME` envi...
3613682
How do you restore a corrupted object in a git repository (for newbies)?
31
2010-08-31 22:29:18
<p>I tried to open my repository today and it came up with no commit history. Everything I tried (git status, git log, git checkout...) threw an error about a corrupt object.</p> <p>I researched this problem online and found the <a href="http://www.kernel.org/pub/software/scm/git/docs/howto/recover-corrupted-blob-obje...
66,947
436,424
2016-12-21 02:14:15
3,619,208
19
2010-09-01 14:37:04
119,963
2010-09-01 14:44:36
https://stackoverflow.com/q/3613682
https://stackoverflow.com/a/3619208
<p>Okay, so. We can see from the second error message that the corrupt object which you moved was a commit. (HEAD was pointing to it!) Unfortunately, this means that it's hard to manually repair it. (By "hard" I mean likely impossible unless you can remember exactly what the commit message was and what time you made th...
<p>Okay, so. We can see from the second error message that the corrupt object which you moved was a commit. (HEAD was pointing to it!) Unfortunately, this means that it's hard to manually repair it. (By "hard" I mean likely impossible unless you can remember exactly what the commit message was and what time you made th...
119, 2200
git, recovery
<h1>How do you restore a corrupted object in a git repository (for newbies)?</h1> <p>I tried to open my repository today and it came up with no commit history. Everything I tried (git status, git log, git checkout...) threw an error about a corrupt object.</p> <p>I researched this problem online and found the <a href=...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,713
git
# How do you restore a corrupted object in a git repository (for newbies)? I tried to open my repository today and it came up with no commit history. Everything I tried (git status, git log, git checkout...) threw an error about a corrupt object. I researched this problem online and found the [article](http://www.ker...
Okay, so. We can see from the second error message that the corrupt object which you moved was a commit. (HEAD was pointing to it!) Unfortunately, this means that it's hard to manually repair it. (By "hard" I mean likely impossible unless you can remember exactly what the commit message was and what time you made the c...
1237021
Why does 'git stash apply' stage my changes?
30
2009-08-06 04:46:59
<p>I make a change and then I <code>git stash</code> and then I <code>git stash apply</code></p> <p>My question is </p> <ol> <li><p>why after I <code>git stash apply</code>, my change becomes 'staged'? i.e. I won't see anything if I do <code>git diff</code>, I only see my difference if I do <code>git diff --cached<...
15,714
125,440
2018-11-19 15:31:13
1,237,038
19
2009-08-06 04:53:19
893
2009-08-06 04:53:19
https://stackoverflow.com/q/1237021
https://stackoverflow.com/a/1237038
<p>If you find that your changes are unexpectedly staged, do:</p> <pre><code>git reset HEAD </code></pre> <p>I usually only see this if there is a conflict when applying the stashed changes. You will want to check to see whether this is the case before doing the <code>git reset</code>.</p> <p>The <code>git stash</co...
<p>If you find that your changes are unexpectedly staged, do:</p> <pre><code>git reset HEAD </code></pre> <p>I usually only see this if there is a conflict when applying the stashed changes. You will want to check to see whether this is the case before doing the <code>git reset</code>.</p> <p>The <code>git stash</co...
119
git
<h1>Why does 'git stash apply' stage my changes?</h1> <p>I make a change and then I <code>git stash</code> and then I <code>git stash apply</code></p> <p>My question is </p> <ol> <li><p>why after I <code>git stash apply</code>, my change becomes 'staged'? i.e. I won't see anything if I do <code>git diff</code>, I o...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,714
git
# Why does 'git stash apply' stage my changes? I make a change and then I `git stash` and then I `git stash apply` My question is 1. why after I `git stash apply`, my change becomes 'staged'? i.e. I won't see anything if I do `git diff`, I only see my difference if I do `git diff --cached`? 2. Is there anyway to 'un...
If you find that your changes are unexpectedly staged, do: ``` git reset HEAD ``` I usually only see this if there is a conflict when applying the stashed changes. You will want to check to see whether this is the case before doing the `git reset`. The `git stash` command is the most appropriate command for your use...
50844087
What's the difference among "git fetch && git checkout" versus "git checkout" only?
29
2018-06-13 18:37:33
<p>Should do we always do as: </p> <pre><code>git fetch &amp;&amp; git checkout </code></pre> <p>Or only, </p> <pre><code>git checkout </code></pre> <p>?</p> <p>For example when doing a checkout from a branch in bitbucket they provide the command as: </p> <p><a href="https://i.sstatic.net/zUmsV.png" rel="noreferr...
68,199
1,792,086
2020-04-24 13:22:50
50,991,451
19
2018-06-22 15:42:42
1,876,722
2018-06-22 15:42:42
https://stackoverflow.com/q/50844087
https://stackoverflow.com/a/50991451
<p>To chime in here since I have to use Bitbucket daily for multiple projects and multiple branches I will give you my recommendation. </p> <p>If you checkout from Bitbucket, i.e. create a branch, then you should be ok using the commands that they have provided as you pasted in your example. However, since it is likel...
<p>To chime in here since I have to use Bitbucket daily for multiple projects and multiple branches I will give you my recommendation. </p> <p>If you checkout from Bitbucket, i.e. create a branch, then you should be ok using the commands that they have provided as you pasted in your example. However, since it is likel...
119, 33720, 37230
git, git-checkout, git-fetch
<h1>What's the difference among "git fetch && git checkout" versus "git checkout" only?</h1> <p>Should do we always do as: </p> <pre><code>git fetch &amp;&amp; git checkout </code></pre> <p>Or only, </p> <pre><code>git checkout </code></pre> <p>?</p> <p>For example when doing a checkout from a branch in bitbucket ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,715
git
# What's the difference among "git fetch && git checkout" versus "git checkout" only? Should do we always do as: ``` git fetch && git checkout ``` Or only, ``` git checkout ``` ? For example when doing a checkout from a branch in bitbucket they provide the command as: [![enter image description here](https://i.s...
To chime in here since I have to use Bitbucket daily for multiple projects and multiple branches I will give you my recommendation. If you checkout from Bitbucket, i.e. create a branch, then you should be ok using the commands that they have provided as you pasted in your example. However, since it is likely that afte...
14831877
Git - Include files from other repositories
29
2013-02-12 11:49:11
<p>With Git, I'd like to include some common JS/CSS library and/or utility methods <em>(i.e. specific files from another repo)</em> in my project, and I'd like it so they're always up-to-date. I don't really want the entire remote repository(s). Bonus if I can work on my "local copies" of the remote files and push th...
19,402
1,037,948
2014-03-04 17:40:27
22,179,091
19
2014-03-04 17:40:27
1,049,112
2014-03-04 17:40:27
https://stackoverflow.com/q/14831877
https://stackoverflow.com/a/22179091
<p>Git does not have any support for picking out select files in a remote project. You could pick out the files you want with subtree and then figure out some sort of strategy for getting it back in, but that usually is way to complicated, especially if you suddenly decide you want a couple more files than you origina...
<p>Git does not have any support for picking out select files in a remote project. You could pick out the files you want with subtree and then figure out some sort of strategy for getting it back in, but that usually is way to complicated, especially if you suddenly decide you want a couple more files than you origina...
119, 758, 9608
git, organization, workflow
<h1>Git - Include files from other repositories</h1> <p>With Git, I'd like to include some common JS/CSS library and/or utility methods <em>(i.e. specific files from another repo)</em> in my project, and I'd like it so they're always up-to-date. I don't really want the entire remote repository(s). Bonus if I can work...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,716
git
# Git - Include files from other repositories With Git, I'd like to include some common JS/CSS library and/or utility methods *(i.e. specific files from another repo)* in my project, and I'd like it so they're always up-to-date. I don't really want the entire remote repository(s). Bonus if I can work on my "local copi...
Git does not have any support for picking out select files in a remote project. You could pick out the files you want with subtree and then figure out some sort of strategy for getting it back in, but that usually is way to complicated, especially if you suddenly decide you want a couple more files than you originally ...
16548486
git : give me the repo, nuke everything local, I don't care
28
2013-05-14 16:39:16
<p>Does git have any pull/checkout 'nuclear option' to get the repo? I don't care about any conflicts, I don't need any of my local stuff, just want the goods so I can work.</p> <p>[edit] to clarify my issues:</p> <pre><code>$ git pull error: Your local changes to the following files would be overwritten by merge: ...
15,680
2,117,553
2016-11-29 14:59:59
16,548,518
19
2013-05-14 16:41:24
704,703
2013-05-15 17:55:02
https://stackoverflow.com/q/16548486
https://stackoverflow.com/a/16548518
<p>Better for you to understand the various git commands then to just find the one you need "right now" as you will come up with this situation many times and just learn piecemeal while grumbling and blaming git.</p> <p>EDIT: I went ahead and tried all the options and this should do it. Thanks to pauljz in the comment...
<p>Better for you to understand the various git commands then to just find the one you need "right now" as you will come up with this situation many times and just learn piecemeal while grumbling and blaming git.</p> <p>EDIT: I went ahead and tried all the options and this should do it. Thanks to pauljz in the comment...
119
git
<h1>git : give me the repo, nuke everything local, I don't care</h1> <p>Does git have any pull/checkout 'nuclear option' to get the repo? I don't care about any conflicts, I don't need any of my local stuff, just want the goods so I can work.</p> <p>[edit] to clarify my issues:</p> <pre><code>$ git pull error: Your ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,718
git
# git : give me the repo, nuke everything local, I don't care Does git have any pull/checkout 'nuclear option' to get the repo? I don't care about any conflicts, I don't need any of my local stuff, just want the goods so I can work. [edit] to clarify my issues: ``` $ git pull error: Your local changes to the followi...
Better for you to understand the various git commands then to just find the one you need "right now" as you will come up with this situation many times and just learn piecemeal while grumbling and blaming git. EDIT: I went ahead and tried all the options and this should do it. Thanks to pauljz in the comments. ``` gi...
70392689
Clone another branch after cloning single-branch
27
2021-12-17 11:46:33
<p>I'm using the below command to clone one branch:</p> <pre><code>git clone user@git-server:project_name.git -b branch_name --single-branch /your/folder </code></pre> <p>Now I want to check out another branch from the server. I tried the below command and it didn't work</p> <pre><code>git checkout another_branch </cod...
7,791
265,341
2021-12-17 22:09:57
70,392,801
19
2021-12-17 11:56:53
2,422,776
2021-12-17 11:56:53
https://stackoverflow.com/q/70392689
https://stackoverflow.com/a/70392801
<p>You can fetch another remote branch by specifying it after the remote name in a <code>git fetch</code> call:</p> <pre><code>git fetch origin another_branch </code></pre> <p>Once it's fetched, you'll find it in the <code>FETCH_HEAD</code>, and an use that to create a local branch:</p> <pre><code>git checkout FETCH_HE...
<p>You can fetch another remote branch by specifying it after the remote name in a <code>git fetch</code> call:</p> <pre><code>git fetch origin another_branch </code></pre> <p>Once it's fetched, you'll find it in the <code>FETCH_HEAD</code>, and an use that to create a local branch:</p> <pre><code>git checkout FETCH_HE...
119, 1879, 34099, 37230
branch, git, git-checkout, git-clone
<h1>Clone another branch after cloning single-branch</h1> <p>I'm using the below command to clone one branch:</p> <pre><code>git clone user@git-server:project_name.git -b branch_name --single-branch /your/folder </code></pre> <p>Now I want to check out another branch from the server. I tried the below command and it di...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,719
git
# Clone another branch after cloning single-branch I'm using the below command to clone one branch: ``` git clone user@git-server:project_name.git -b branch_name --single-branch /your/folder ``` Now I want to check out another branch from the server. I tried the below command and it didn't work ``` git checkout ano...
You can fetch another remote branch by specifying it after the remote name in a `git fetch` call: ``` git fetch origin another_branch ``` Once it's fetched, you'll find it in the `FETCH_HEAD`, and an use that to create a local branch: ``` git checkout FETCH_HEAD -b another_branch ```
20603846
Git merge other branch into another branch?
27
2013-12-16 05:07:24
<p>Is it possible to merge other branch into another branch?</p> <p>For example, I'm in <code>branch1</code> and want to pull <code>remote/develop</code> into <code>develop</code> branch and then merge develop into current <code>branch1</code>.</p> <p>What am I doing is <code>checkout develop</code>(maybe <code>stash...
68,762
2,038,901
2022-11-23 15:30:42
20,603,938
19
2013-12-16 05:16:43
337,903
2013-12-16 05:16:43
https://stackoverflow.com/q/20603846
https://stackoverflow.com/a/20603938
<p>A slightly quicker option would be to (while on <code>branch1</code>):</p> <pre><code>git fetch git merge remote/develop </code></pre> <p>This will get your <code>remote/develop</code> merged into <code>branch1</code>, however it should be noted that your local develop branch won't be updated.</p>
<p>A slightly quicker option would be to (while on <code>branch1</code>):</p> <pre><code>git fetch git merge remote/develop </code></pre> <p>This will get your <code>remote/develop</code> merged into <code>branch1</code>, however it should be noted that your local develop branch won't be updated.</p>
119
git
<h1>Git merge other branch into another branch?</h1> <p>Is it possible to merge other branch into another branch?</p> <p>For example, I'm in <code>branch1</code> and want to pull <code>remote/develop</code> into <code>develop</code> branch and then merge develop into current <code>branch1</code>.</p> <p>What am I doi...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,722
git
# Git merge other branch into another branch? Is it possible to merge other branch into another branch? For example, I'm in `branch1` and want to pull `remote/develop` into `develop` branch and then merge develop into current `branch1`. What am I doing is `checkout develop`(maybe `stash` first), `pull`, `checkout br...
A slightly quicker option would be to (while on `branch1`): ``` git fetch git merge remote/develop ``` This will get your `remote/develop` merged into `branch1`, however it should be noted that your local develop branch won't be updated.
9050978
'Your branch is ahead of 'origin/master' by 1 commit' on explicit push
27
2012-01-29 04:36:27
<p>I'm new to git, and I can't make sense of the following behavior:</p> <p>I have a bitbucket repo that I clone locally, then I modify and commit locally, then I push to the remote repo. If I do an implicit push, or 'push origin', there's no issue. If I push using explicit remote url, I get the status message 'Your b...
91,224
804,138
2012-12-10 09:06:55
9,051,011
19
2012-01-29 04:42:43
383,402
2012-01-29 04:42:43
https://stackoverflow.com/q/9050978
https://stackoverflow.com/a/9051011
<p>I believe you need to pull the change back in before <code>git</code> will realize that the remote end has been updated. You can do this via a quick <code>git pull</code> (or, as you show in your example, a <code>git push</code> to the tracked origin).</p> <p>You could also manually change the commit to which <code...
<p>I believe you need to pull the change back in before <code>git</code> will realize that the remote end has been updated. You can do this via a quick <code>git pull</code> (or, as you show in your example, a <code>git push</code> to the tracked origin).</p> <p>You could also manually change the commit to which <code...
119
git
<h1>'Your branch is ahead of 'origin/master' by 1 commit' on explicit push</h1> <p>I'm new to git, and I can't make sense of the following behavior:</p> <p>I have a bitbucket repo that I clone locally, then I modify and commit locally, then I push to the remote repo. If I do an implicit push, or 'push origin', there's...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,723
git
# 'Your branch is ahead of 'origin/master' by 1 commit' on explicit push I'm new to git, and I can't make sense of the following behavior: I have a bitbucket repo that I clone locally, then I modify and commit locally, then I push to the remote repo. If I do an implicit push, or 'push origin', there's no issue. If I ...
I believe you need to pull the change back in before `git` will realize that the remote end has been updated. You can do this via a quick `git pull` (or, as you show in your example, a `git push` to the tracked origin). You could also manually change the commit to which `refs/remotes/origin` points. It's not fair to ...
23861208
Is it possible to make git clone recursive by default?
26
2014-05-26 00:22:51
<p>Is it possible to make <code>git clone</code> do <code>git clone --recursive</code> by default?</p>
3,311
1,228,896
2017-12-07 15:29:30
23,861,991
19
2014-05-26 02:40:35
1,031,218
2017-12-07 15:29:30
https://stackoverflow.com/q/23861208
https://stackoverflow.com/a/23861991
<p>No, it is not possible, see:</p> <p><a href="https://stackoverflow.com/questions/3538774/is-it-possible-to-override-git-command-by-git-alias">Is it possible to override git command by git alias?</a></p> <p>However, you can define a similar instead:</p> <pre><code>git config --global alias.cloner "clone --recursiv...
<p>No, it is not possible, see:</p> <p><a href="https://stackoverflow.com/questions/3538774/is-it-possible-to-override-git-command-by-git-alias">Is it possible to override git command by git alias?</a></p> <p>However, you can define a similar instead:</p> <pre><code>git config --global alias.cloner "clone --recursiv...
119
git
<h1>Is it possible to make git clone recursive by default?</h1> <p>Is it possible to make <code>git clone</code> do <code>git clone --recursive</code> by default?</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,725
git
# Is it possible to make git clone recursive by default? Is it possible to make `git clone` do `git clone --recursive` by default?
No, it is not possible, see: [Is it possible to override git command by git alias?](https://stackoverflow.com/questions/3538774/is-it-possible-to-override-git-command-by-git-alias) However, you can define a similar instead: ``` git config --global alias.cloner "clone --recursive" ``` then ``` git cloner http://loc...
3267232
Converting a Mercurial (hg) repository to Git on Windows (7)
26
2010-07-16 17:02:07
<p>I'm really quite frustrated at this point. I have an existing hg repository that has months of coding history in it, and I want to get this into a private Github repository so I can work on it from there. Unfortunately I use Windows and I can't seem to find <em>any</em> way to convert the repository that I can actua...
7,790
98,389
2020-10-05 13:00:10
3,269,811
19
2010-07-17 01:20:05
219,166
2020-10-05 13:00:10
https://stackoverflow.com/q/3267232
https://stackoverflow.com/a/3269811
<ol> <li>Install <a href="http://www.cygwin.com/" rel="nofollow noreferrer">Cygwin</a> (with python, hg, git)</li> <li>Install <a href="https://github.com/cosmin/git-hg" rel="nofollow noreferrer">git-hg</a></li> <li>run <code>git-hg clone ...url...</code></li> </ol> <p>Or tell me what the url is for this hg repo of you...
<ol> <li>Install <a href="http://www.cygwin.com/" rel="nofollow noreferrer">Cygwin</a> (with python, hg, git)</li> <li>Install <a href="https://github.com/cosmin/git-hg" rel="nofollow noreferrer">git-hg</a></li> <li>run <code>git-hg clone ...url...</code></li> </ol> <p>Or tell me what the url is for this hg repo of you...
16, 64, 119, 802
git, mercurial, python, windows
<h1>Converting a Mercurial (hg) repository to Git on Windows (7)</h1> <p>I'm really quite frustrated at this point. I have an existing hg repository that has months of coding history in it, and I want to get this into a private Github repository so I can work on it from there. Unfortunately I use Windows and I can't se...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,726
git
# Converting a Mercurial (hg) repository to Git on Windows (7) I'm really quite frustrated at this point. I have an existing hg repository that has months of coding history in it, and I want to get this into a private Github repository so I can work on it from there. Unfortunately I use Windows and I can't seem to fin...
1. Install [Cygwin](http://www.cygwin.com/) (with python, hg, git) 2. Install [git-hg](https://github.com/cosmin/git-hg) 3. run `git-hg clone ...url...` Or tell me what the url is for this hg repo of yours, and I can convert it for you.
32006894
Git reuse branch or delete and create again
25
2015-08-14 09:36:06
<p>I recently got the task to add a certain feature to a project I'm working on. As this feature depends on old code that was cruel to use, I decided to split the task in 2 steps:</p> <ul> <li>refactor old code to be more usable</li> <li>create feature using refactored code</li> </ul> <p>I created a branch feat/foo, ...
24,178
5,114,081
2020-11-10 16:43:02
32,007,121
19
2015-08-14 09:46:40
1,863,229
2015-08-14 09:46:40
https://stackoverflow.com/q/32006894
https://stackoverflow.com/a/32007121
<p>In many workflows, once a feature branch has been merged back into <code>master</code> it is deleted. GitHub is probably the prime example of this. If you follow this school of thought, you would delete <code>feat/foo</code> and create a new feature branch for your next sprint.</p> <p>If you really want to keep u...
<p>In many workflows, once a feature branch has been merged back into <code>master</code> it is deleted. GitHub is probably the prime example of this. If you follow this school of thought, you would delete <code>feat/foo</code> and create a new feature branch for your next sprint.</p> <p>If you really want to keep u...
119
git
<h1>Git reuse branch or delete and create again</h1> <p>I recently got the task to add a certain feature to a project I'm working on. As this feature depends on old code that was cruel to use, I decided to split the task in 2 steps:</p> <ul> <li>refactor old code to be more usable</li> <li>create feature using refacto...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,727
git
# Git reuse branch or delete and create again I recently got the task to add a certain feature to a project I'm working on. As this feature depends on old code that was cruel to use, I decided to split the task in 2 steps: - refactor old code to be more usable - create feature using refactored code I created a branc...
In many workflows, once a feature branch has been merged back into `master` it is deleted. GitHub is probably the prime example of this. If you follow this school of thought, you would delete `feat/foo` and create a new feature branch for your next sprint. If you really want to keep using the branch, then you will eit...
64258747
Make git `replace` commits permanent (or such)
23
2020-10-08 08:33:59
<p>I'm busy converting all my existing SVN repositories to Git, and at the same time also take the opportunity to use Git's ability to easily rewrite some history. For this I'm also using git filter-repo, to get rid of unwanted files and do some standard renaming via scripts. (note: they're all solo repositories onl...
3,738
1,788,855
2021-11-24 16:39:22
64,275,401
19
2020-10-09 07:06:19
6,309
2021-11-24 16:39:22
https://stackoverflow.com/q/64258747
https://stackoverflow.com/a/64275401
<p>If the <code>refs/replace-refs</code> are problematic, you could run your <code>filter-repo</code> command with the<br /> <a href="https://github.com/newren/git-filter-repo/commit/1fa8c2c70b164f1cf13e2a3bc195259f19ad1bf1" rel="noreferrer"><code>--replace-refs</code> option</a>.</p> <p>Try it with:</p> <pre><code>--r...
<p>If the <code>refs/replace-refs</code> are problematic, you could run your <code>filter-repo</code> command with the<br /> <a href="https://github.com/newren/git-filter-repo/commit/1fa8c2c70b164f1cf13e2a3bc195259f19ad1bf1" rel="noreferrer"><code>--replace-refs</code> option</a>.</p> <p>Try it with:</p> <pre><code>--r...
119, 65939, 91259, 141715
git, git-filter-repo, git-rewrite-history, smartgit
<h1>Make git `replace` commits permanent (or such)</h1> <p>I'm busy converting all my existing SVN repositories to Git, and at the same time also take the opportunity to use Git's ability to easily rewrite some history. For this I'm also using git filter-repo, to get rid of unwanted files and do some standard renaming...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,729
git
# Make git `replace` commits permanent (or such) I'm busy converting all my existing SVN repositories to Git, and at the same time also take the opportunity to use Git's ability to easily rewrite some history. For this I'm also using git filter-repo, to get rid of unwanted files and do some standard renaming via scrip...
If the `refs/replace-refs` are problematic, you could run your `filter-repo` command with the [`--replace-refs` option](https://github.com/newren/git-filter-repo/commit/1fa8c2c70b164f1cf13e2a3bc195259f19ad1bf1). Try it with: ``` --replace-refs update-no-add # or --replace-refs delete-no-add ``` See if there are st...
48820631
git remote prune origin does not delete the local branch even if its upstream remote branch is deleted
23
2018-02-16 05:32:41
<p>This is a common use-case for me, I clone a repository, checkout a branch, do some code changes, make multiple commits, then when it's stable, I do a push to remote, eventually the branch gets merged and deleted, and I'm left with a local branch with upstream gone.</p> <p>I was looking for a safe way of deleting all...
30,340
1,386,448
2025-02-10 23:27:23
48,820,687
19
2018-02-16 05:38:33
6,309
2018-08-03 17:26:25
https://stackoverflow.com/q/48820631
https://stackoverflow.com/a/48820687
<p>The <strong><a href="https://git-scm.com/docs/git-remote.html#git-remote-empruneem" rel="noreferrer"><code>git remote prune</code></a></strong> command only deletes the remote tracking branches in the <code>remotes/origin</code> namespace. </p> <p>Not the local branches.<br> The usual practice is to <a href="https...
<p>The <strong><a href="https://git-scm.com/docs/git-remote.html#git-remote-empruneem" rel="noreferrer"><code>git remote prune</code></a></strong> command only deletes the remote tracking branches in the <code>remotes/origin</code> namespace. </p> <p>Not the local branches.<br> The usual practice is to <a href="https...
119, 41346, 76220
git, git-branch, git-remote
<h1>git remote prune origin does not delete the local branch even if its upstream remote branch is deleted</h1> <p>This is a common use-case for me, I clone a repository, checkout a branch, do some code changes, make multiple commits, then when it's stable, I do a push to remote, eventually the branch gets merged and d...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,731
git
# git remote prune origin does not delete the local branch even if its upstream remote branch is deleted This is a common use-case for me, I clone a repository, checkout a branch, do some code changes, make multiple commits, then when it's stable, I do a push to remote, eventually the branch gets merged and deleted, a...
The **[`git remote prune`](https://git-scm.com/docs/git-remote.html#git-remote-empruneem)** command only deletes the remote tracking branches in the `remotes/origin` namespace. Not the local branches. The usual practice is to [delete only *merged* local branches](https://stackoverflow.com/a/28464339/6309). git bran...
33661714
Git grep/search a specific branch
23
2015-11-11 23:20:51
<p>I am looking for a way to grep a certain branch. Simple?</p> <p>To show a specific file in a branch, one would use:</p> <pre><code>git show branch:my_branch bla_sheep.txt </code></pre> <p>Similar syntax is used to diff, etc.</p> <p>Is there a way to simply grep a branch:</p> <pre><code>git grep branch:my_branch...
15,332
1,778,980
2019-01-23 16:39:30
33,662,458
19
2015-11-12 00:31:57
1,256,452
2019-01-23 16:39:30
https://stackoverflow.com/q/33661714
https://stackoverflow.com/a/33662458
<p><strong>To look at multiple commits, starting at some branch tip and working backwards:</strong> <code>git grep</code> can look in any particular <em>tree</em> (hence any particular commit since any given commit identifies a particular tree), but to iterate over every commit contained within some branch, you will ne...
<p><strong>To look at multiple commits, starting at some branch tip and working backwards:</strong> <code>git grep</code> can look in any particular <em>tree</em> (hence any particular commit since any given commit identifies a particular tree), but to iterate over every commit contained within some branch, you will ne...
119
git
<h1>Git grep/search a specific branch</h1> <p>I am looking for a way to grep a certain branch. Simple?</p> <p>To show a specific file in a branch, one would use:</p> <pre><code>git show branch:my_branch bla_sheep.txt </code></pre> <p>Similar syntax is used to diff, etc.</p> <p>Is there a way to simply grep a branch...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,732
git
# Git grep/search a specific branch I am looking for a way to grep a certain branch. Simple? To show a specific file in a branch, one would use: ``` git show branch:my_branch bla_sheep.txt ``` Similar syntax is used to diff, etc. Is there a way to simply grep a branch: ``` git grep branch:my_branch <regex> ```
**To look at multiple commits, starting at some branch tip and working backwards:** `git grep` can look in any particular *tree* (hence any particular commit since any given commit identifies a particular tree), but to iterate over every commit contained within some branch, you will need to do your own `git rev-list`: ...
23766153
git clone ssh permission denied
23
2014-05-20 17:17:23
<p>I followed the instruction at <a href="https://help.github.com/articles/generating-ssh-keys" rel="noreferrer">https://help.github.com/articles/generating-ssh-keys</a> and typing </p> <pre><code>ssh -T git@github.com </code></pre> <p>I get the message</p> <pre><code>Hi username! You've successfully authenticated, ...
150,453
2,038,360
2021-02-15 13:33:09
23,766,694
19
2014-05-20 17:53:16
526,535
2014-05-20 17:53:16
https://stackoverflow.com/q/23766153
https://stackoverflow.com/a/23766694
<p><code>git clone ssh://github.com/username/repository.git</code> is wrong. You should be doing:</p> <pre><code>git clone ssh://git@github.com/username/repository.git </code></pre> <p>or better yet:</p> <pre><code>git clone git@github.com:username/repository.git </code></pre>
<p><code>git clone ssh://github.com/username/repository.git</code> is wrong. You should be doing:</p> <pre><code>git clone ssh://git@github.com/username/repository.git </code></pre> <p>or better yet:</p> <pre><code>git clone git@github.com:username/repository.git </code></pre>
119, 386
git, ssh
<h1>git clone ssh permission denied</h1> <p>I followed the instruction at <a href="https://help.github.com/articles/generating-ssh-keys" rel="noreferrer">https://help.github.com/articles/generating-ssh-keys</a> and typing </p> <pre><code>ssh -T git@github.com </code></pre> <p>I get the message</p> <pre><code>Hi user...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,733
git
# git clone ssh permission denied I followed the instruction at <https://help.github.com/articles/generating-ssh-keys> and typing ``` ssh -T git@github.com ``` I get the message ``` Hi username! You've successfully authenticated, but GitHub does not # provide shell access. ``` When I try to clone a repository usin...
`git clone ssh://github.com/username/repository.git` is wrong. You should be doing: ``` git clone ssh://git@github.com/username/repository.git ``` or better yet: ``` git clone git@github.com:username/repository.git ```
14222510
find out if a git commit was checked in before or after another commit given the hashes
23
2013-01-08 19:23:04
<p>One thing I miss about using svn was the simple-numbering of revision numbers. I can easily see if the version deployed in the testing environment is before or after a certain commit.</p> <p>With git using hashes for its commits, what is a way to tell if a commit was made before or after another commit?</p>
10,928
390,227
2019-05-17 11:45:09
14,233,620
19
2013-01-09 10:51:27
220,155
2013-01-09 10:51:27
https://stackoverflow.com/q/14222510
https://stackoverflow.com/a/14233620
<p>Things, as you note, aren't so simple in Git. In particular, the definition of "before" and "after" need a little more clarification.</p> <p>If you trust the people committing to your repository not to mess with timestamps, and you already know both commits are on the same branch, you can compare the timestamps of ...
<p>Things, as you note, aren't so simple in Git. In particular, the definition of "before" and "after" need a little more clarification.</p> <p>If you trust the people committing to your repository not to mess with timestamps, and you already know both commits are on the same branch, you can compare the timestamps of ...
119
git
<h1>find out if a git commit was checked in before or after another commit given the hashes</h1> <p>One thing I miss about using svn was the simple-numbering of revision numbers. I can easily see if the version deployed in the testing environment is before or after a certain commit.</p> <p>With git using hashes for it...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,734
git
# find out if a git commit was checked in before or after another commit given the hashes One thing I miss about using svn was the simple-numbering of revision numbers. I can easily see if the version deployed in the testing environment is before or after a certain commit. With git using hashes for its commits, what ...
Things, as you note, aren't so simple in Git. In particular, the definition of "before" and "after" need a little more clarification. If you trust the people committing to your repository not to mess with timestamps, and you already know both commits are on the same branch, you can compare the timestamps of the commit...
10751237
"git checkout tag-name" vs "git reset --hard tag-name"
23
2012-05-25 08:44:35
<p>I know that there are questions like <a href="https://stackoverflow.com/questions/2541545/is-there-a-difference-between-git-reset-hard-hash-and-git-checkout-hash">this</a>, but that's not what I'm asking.</p> <p>I also know that:</p> <p><code>git checkout tag-name</code>:</p> <ul> <li>Detaches you from the branch...
33,355
283,055
2012-05-25 10:33:57
10,752,861
19
2012-05-25 10:33:57
761,202
2012-05-25 10:33:57
https://stackoverflow.com/q/10751237
https://stackoverflow.com/a/10752861
<blockquote> <p>I wonder which one makes more sense for updating to a tag</p> </blockquote> <p>Your production install should be checking out a tag.</p> <p>Think of it this way: your production install is read-only. <code>git reset --hard tag-name</code> will modify the currently checked out branch.</p> <p><strong...
<blockquote> <p>I wonder which one makes more sense for updating to a tag</p> </blockquote> <p>Your production install should be checking out a tag.</p> <p>Think of it this way: your production install is read-only. <code>git reset --hard tag-name</code> will modify the currently checked out branch.</p> <p><strong...
119
git
<h1>"git checkout tag-name" vs "git reset --hard tag-name"</h1> <p>I know that there are questions like <a href="https://stackoverflow.com/questions/2541545/is-there-a-difference-between-git-reset-hard-hash-and-git-checkout-hash">this</a>, but that's not what I'm asking.</p> <p>I also know that:</p> <p><code>git chec...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,735
git
# "git checkout tag-name" vs "git reset --hard tag-name" I know that there are questions like [this](https://stackoverflow.com/questions/2541545/is-there-a-difference-between-git-reset-hard-hash-and-git-checkout-hash), but that's not what I'm asking. I also know that: `git checkout tag-name`: - Detaches you from th...
> I wonder which one makes more sense for updating to a tag Your production install should be checking out a tag. Think of it this way: your production install is read-only. `git reset --hard tag-name` will modify the currently checked out branch. **Alternatively** It's common practice that in addition to creating ...
8877231
Git: Merge old commit into current head version
23
2012-01-16 08:18:02
<p>Got a file that has two commits of interest, both on the <code>Master</code> branch, both only modifying a single file <code>foo</code>: a previous commit <code>AA</code>, and the current version in <code>HEAD</code>. I would like to merge the two versions of the file, keeping bits of both, into <code>HEAD</code> on...
44,468
2,637
2018-12-11 14:47:01
8,879,105
19
2012-01-16 11:04:21
223,092
2012-01-16 11:04:21
https://stackoverflow.com/q/8877231
https://stackoverflow.com/a/8879105
<p>If git's merge isn't doing what you want, you could do the following instead:</p> <ol> <li>Make sure that there are no uncommitted changes in the file <code>foo</code>, e.g. by making sure that <code>git status</code> is clean.</li> <li>Overwrite <code>foo</code> with the version from <code>AA</code> using: <code>g...
<p>If git's merge isn't doing what you want, you could do the following instead:</p> <ol> <li>Make sure that there are no uncommitted changes in the file <code>foo</code>, e.g. by making sure that <code>git status</code> is clean.</li> <li>Overwrite <code>foo</code> with the version from <code>AA</code> using: <code>g...
119, 717
git, merge
<h1>Git: Merge old commit into current head version</h1> <p>Got a file that has two commits of interest, both on the <code>Master</code> branch, both only modifying a single file <code>foo</code>: a previous commit <code>AA</code>, and the current version in <code>HEAD</code>. I would like to merge the two versions of ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,736
git
# Git: Merge old commit into current head version Got a file that has two commits of interest, both on the `Master` branch, both only modifying a single file `foo`: a previous commit `AA`, and the current version in `HEAD`. I would like to merge the two versions of the file, keeping bits of both, into `HEAD` on `Maste...
If git's merge isn't doing what you want, you could do the following instead: 1. Make sure that there are no uncommitted changes in the file `foo`, e.g. by making sure that `git status` is clean. 2. Overwrite `foo` with the version from `AA` using: `git show AA:foo > foo` 3. Selectively stage only the changes from `fo...
37122124
Git does not apply deleted files when merging an old branch into the master. How can I tell Git to apply deleted files?
22
2016-05-09 17:41:45
<p>I have a master and a dev branch. I made commits in both. I also deleted some files in dev. I made other commit in master, so this master branch is more recent.</p> <p>My issue is that merging dev into master dont delete files.</p> <p>Git consider that these files exists in master and consequently, keep them durin...
35,446
6,180,339
2017-08-09 15:04:23
37,122,968
19
2016-05-09 18:31:13
4,233,593
2016-05-09 18:31:13
https://stackoverflow.com/q/37122124
https://stackoverflow.com/a/37122968
<p><em>Merges definitely delete files when there's not a conflict with changes in branches.</em></p> <blockquote> <p>git does not preserve files during merging if they are deleted in the merging branch. - Nils_M</p> </blockquote> <p>To prove it to myself, I had to try to reproduce your scenario. See this demonstrat...
<p><em>Merges definitely delete files when there's not a conflict with changes in branches.</em></p> <blockquote> <p>git does not preserve files during merging if they are deleted in the merging branch. - Nils_M</p> </blockquote> <p>To prove it to myself, I had to try to reproduce your scenario. See this demonstrat...
119, 28897
git, git-merge
<h1>Git does not apply deleted files when merging an old branch into the master. How can I tell Git to apply deleted files?</h1> <p>I have a master and a dev branch. I made commits in both. I also deleted some files in dev. I made other commit in master, so this master branch is more recent.</p> <p>My issue is that me...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,737
git
# Git does not apply deleted files when merging an old branch into the master. How can I tell Git to apply deleted files? I have a master and a dev branch. I made commits in both. I also deleted some files in dev. I made other commit in master, so this master branch is more recent. My issue is that merging dev into m...
*Merges definitely delete files when there's not a conflict with changes in branches.* > git does not preserve files during merging if they are deleted in the merging branch. - Nils_M To prove it to myself, I had to try to reproduce your scenario. See this demonstration in hopes that you can see what it is you are do...
18003917
git rerere does not auto-commit autoupdated merge resolutions
22
2013-08-01 20:29:17
<p>I'm trying to use the shared rerere cache to automate throwaway integration/test branches.</p> <p>The idea is that the rerere cache should be up to date when the branch is pushed, so that these merges always pass. However, they don't:</p> <pre><code>&gt;&gt;&gt; git merge --no-ff invoicing Staged 'analysisrequest...
2,358
804,985
2023-01-25 15:16:16
27,513,648
19
2014-12-16 20:47:02
4,354,956
2023-01-25 15:16:16
https://stackoverflow.com/q/18003917
https://stackoverflow.com/a/27513648
<p>Even with the <code>--rerere-autoupdate</code> flag, <code>git merge</code> seems to be reluctant to automatically complete the merge without some human input. Instead, it executes with an error status, and your integration tool refuses to proceed.</p> <p>I do not know how your automatic merging is happening, namely...
<p>Even with the <code>--rerere-autoupdate</code> flag, <code>git merge</code> seems to be reluctant to automatically complete the merge without some human input. Instead, it executes with an error status, and your integration tool refuses to proceed.</p> <p>I do not know how your automatic merging is happening, namely...
119, 83367
git, git-rerere
<h1>git rerere does not auto-commit autoupdated merge resolutions</h1> <p>I'm trying to use the shared rerere cache to automate throwaway integration/test branches.</p> <p>The idea is that the rerere cache should be up to date when the branch is pushed, so that these merges always pass. However, they don't:</p> <pre...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,738
git
# git rerere does not auto-commit autoupdated merge resolutions I'm trying to use the shared rerere cache to automate throwaway integration/test branches. The idea is that the rerere cache should be up to date when the branch is pushed, so that these merges always pass. However, they don't: ``` >>> git merge --no-ff...
Even with the `--rerere-autoupdate` flag, `git merge` seems to be reluctant to automatically complete the merge without some human input. Instead, it executes with an error status, and your integration tool refuses to proceed. I do not know how your automatic merging is happening, namely, whether you can change the Gi...
5383659
Git: how to revert a branch merge without overwriting history?
22
2011-03-21 20:59:54
<p>I have two branches: <code>master</code> and <code>opengl</code>. I recently finished implementation (or at least I thought so) of <code>opengl</code> branch and decided to merge it into <code>master</code>:</p> <pre><code>git checkout master git merge opengl git push </code></pre> <p>After I did this, several dev...
57,567
178,315
2016-10-09 09:17:32
13,413,527
19
2012-11-16 09:13:39
6,309
2012-11-16 09:13:39
https://stackoverflow.com/q/5383659
https://stackoverflow.com/a/13413527
<p>The documentation "<a href="http://www.kernel.org/pub/software/scm/git/docs/howto/revert-a-faulty-merge.txt" rel="nofollow noreferrer">How to revert a faulty merge</a>" mentioned by <a href="https://stackoverflow.com/users/647987/cebewee">cebewee</a> explains why a git revert is tricky when reverting a merge.</p> <...
<p>The documentation "<a href="http://www.kernel.org/pub/software/scm/git/docs/howto/revert-a-faulty-merge.txt" rel="nofollow noreferrer">How to revert a faulty merge</a>" mentioned by <a href="https://stackoverflow.com/users/647987/cebewee">cebewee</a> explains why a git revert is tricky when reverting a merge.</p> <...
119, 717, 1879, 12309
branch, git, merge, revert
<h1>Git: how to revert a branch merge without overwriting history?</h1> <p>I have two branches: <code>master</code> and <code>opengl</code>. I recently finished implementation (or at least I thought so) of <code>opengl</code> branch and decided to merge it into <code>master</code>:</p> <pre><code>git checkout master g...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,739
git
# Git: how to revert a branch merge without overwriting history? I have two branches: `master` and `opengl`. I recently finished implementation (or at least I thought so) of `opengl` branch and decided to merge it into `master`: ``` git checkout master git merge opengl git push ``` After I did this, several develope...
The documentation "[How to revert a faulty merge](http://www.kernel.org/pub/software/scm/git/docs/howto/revert-a-faulty-merge.txt)" mentioned by [cebewee](https://stackoverflow.com/users/647987/cebewee) explains why a git revert is tricky when reverting a merge. > So **the merge will still exist**, and it will still b...
7329647
How to download/clone a new branch from my server git repository into an already created local git repository in my PC with Eclipse EGit
22
2011-09-07 06:19:54
<p>This is driving me crazy.</p> <p>I created a git repository in a Linux server hosted by my hosting company.</p> <p>I cloned it to a local copy using Eclipse EGit.</p> <p>I then created a branch in the original git repository in the server.</p> <p>How do I copy the branch to my local copy using Eclipse EGit?</p> ...
35,212
893,746
2020-02-11 13:00:25
7,329,872
19
2011-09-07 06:46:15
389,146
2011-09-07 06:46:15
https://stackoverflow.com/q/7329647
https://stackoverflow.com/a/7329872
<p>Your fetch is up to date because you already have everything copied to your local repository. A pull will merge <code>origin/development</code> into master, which isn't what you want. You want to create a new branch with <code>origin/development</code> as the starting point. I don't know how to do it with egit, b...
<p>Your fetch is up to date because you already have everything copied to your local repository. A pull will merge <code>origin/development</code> into master, which isn't what you want. You want to create a new branch with <code>origin/development</code> as the starting point. I don't know how to do it with egit, b...
53, 119, 3885, 34099, 43702
eclipse, eclipse-plugin, egit, git, git-clone
<h1>How to download/clone a new branch from my server git repository into an already created local git repository in my PC with Eclipse EGit</h1> <p>This is driving me crazy.</p> <p>I created a git repository in a Linux server hosted by my hosting company.</p> <p>I cloned it to a local copy using Eclipse EGit.</p> <...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,740
git
# How to download/clone a new branch from my server git repository into an already created local git repository in my PC with Eclipse EGit This is driving me crazy. I created a git repository in a Linux server hosted by my hosting company. I cloned it to a local copy using Eclipse EGit. I then created a branch in t...
Your fetch is up to date because you already have everything copied to your local repository. A pull will merge `origin/development` into master, which isn't what you want. You want to create a new branch with `origin/development` as the starting point. I don't know how to do it with egit, but on the command line, you ...
6283970
Git clone through a reverse tunnel
22
2011-06-08 19:15:52
<p>I have my Git repo on my machine, which has no public IP of its own, at home; I want to clone this repo at my web server. Is it correct that a reverse tunnel will allow me to pull from my machine to the server? What command(s) do I issue to perform the clone? My local machine runs Windows; the server runs Ubuntu.</p...
8,651
56,015
2015-07-04 19:39:17
6,284,078
19
2011-06-08 19:25:00
600,500
2015-03-17 20:07:53
https://stackoverflow.com/q/6283970
https://stackoverflow.com/a/6284078
<p>In principle, you can do something like</p> <pre><code>ssh -R 2222:localhost:22 username@webserver.com </code></pre> <p>and then use on your webserver </p> <pre><code>git clone ssh://user@localhost:2222/path/to/repo.git/ </code></pre> <p>This will encrypt your data twice, though.</p> <p>Alternatively, you can...
<p>In principle, you can do something like</p> <pre><code>ssh -R 2222:localhost:22 username@webserver.com </code></pre> <p>and then use on your webserver </p> <pre><code>git clone ssh://user@localhost:2222/path/to/repo.git/ </code></pre> <p>This will encrypt your data twice, though.</p> <p>Alternatively, you can...
119, 386
git, ssh
<h1>Git clone through a reverse tunnel</h1> <p>I have my Git repo on my machine, which has no public IP of its own, at home; I want to clone this repo at my web server. Is it correct that a reverse tunnel will allow me to pull from my machine to the server? What command(s) do I issue to perform the clone? My local mach...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,741
git
# Git clone through a reverse tunnel I have my Git repo on my machine, which has no public IP of its own, at home; I want to clone this repo at my web server. Is it correct that a reverse tunnel will allow me to pull from my machine to the server? What command(s) do I issue to perform the clone? My local machine runs ...
In principle, you can do something like ``` ssh -R 2222:localhost:22 username@webserver.com ``` and then use on your webserver ``` git clone ssh://user@localhost:2222/path/to/repo.git/ ``` This will encrypt your data twice, though. Alternatively, you can use any of the other protocols which git supports, and forw...
8979189
How to see where a branch was rebased and what branch it was rebased from?
21
2012-01-23 21:56:49
<p>I know that GIT rebases will rewrite the history -- i.e. the commit ids will change. However, Is there any way to trace when a branch was rebased and from which branch?</p> <p>EDIT: I have a development branch 'A' and a topic branch 'B'. 'A' is shared by the team. At some point, 'A' has been re-based with a mainstr...
29,044
1,165,866
2023-06-04 03:17:33
8,981,047
19
2012-01-24 01:34:57
119,963
2012-01-24 01:34:57
https://stackoverflow.com/q/8979189
https://stackoverflow.com/a/8981047
<p>You can probably tell who did it! When you rebase, since the commits are rewritten, the committer information will be from the person doing the rebase, not the original author. (This is separate from the author information.)</p> <p>You can see this information in <code>gitk</code> (in the diff pane in the lower lef...
<p>You can probably tell who did it! When you rebase, since the commits are rewritten, the committer information will be from the person doing the rebase, not the original author. (This is separate from the author information.)</p> <p>You can see this information in <code>gitk</code> (in the diff pane in the lower lef...
119, 29934, 47913, 79719
git, git-log, git-rebase, git-reflog
<h1>How to see where a branch was rebased and what branch it was rebased from?</h1> <p>I know that GIT rebases will rewrite the history -- i.e. the commit ids will change. However, Is there any way to trace when a branch was rebased and from which branch?</p> <p>EDIT: I have a development branch 'A' and a topic branch...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,743
git
# How to see where a branch was rebased and what branch it was rebased from? I know that GIT rebases will rewrite the history -- i.e. the commit ids will change. However, Is there any way to trace when a branch was rebased and from which branch? EDIT: I have a development branch 'A' and a topic branch 'B'. 'A' is sha...
You can probably tell who did it! When you rebase, since the commits are rewritten, the committer information will be from the person doing the rebase, not the original author. (This is separate from the author information.) You can see this information in `gitk` (in the diff pane in the lower left) or in the output o...
57935486
Add git remote only if it doesn't exist
20
2019-09-14 12:28:13
<p>Is there a easy way for a script to detect if a remote already exists and add it only if it doesn't? A plumbing command or porcelain flag?</p> <p>When running <code>git remote add foo https://example.net</code> with an existing remote I get:</p> <pre><code>fatal: remote foo already exists. </code></pre> <p>Ideall...
8,789
15,244
2024-01-18 16:28:28
57,936,187
19
2019-09-14 13:56:34
1,290,731
2024-01-18 16:28:28
https://stackoverflow.com/q/57935486
https://stackoverflow.com/a/57936187
<pre><code>git config remote.foo.url &gt;&amp;- || git remote add foo </code></pre> <p>git's written to handle closed fd's so you don't need <code>&gt;/dev/null</code>, just close it, config sets a return code when you ask for a nonexistent config.</p>
<pre><code>git config remote.foo.url &gt;&amp;- || git remote add foo </code></pre> <p>git's written to handle closed fd's so you don't need <code>&gt;/dev/null</code>, just close it, config sets a return code when you ask for a nonexistent config.</p>
119
git
<h1>Add git remote only if it doesn't exist</h1> <p>Is there a easy way for a script to detect if a remote already exists and add it only if it doesn't? A plumbing command or porcelain flag?</p> <p>When running <code>git remote add foo https://example.net</code> with an existing remote I get:</p> <pre><code>fatal: re...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,744
git
# Add git remote only if it doesn't exist Is there a easy way for a script to detect if a remote already exists and add it only if it doesn't? A plumbing command or porcelain flag? When running `git remote add foo https://example.net` with an existing remote I get: ``` fatal: remote foo already exists. ``` Ideally ...
``` git config remote.foo.url >&- || git remote add foo ``` git's written to handle closed fd's so you don't need `>/dev/null`, just close it, config sets a return code when you ask for a nonexistent config.
53941990
GIT repo connection failed in cPanel
20
2018-12-27 08:32:17
<p>I am having issue connecting git repo to cpanel. I have added SSH keys to cPanel from git correctly. Sometime repo are connecting and sometime i am getting following issue Error: “/usr/local/cpanel/3rdparty/bin/git” reported error code “128” when it ended: fatal: could not read Password for '<a href="https://.........
32,881
3,615,322
2023-07-01 21:16:39
53,942,047
19
2018-12-27 08:37:42
6,309
2023-07-01 21:16:39
https://stackoverflow.com/q/53941990
https://stackoverflow.com/a/53942047
<blockquote> <p>I have added SSH keys to cPanel</p> </blockquote> <p>Then you should use an SSH URL (<code>git@server:user/repo</code>), not an HTTPS one (which starts with https://...)</p> <p>See &quot;<a href="https://docs.cpanel.net/knowledge-base/web-services/guide-to-git-set-up-access-to-private-repositories/" rel...
<blockquote> <p>I have added SSH keys to cPanel</p> </blockquote> <p>Then you should use an SSH URL (<code>git@server:user/repo</code>), not an HTTPS one (which starts with https://...)</p> <p>See &quot;<a href="https://docs.cpanel.net/knowledge-base/web-services/guide-to-git-set-up-access-to-private-repositories/" rel...
119, 12409
cpanel, git
<h1>GIT repo connection failed in cPanel</h1> <p>I am having issue connecting git repo to cpanel. I have added SSH keys to cPanel from git correctly. Sometime repo are connecting and sometime i am getting following issue Error: “/usr/local/cpanel/3rdparty/bin/git” reported error code “128” when it ended: fatal: could ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,745
git
# GIT repo connection failed in cPanel I am having issue connecting git repo to cpanel. I have added SSH keys to cPanel from git correctly. Sometime repo are connecting and sometime i am getting following issue Error: “/usr/local/cpanel/3rdparty/bin/git” reported error code “128” when it ended: fatal: could not read P...
> I have added SSH keys to cPanel Then you should use an SSH URL (`git@server:user/repo`), not an HTTPS one (which starts with https://...) See "[Guide to Git - Set Up Access to Private Repositories](https://docs.cpanel.net/knowledge-base/web-services/guide-to-git-set-up-access-to-private-repositories/)" from the CPa...
5898929
git log for a portion of a file
20
2011-05-05 13:59:32
<p>I would like to see all the git commits that affected what are currently lines x - y in one of my files. Is there a way I can do that?</p>
3,145
6,701
2014-01-20 21:33:22
21,244,584
19
2014-01-20 21:33:22
994,153
2014-01-20 21:33:22
https://stackoverflow.com/q/5898929
https://stackoverflow.com/a/21244584
<p>Now <code>git log</code> supports the <code>-L</code> option like <code>git blame</code>. This was added in Git v1.8.4.</p> <pre><code> -L &lt;start&gt;,&lt;end&gt;:&lt;file&gt; -L :&lt;regex&gt;:&lt;file&gt; Trace the evolution of the line range given by "&lt;start&gt;,&lt;end&gt;" (or the funcname regex &lt;...
<p>Now <code>git log</code> supports the <code>-L</code> option like <code>git blame</code>. This was added in Git v1.8.4.</p> <pre><code> -L &lt;start&gt;,&lt;end&gt;:&lt;file&gt; -L :&lt;regex&gt;:&lt;file&gt; Trace the evolution of the line range given by "&lt;start&gt;,&lt;end&gt;" (or the funcname regex &lt;...
119
git
<h1>git log for a portion of a file</h1> <p>I would like to see all the git commits that affected what are currently lines x - y in one of my files. Is there a way I can do that?</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,748
git
# git log for a portion of a file I would like to see all the git commits that affected what are currently lines x - y in one of my files. Is there a way I can do that?
Now `git log` supports the `-L` option like `git blame`. This was added in Git v1.8.4. ``` -L <start>,<end>:<file> -L :<regex>:<file> Trace the evolution of the line range given by "<start>,<end>" (or the funcname regex <regex>) within the <file>. You may not give any pathspec limiters. This is currently limited...
19083092
How can I deploy old commits to Heroku
20
2013-09-29 20:45:38
<p>We're trying to deploy a big Rails project to Heroku for the first time, but something's breaking during the Heroku compilation process and we have <a href="https://stackoverflow.com/questions/19079445/how-to-debug-error-detecting-the-assetsprecompile-task-issue-on-heroku"><strong>no way of knowing what</strong></a>...
6,307
165,673
2024-07-15 16:57:19
19,083,356
19
2013-09-29 21:16:35
214,790
2013-09-29 21:16:35
https://stackoverflow.com/q/19083092
https://stackoverflow.com/a/19083356
<p>It’s not that Heroku only builds if you push <em>from</em> master, rather Heroku will only build if you push <em>to</em> master. If you just do</p> <pre><code>git push heroku </code></pre> <p>then you are probably pushing your local branch to one with the same name on Heroku (the exact default behaviour is configu...
<p>It’s not that Heroku only builds if you push <em>from</em> master, rather Heroku will only build if you push <em>to</em> master. If you just do</p> <pre><code>git push heroku </code></pre> <p>then you are probably pushing your local branch to one with the same name on Heroku (the exact default behaviour is configu...
119, 8279
git, heroku
<h1>How can I deploy old commits to Heroku</h1> <p>We're trying to deploy a big Rails project to Heroku for the first time, but something's breaking during the Heroku compilation process and we have <a href="https://stackoverflow.com/questions/19079445/how-to-debug-error-detecting-the-assetsprecompile-task-issue-on-her...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,749
git
# How can I deploy old commits to Heroku We're trying to deploy a big Rails project to Heroku for the first time, but something's breaking during the Heroku compilation process and we have [**no way of knowing what**](https://stackoverflow.com/questions/19079445/how-to-debug-error-detecting-the-assetsprecompile-task-i...
It’s not that Heroku only builds if you push *from* master, rather Heroku will only build if you push *to* master. If you just do ``` git push heroku ``` then you are probably pushing your local branch to one with the same name on Heroku (the exact default behaviour is configurable). You can push from a different loc...
69630417
How to check if a repository is cloned via HTTP or ssh?
19
2021-10-19 11:59:15
<p>I need a quick way to understand whether the repo, I am in, is cloned via HTTP or ssh? Looking for a command from Git or any other configuration checkpoint to provide this info for me.</p>
20,824
7,995,302
2021-10-20 08:41:12
69,630,678
19
2021-10-19 12:18:39
26,396
2021-10-20 08:41:12
https://stackoverflow.com/q/69630417
https://stackoverflow.com/a/69630678
<p>This command will show you <a href="https://git-scm.com/docs/git-fetch#_git_urls" rel="noreferrer">the URLs</a> that the repo will fetch from and push to by <em>default</em><sup>1</sup>:</p> <pre class="lang-sh prettyprint-override"><code>git remote show origin </code></pre> <p>From the <a href="https://git-scm.com/...
<p>This command will show you <a href="https://git-scm.com/docs/git-fetch#_git_urls" rel="noreferrer">the URLs</a> that the repo will fetch from and push to by <em>default</em><sup>1</sup>:</p> <pre class="lang-sh prettyprint-override"><code>git remote show origin </code></pre> <p>From the <a href="https://git-scm.com/...
119, 386, 725, 5210
configuration, git, http, ssh
<h1>How to check if a repository is cloned via HTTP or ssh?</h1> <p>I need a quick way to understand whether the repo, I am in, is cloned via HTTP or ssh? Looking for a command from Git or any other configuration checkpoint to provide this info for me.</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,750
git
# How to check if a repository is cloned via HTTP or ssh? I need a quick way to understand whether the repo, I am in, is cloned via HTTP or ssh? Looking for a command from Git or any other configuration checkpoint to provide this info for me.
This command will show you [the URLs](https://git-scm.com/docs/git-fetch#_git_urls) that the repo will fetch from and push to by *default*1: ``` git remote show origin ``` From the [documentation](https://git-scm.com/docs/git-fetch#_git_urls): > In general, URLs contain information about the transport protocol, the ...
48151570
error: Reverting is not possible because you have unmerged files
19
2018-01-08 13:44:39
<p>When trying to revert a specific commit in git, I'm getting this error:</p> <pre>$ git revert aaaf93201a28a57d540d633b1b723b8e513a47ed error: Reverting is not possible because you have unmerged files. hint: Fix them up in the work tree, and then use 'git add/rm ' hint: as appropriate to mark resolution and make a c...
49,686
492,336
2023-09-17 02:02:34
59,256,544
19
2019-12-09 21:01:13
6,216,494
2019-12-09 21:01:13
https://stackoverflow.com/q/48151570
https://stackoverflow.com/a/59256544
<p>If you want to revert to the previous state of your work do:<code>git merge --abort</code></p>
<p>If you want to revert to the previous state of your work do:<code>git merge --abort</code></p>
119, 34403
git, git-revert
<h1>error: Reverting is not possible because you have unmerged files</h1> <p>When trying to revert a specific commit in git, I'm getting this error:</p> <pre>$ git revert aaaf93201a28a57d540d633b1b723b8e513a47ed error: Reverting is not possible because you have unmerged files. hint: Fix them up in the work tree, and t...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,751
git
# error: Reverting is not possible because you have unmerged files When trying to revert a specific commit in git, I'm getting this error: ``` $ git revert aaaf93201a28a57d540d633b1b723b8e513a47ed error: Reverting is not possible because you have unmerged files. hint: Fix them up in the work tree, and then use 'git a...
If you want to revert to the previous state of your work do:`git merge --abort`
52139042
How to copy commit metadata (author, date) from another commit
19
2018-09-02 16:42:03
<p>I'm sure there is a way to do this in git, but my searches are coming up empty. Is there an easy way to get the message, commit author, commit date and other info from one commit and amend the second commit with this data, without copying the actual commit contents?</p>
2,429
890,016
2025-10-03 21:36:35
52,139,067
19
2018-09-02 16:45:27
2,422,776
2018-09-02 16:45:27
https://stackoverflow.com/q/52139042
https://stackoverflow.com/a/52139067
<p>You can use the <code>-c</code> flag:</p> <pre><code>$ git commit --amend --no-edit -c &lt;other commit hash&gt; </code></pre>
<p>You can use the <code>-c</code> flag:</p> <pre><code>$ git commit --amend --no-edit -c &lt;other commit hash&gt; </code></pre>
119, 3809, 53850
commit-message, git, git-commit
<h1>How to copy commit metadata (author, date) from another commit</h1> <p>I'm sure there is a way to do this in git, but my searches are coming up empty. Is there an easy way to get the message, commit author, commit date and other info from one commit and amend the second commit with this data, without copying the ac...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,752
git
# How to copy commit metadata (author, date) from another commit I'm sure there is a way to do this in git, but my searches are coming up empty. Is there an easy way to get the message, commit author, commit date and other info from one commit and amend the second commit with this data, without copying the actual comm...
You can use the `-c` flag: ``` $ git commit --amend --no-edit -c <other commit hash> ```
50673550
Remove a git fork relationship in Azure Devops (VSTS)
19
2018-06-04 04:49:47
<p>I created a Azure Devops (VSTS) project by forking another project. Now whenever we clone the new project you get references to the original project in the console output </p> <pre><code>remote: This repository is a fork. Learn more at https://aka.ms/whatisafork. remote: To add its upstream as a remote, run: remote...
9,105
2,025,666
2024-01-08 14:01:06
50,673,750
19
2018-06-04 05:13:43
6,309
2018-06-04 05:13:43
https://stackoverflow.com/q/50673550
https://stackoverflow.com/a/50673750
<p>If you don't want anymore to <a href="https://learn.microsoft.com/en-us/vsts/git/concepts/forks?view=vsts&amp;tabs=visual-studio" rel="noreferrer">have a fork</a>, you could try:</p> <ul> <li>clone that fork</li> <li>delete the VSTS forked repo</li> <li>create a new empty one</li> <li><p>change the remote URL of yo...
<p>If you don't want anymore to <a href="https://learn.microsoft.com/en-us/vsts/git/concepts/forks?view=vsts&amp;tabs=visual-studio" rel="noreferrer">have a fork</a>, you could try:</p> <ul> <li>clone that fork</li> <li>delete the VSTS forked repo</li> <li>create a new empty one</li> <li><p>change the remote URL of yo...
119, 79324, 116537
azure-devops, git, git-fork
<h1>Remove a git fork relationship in Azure Devops (VSTS)</h1> <p>I created a Azure Devops (VSTS) project by forking another project. Now whenever we clone the new project you get references to the original project in the console output </p> <pre><code>remote: This repository is a fork. Learn more at https://aka.ms/wh...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,753
git
# Remove a git fork relationship in Azure Devops (VSTS) I created a Azure Devops (VSTS) project by forking another project. Now whenever we clone the new project you get references to the original project in the console output ``` remote: This repository is a fork. Learn more at https://aka.ms/whatisafork. remote: To...
If you don't want anymore to [have a fork](https://learn.microsoft.com/en-us/vsts/git/concepts/forks?view=vsts&tabs=visual-studio), you could try: - clone that fork - delete the VSTS forked repo - create a new empty one - change the remote URL of your local clone ``` git remote set-url origin /URL/new/VSTS/repo ...
30809205
Couldn't set refs/heads/master when commit
19
2015-06-12 17:43:30
<p>I was able to commit fine yesterday. But today (I didn't change anything), when I commit:</p> <pre><code>$ git add config.h $ git commit -m "Update config.h to reset the values" error: Couldn't set refs/heads/master fatal: cannot update HEAD ref </code></pre> <p>I know that this error may happen also during pull o...
45,936
2,893,053
2024-11-18 13:19:31
30,809,308
19
2015-06-12 17:51:08
4,921,103
2015-06-13 10:40:01
https://stackoverflow.com/q/30809205
https://stackoverflow.com/a/30809308
<p>It seems you have lost your <code>HEAD</code>, so you will have to recreate it. You can do that using this.</p> <pre><code>echo ref: refs/heads/master &gt;.git/HEAD </code></pre> <p>This will create a <code>HEAD</code> file in your .git folder. That should solve your problem.</p> <p>Also, try the <code>git fsck</...
<p>It seems you have lost your <code>HEAD</code>, so you will have to recreate it. You can do that using this.</p> <pre><code>echo ref: refs/heads/master &gt;.git/HEAD </code></pre> <p>This will create a <code>HEAD</code> file in your .git folder. That should solve your problem.</p> <p>Also, try the <code>git fsck</...
119, 53850
git, git-commit
<h1>Couldn't set refs/heads/master when commit</h1> <p>I was able to commit fine yesterday. But today (I didn't change anything), when I commit:</p> <pre><code>$ git add config.h $ git commit -m "Update config.h to reset the values" error: Couldn't set refs/heads/master fatal: cannot update HEAD ref </code></pre> <p>...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,754
git
# Couldn't set refs/heads/master when commit I was able to commit fine yesterday. But today (I didn't change anything), when I commit: ``` $ git add config.h $ git commit -m "Update config.h to reset the values" error: Couldn't set refs/heads/master fatal: cannot update HEAD ref ``` I know that this error may happen...
It seems you have lost your `HEAD`, so you will have to recreate it. You can do that using this. ``` echo ref: refs/heads/master >.git/HEAD ``` This will create a `HEAD` file in your .git folder. That should solve your problem. Also, try the `git fsck` command. It verifies the connectivity and validity of the object...
22276456
JGit how do i get the SHA1 from a RevCommit?
19
2014-03-08 23:29:08
<p>This seems like an idiotic question, but I can't find documentation on it anywhere.</p> <p>How do I get a the SHA1 of a RevCommit object?</p>
3,766
903,680
2020-11-28 19:36:19
22,276,540
19
2014-03-08 23:39:30
242,520
2014-03-08 23:39:30
https://stackoverflow.com/q/22276456
https://stackoverflow.com/a/22276540
<p><a href="http://download.eclipse.org/jgit/docs/jgit-2.0.0.201206130900-r/apidocs/org/eclipse/jgit/revwalk/RevCommit.html" rel="noreferrer"><code>RevCommit</code></a> inherits from <code>AnyObjectId</code> which has a <a href="http://download.eclipse.org/jgit/docs/jgit-2.0.0.201206130900-r/apidocs/org/eclipse/jgit/li...
<p><a href="http://download.eclipse.org/jgit/docs/jgit-2.0.0.201206130900-r/apidocs/org/eclipse/jgit/revwalk/RevCommit.html" rel="noreferrer"><code>RevCommit</code></a> inherits from <code>AnyObjectId</code> which has a <a href="http://download.eclipse.org/jgit/docs/jgit-2.0.0.201206130900-r/apidocs/org/eclipse/jgit/li...
61058
jgit
<h1>JGit how do i get the SHA1 from a RevCommit?</h1> <p>This seems like an idiotic question, but I can't find documentation on it anywhere.</p> <p>How do I get a the SHA1 of a RevCommit object?</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,755
git
# JGit how do i get the SHA1 from a RevCommit? This seems like an idiotic question, but I can't find documentation on it anywhere. How do I get a the SHA1 of a RevCommit object?
[`RevCommit`](http://download.eclipse.org/jgit/docs/jgit-2.0.0.201206130900-r/apidocs/org/eclipse/jgit/revwalk/RevCommit.html) inherits from `AnyObjectId` which has a [`getName`](http://download.eclipse.org/jgit/docs/jgit-2.0.0.201206130900-r/apidocs/org/eclipse/jgit/lib/AnyObjectId.html#getName()) function. > ## getN...
19791036
How to switch between the tags in Git
19
2013-11-05 14:13:10
<p>I am new to git. And I am facing problems while moving between the tags. I want to switch between the tags. Like if I have two versions. For example. version 1.0 version 2.0 so I want to move from version 2.0 to version 1.0 in Git.</p>
26,433
1,429,181
2013-11-05 17:54:46
19,791,197
19
2013-11-05 14:22:37
46,375
2013-11-05 17:54:46
https://stackoverflow.com/q/19791036
https://stackoverflow.com/a/19791197
<p>In git, a tag is given a name, which in git terminology is its reference. A tag in reality is more like an alias to a specific commit id (which is also a reference).</p> <p>See <a href="http://git-scm.com/book/en/Git-Internals-Git-References">http://git-scm.com/book/en/Git-Internals-Git-References</a></p> <p>So t...
<p>In git, a tag is given a name, which in git terminology is its reference. A tag in reality is more like an alias to a specific commit id (which is also a reference).</p> <p>See <a href="http://git-scm.com/book/en/Git-Internals-Git-References">http://git-scm.com/book/en/Git-Internals-Git-References</a></p> <p>So t...
119
git
<h1>How to switch between the tags in Git</h1> <p>I am new to git. And I am facing problems while moving between the tags. I want to switch between the tags. Like if I have two versions. For example. version 1.0 version 2.0 so I want to move from version 2.0 to version 1.0 in Git.</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,756
git
# How to switch between the tags in Git I am new to git. And I am facing problems while moving between the tags. I want to switch between the tags. Like if I have two versions. For example. version 1.0 version 2.0 so I want to move from version 2.0 to version 1.0 in Git.
In git, a tag is given a name, which in git terminology is its reference. A tag in reality is more like an alias to a specific commit id (which is also a reference). See <http://git-scm.com/book/en/Git-Internals-Git-References> So to switch between tags you would use the same technique that you would use to switch be...
15526488
How can one determine the committer of a cherry-pick in Git?
19
2013-03-20 14:33:29
<p>In Git, <code>cherry-pick</code> retains the original commit's author, timestamp etc, at least when there are no conflicts. But is there any way to determine what user performed the cherry-pick which brought that commit to the new branch? </p>
8,012
317,110
2013-03-20 16:58:52
15,526,587
19
2013-03-20 14:37:46
1,600,898
2013-03-20 14:58:57
https://stackoverflow.com/q/15526488
https://stackoverflow.com/a/15526587
<p>The author will be picked up from the original commit, but the committer (shown with <code>git log --format=full</code>) will be the one doing the cherry picking. This committer field is not secure, as cherry-pick commit creation is ultimately under the control of the cherry-picker. The only reliable way to track th...
<p>The author will be picked up from the original commit, but the committer (shown with <code>git log --format=full</code>) will be the one doing the cherry picking. This committer field is not secure, as cherry-pick commit creation is ultimately under the control of the cherry-picker. The only reliable way to track th...
119, 717, 36489, 78810
cherry-pick, git, git-cherry-pick, merge
<h1>How can one determine the committer of a cherry-pick in Git?</h1> <p>In Git, <code>cherry-pick</code> retains the original commit's author, timestamp etc, at least when there are no conflicts. But is there any way to determine what user performed the cherry-pick which brought that commit to the new branch? </p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,757
git
# How can one determine the committer of a cherry-pick in Git? In Git, `cherry-pick` retains the original commit's author, timestamp etc, at least when there are no conflicts. But is there any way to determine what user performed the cherry-pick which brought that commit to the new branch?
The author will be picked up from the original commit, but the committer (shown with `git log --format=full`) will be the one doing the cherry picking. This committer field is not secure, as cherry-pick commit creation is ultimately under the control of the cherry-picker. The only reliable way to track the commit creat...
13887454
git flow releasing selected features
19
2012-12-14 23:03:22
<p>I am trying to introduce Git flow to my team. We are a fairly small team and quite agile. We want to release once a day and this means we have limited time towards testing all the changes in the day. Business team wants to be able to control the features that are getting released although its not ideal.</p> <p>Git ...
5,360
371,572
2017-11-29 00:33:55
13,903,614
19
2012-12-16 17:15:55
729,539
2012-12-16 17:15:55
https://stackoverflow.com/q/13887454
https://stackoverflow.com/a/13903614
<p>The standard <code>git flow</code> handling is not ideal if the business team wants to control which features are in the next release. But you will have the same problem with other branching mechanisms. </p> <p>The default structure for <code>git flow</code> is that you create a feature branch for each new feature....
<p>The standard <code>git flow</code> handling is not ideal if the business team wants to control which features are in the next release. But you will have the same problem with other branching mechanisms. </p> <p>The default structure for <code>git flow</code> is that you create a feature branch for each new feature....
119, 508, 64339
agile, git, git-flow
<h1>git flow releasing selected features</h1> <p>I am trying to introduce Git flow to my team. We are a fairly small team and quite agile. We want to release once a day and this means we have limited time towards testing all the changes in the day. Business team wants to be able to control the features that are getting...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,758
git
# git flow releasing selected features I am trying to introduce Git flow to my team. We are a fairly small team and quite agile. We want to release once a day and this means we have limited time towards testing all the changes in the day. Business team wants to be able to control the features that are getting released...
The standard `git flow` handling is not ideal if the business team wants to control which features are in the next release. But you will have the same problem with other branching mechanisms. The default structure for `git flow` is that you create a feature branch for each new feature. Once you have finished building ...
917102
In Git, is there a way to get the "friendly" name for an arbitrary commit?
19
2009-05-27 17:46:48
<p>In Git, there are numerous ways to refer to a commit, including the full SHA hash or a shortened form of the hash (say, the first 6 characters or so). You can also name commits using a "friendly" syntax, like HEAD, HEAD^, HEAD^^, HEAD~3, and so on.</p> <p>Given an arbitrary commit in SHA hash form, is there a tool ...
5,387
28,804
2009-05-27 18:09:35
917,199
19
2009-05-27 18:09:13
85,134
2009-05-27 18:09:13
https://stackoverflow.com/q/917102
https://stackoverflow.com/a/917199
<p>You can use "git name-rev" to get the form you are asking about. One problem with that form is that, being relative to a branch, it isn't a permanent name. So an alternative is "git describe" which produces an alternative friendly name based on how far ahead of a tag a given commit is.</p> <p>For example:</p> <pre...
<p>You can use "git name-rev" to get the form you are asking about. One problem with that form is that, being relative to a branch, it isn't a permanent name. So an alternative is "git describe" which produces an alternative friendly name based on how far ahead of a tag a given commit is.</p> <p>For example:</p> <pre...
119
git
<h1>In Git, is there a way to get the "friendly" name for an arbitrary commit?</h1> <p>In Git, there are numerous ways to refer to a commit, including the full SHA hash or a shortened form of the hash (say, the first 6 characters or so). You can also name commits using a "friendly" syntax, like HEAD, HEAD^, HEAD^^, HEA...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,759
git
# In Git, is there a way to get the "friendly" name for an arbitrary commit? In Git, there are numerous ways to refer to a commit, including the full SHA hash or a shortened form of the hash (say, the first 6 characters or so). You can also name commits using a "friendly" syntax, like HEAD, HEAD^, HEAD^^, HEAD~3, and ...
You can use "git name-rev" to get the form you are asking about. One problem with that form is that, being relative to a branch, it isn't a permanent name. So an alternative is "git describe" which produces an alternative friendly name based on how far ahead of a tag a given commit is. For example: ``` srh@devo16:~/s...
37849771
Can git be made to mostly auto-merge XML order-insensitive files?
18
2016-06-16 04:12:33
<p>When merging Lightswitch branches, often colleagues will add properties to an entity I also modified, which will result in a merge conflict, as the new XML entries are added to the same positions in the lsml file.</p> <p>I can effectively always solve these by accepting left and right in no particular order, so one...
8,065
201,487
2025-02-21 08:01:29
37,871,247
19
2016-06-17 00:11:42
1,256,452
2016-06-17 00:11:42
https://stackoverflow.com/q/37849771
https://stackoverflow.com/a/37871247
<p>This gets pretty hard in general.</p> <p><a href="https://stackoverflow.com/q/36830144/1256452">Some have attempted to use Git's union merge</a> (which is more accessible now than it was in early days; as in that question, you just add <code>merge=union</code> in a <code>.gitattributes</code> file), but this does n...
<p>This gets pretty hard in general.</p> <p><a href="https://stackoverflow.com/q/36830144/1256452">Some have attempted to use Git's union merge</a> (which is more accessible now than it was in early days; as in that question, you just add <code>merge=union</code> in a <code>.gitattributes</code> file), but this does n...
19, 119
git, xml
<h1>Can git be made to mostly auto-merge XML order-insensitive files?</h1> <p>When merging Lightswitch branches, often colleagues will add properties to an entity I also modified, which will result in a merge conflict, as the new XML entries are added to the same positions in the lsml file.</p> <p>I can effectively al...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,760
git
# Can git be made to mostly auto-merge XML order-insensitive files? When merging Lightswitch branches, often colleagues will add properties to an entity I also modified, which will result in a merge conflict, as the new XML entries are added to the same positions in the lsml file. I can effectively always solve these...
This gets pretty hard in general. [Some have attempted to use Git's union merge](https://stackoverflow.com/q/36830144/1256452) (which is more accessible now than it was in early days; as in that question, you just add `merge=union` in a `.gitattributes` file), but this does not work in general. It *might* work sometim...
27368059
Git fetch repeatedly tells me about the same new branch
18
2014-12-08 22:19:26
<p>On one particular repo, when I run</p> <pre><code>git fetch </code></pre> <p>It does all the stuff it's supposed to do, but also reports:</p> <pre><code> * [new branch] Story/abc-123 -&gt; origin/Story/abc-123 </code></pre> <p><em>every</em> single time.</p> <p>if I run git branch -r | grep abc-123, it yie...
3,387
1,350,255
2015-01-13 04:49:23
27,915,063
19
2015-01-13 04:49:23
1,928,224
2015-01-13 04:49:23
https://stackoverflow.com/q/27368059
https://stackoverflow.com/a/27915063
<p>The problem here is that your <code>./git/refs</code> directory is in a different case for part of the branch name compared to the actual remote. I.e., git branch thinks the branch is lower case:</p> <pre><code>$git branch ... origin/story/abc-123 ... </code></pre> <p>But your copy of the refs thinks the story ...
<p>The problem here is that your <code>./git/refs</code> directory is in a different case for part of the branch name compared to the actual remote. I.e., git branch thinks the branch is lower case:</p> <pre><code>$git branch ... origin/story/abc-123 ... </code></pre> <p>But your copy of the refs thinks the story ...
119
git
<h1>Git fetch repeatedly tells me about the same new branch</h1> <p>On one particular repo, when I run</p> <pre><code>git fetch </code></pre> <p>It does all the stuff it's supposed to do, but also reports:</p> <pre><code> * [new branch] Story/abc-123 -&gt; origin/Story/abc-123 </code></pre> <p><em>every</em> s...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,761
git
# Git fetch repeatedly tells me about the same new branch On one particular repo, when I run ``` git fetch ``` It does all the stuff it's supposed to do, but also reports: ``` * [new branch] Story/abc-123 -> origin/Story/abc-123 ``` *every* single time. if I run git branch -r | grep abc-123, it yields: ```...
The problem here is that your `./git/refs` directory is in a different case for part of the branch name compared to the actual remote. I.e., git branch thinks the branch is lower case: ``` $git branch ... origin/story/abc-123 ... ``` But your copy of the refs thinks the story directory is upper case: ``` $ls .git/r...
14832963
How can I control the rename threshold when committing files under git?
18
2013-02-12 12:49:03
<p>I'm trying to place into git's history successive snapshots of a specific project. I am doing this by populating the repository directory with the contents of each snapshot and then running</p> <pre><code>git add -A . git commit -m 'Version X' </code></pre> <p>This is the method recommended in <a href="https://sta...
11,853
20,520
2013-02-12 13:34:20
14,833,041
19
2013-02-12 12:53:25
159,834
2013-02-12 12:53:25
https://stackoverflow.com/q/14832963
https://stackoverflow.com/a/14833041
<p><code>git commit</code> never detects renames. It just writes content to the repository. Renames (and copies as well) are only detected after the fact, i.e. when running <code>git diff</code>, <code>git merge</code> and friends. That's because <code>git</code> does not store any rename/copy information.</p>
<p><code>git commit</code> never detects renames. It just writes content to the repository. Renames (and copies as well) are only detected after the fact, i.e. when running <code>git diff</code>, <code>git merge</code> and friends. That's because <code>git</code> does not store any rename/copy information.</p>
119, 4510, 53850
git, git-commit, rename
<h1>How can I control the rename threshold when committing files under git?</h1> <p>I'm trying to place into git's history successive snapshots of a specific project. I am doing this by populating the repository directory with the contents of each snapshot and then running</p> <pre><code>git add -A . git commit -m 'Ve...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,762
git
# How can I control the rename threshold when committing files under git? I'm trying to place into git's history successive snapshots of a specific project. I am doing this by populating the repository directory with the contents of each snapshot and then running ``` git add -A . git commit -m 'Version X' ``` This i...
`git commit` never detects renames. It just writes content to the repository. Renames (and copies as well) are only detected after the fact, i.e. when running `git diff`, `git merge` and friends. That's because `git` does not store any rename/copy information.
66119081
Why does zsh kills my process every time I enter a git command
17
2021-02-09 12:32:38
<p>I'm trying to set up git on my apple M1 macbook air. I tried to run git and I saw that I needed to update my command-line-tools first and so did I. But now, every time I tried to enter a git command, I see the same line again and again: <code>zsh: killed git</code>.</p> <p>For example, when I type <code>git</cod...
73,829
15,138,458
2025-01-13 10:23:56
66,432,398
19
2021-03-02 02:22:51
12,838,403
2021-03-02 02:22:51
https://stackoverflow.com/q/66119081
https://stackoverflow.com/a/66432398
<p>Here I put the final solution. I tried many methods on my mac M1, the best method is re-install homebrew.</p> <p>Step1:</p> <pre><code>/bin/bash -c &quot;$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall.sh)&quot; </code></pre> <p>Step2: Install homebrew</p> <pre><code>cd /opt mkdir h...
<p>Here I put the final solution. I tried many methods on my mac M1, the best method is re-install homebrew.</p> <p>Step1:</p> <pre><code>/bin/bash -c &quot;$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall.sh)&quot; </code></pre> <p>Step2: Install homebrew</p> <pre><code>cd /opt mkdir h...
119, 3791, 148094
apple-m1, git, zsh
<h1>Why does zsh kills my process every time I enter a git command</h1> <p>I'm trying to set up git on my apple M1 macbook air. I tried to run git and I saw that I needed to update my command-line-tools first and so did I. But now, every time I tried to enter a git command, I see the same line again and again: <code>zs...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,765
git
# Why does zsh kills my process every time I enter a git command I'm trying to set up git on my apple M1 macbook air. I tried to run git and I saw that I needed to update my command-line-tools first and so did I. But now, every time I tried to enter a git command, I see the same line again and again: `zsh: killed git`...
Here I put the final solution. I tried many methods on my mac M1, the best method is re-install homebrew. Step1: ``` /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall.sh)" ``` Step2: Install homebrew ``` cd /opt mkdir homebrew # if not exist, just create one. curl -L ht...
55463863
How to turn off the help hints in git output?
17
2019-04-01 21:31:21
<p>I'm using git in the terminal and know most of the commands I need by heart. Therefore I would like to suppress the "help hints" in the output, i.e. all the text in parenthesis starting with <code>(use "git ...</code>) to make the output less verbose.</p> <p>I know of the flags <code>--short</code> and <code>--porc...
8,796
1,786,528
2024-12-24 11:20:26
55,465,744
19
2019-04-02 01:37:22
6,881,516
2022-12-23 10:41:48
https://stackoverflow.com/q/55463863
https://stackoverflow.com/a/55465744
<p>Git offered enabling/disabling advice by using the 'advice.*' key in the configuration. See <code>git help config</code> for more information or the <a href="https://git-scm.com/docs/git-config#Documentation/git-config.txt-advice" rel="nofollow noreferrer">online manpage</a>. The following 14 variables exist:</p> <p...
<p>Git offered enabling/disabling advice by using the 'advice.*' key in the configuration. See <code>git help config</code> for more information or the <a href="https://git-scm.com/docs/git-config#Documentation/git-config.txt-advice" rel="nofollow noreferrer">online manpage</a>. The following 14 variables exist:</p> <p...
119
git
<h1>How to turn off the help hints in git output?</h1> <p>I'm using git in the terminal and know most of the commands I need by heart. Therefore I would like to suppress the "help hints" in the output, i.e. all the text in parenthesis starting with <code>(use "git ...</code>) to make the output less verbose.</p> <p>I ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,767
git
# How to turn off the help hints in git output? I'm using git in the terminal and know most of the commands I need by heart. Therefore I would like to suppress the "help hints" in the output, i.e. all the text in parenthesis starting with `(use "git ...`) to make the output less verbose. I know of the flags `--short`...
Git offered enabling/disabling advice by using the 'advice.*' key in the configuration. See `git help config` for more information or the [online manpage](https://git-scm.com/docs/git-config#Documentation/git-config.txt-advice). The following 14 variables exist: ``` advice.pushUpdateRejected advice.pushNonFFCurrent ad...
29793727
How to remove all added files in GIT
17
2015-04-22 09:48:29
<p>By mistake I used <code>git add .</code> so all files are added in staring area. I want to remove all those files from staring area.</p> <p>I tried </p> <pre><code>git clean -fdx git clean -df </code></pre> <p>but it isn't worked. </p>
16,789
3,349,666
2022-08-08 08:09:15
29,793,808
19
2015-04-22 09:51:36
1,755,598
2015-04-22 09:54:37
https://stackoverflow.com/q/29793727
https://stackoverflow.com/a/29793808
<p>you need use the <code>git reset --mixed</code>.<br> The <code>--mixed</code> if for clearing the stage/cache/index area.</p>
<p>you need use the <code>git reset --mixed</code>.<br> The <code>--mixed</code> if for clearing the stage/cache/index area.</p>
119
git
<h1>How to remove all added files in GIT</h1> <p>By mistake I used <code>git add .</code> so all files are added in staring area. I want to remove all those files from staring area.</p> <p>I tried </p> <pre><code>git clean -fdx git clean -df </code></pre> <p>but it isn't worked. </p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,768
git
# How to remove all added files in GIT By mistake I used `git add .` so all files are added in staring area. I want to remove all those files from staring area. I tried ``` git clean -fdx git clean -df ``` but it isn't worked.
you need use the `git reset --mixed`. The `--mixed` if for clearing the stage/cache/index area.
29766780
"no such table" error on Heroku after django syncdb passed
17
2015-04-21 08:27:11
<p>I'm trying to deploy my Django application to Heroku. The migrations are in my local Git. When I try:</p> <pre><code>git push heroku master heroku run python manage.py syncdb </code></pre> <p>It applies the migrations and also promts me to create superuser, which I successfully do. Now the application is up and ru...
11,162
4,224,439
2023-11-18 18:53:19
29,767,527
19
2015-04-21 09:00:48
104,349
2015-04-21 09:00:48
https://stackoverflow.com/q/29766780
https://stackoverflow.com/a/29767527
<p>You must not use sqlite3 on Heroku.</p> <p>sqlite stores the database as a file on disk. But the filesystem in a Heroku dyno is not persistent, and is not shared between dynos. So, when you do <code>heroku run python manage.py migrate</code>, Heroku spins up a new dyno with a blank database, runs the migrations, th...
<p>You must not use sqlite3 on Heroku.</p> <p>sqlite stores the database as a file on disk. But the filesystem in a Heroku dyno is not persistent, and is not shared between dynos. So, when you do <code>heroku run python manage.py migrate</code>, Heroku spins up a new dyno with a blank database, runs the migrations, th...
16, 119, 243, 8279
django, git, heroku, python
<h1>"no such table" error on Heroku after django syncdb passed</h1> <p>I'm trying to deploy my Django application to Heroku. The migrations are in my local Git. When I try:</p> <pre><code>git push heroku master heroku run python manage.py syncdb </code></pre> <p>It applies the migrations and also promts me to create ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,769
git
# "no such table" error on Heroku after django syncdb passed I'm trying to deploy my Django application to Heroku. The migrations are in my local Git. When I try: ``` git push heroku master heroku run python manage.py syncdb ``` It applies the migrations and also promts me to create superuser, which I successfully d...
You must not use sqlite3 on Heroku. sqlite stores the database as a file on disk. But the filesystem in a Heroku dyno is not persistent, and is not shared between dynos. So, when you do `heroku run python manage.py migrate`, Heroku spins up a new dyno with a blank database, runs the migrations, then deletes the dyno a...
17599342
What does "git checkout - ." do?
17
2013-07-11 17:02:56
<p>I wanted to revert all local changes with</p> <pre><code>git checkout -- . </code></pre> <p>but accidently did</p> <pre><code>git checkout - . </code></pre> <p>and it made lots of local modifications that I can't understand at all.</p> <p>What does the second command do and is it possible to revert what was don...
18,844
19,224
2024-05-28 12:17:07
17,599,781
19
2013-07-11 17:29:13
758,345
2024-05-28 12:17:07
https://stackoverflow.com/q/17599342
https://stackoverflow.com/a/17599781
<p><code>git checkout -</code> checks out the previously checked out branch. So I would assume that <code>git checkout - .</code> will replace the contents of the working copy with the contents of the previously checked out branch.</p> <p>You can not undo that, but since you wanted to reset the contents of your working...
<p><code>git checkout -</code> checks out the previously checked out branch. So I would assume that <code>git checkout - .</code> will replace the contents of the working copy with the contents of the previously checked out branch.</p> <p>You can not undo that, but since you wanted to reset the contents of your working...
119
git
<h1>What does "git checkout - ." do?</h1> <p>I wanted to revert all local changes with</p> <pre><code>git checkout -- . </code></pre> <p>but accidently did</p> <pre><code>git checkout - . </code></pre> <p>and it made lots of local modifications that I can't understand at all.</p> <p>What does the second command do...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,771
git
# What does "git checkout - ." do? I wanted to revert all local changes with ``` git checkout -- . ``` but accidently did ``` git checkout - . ``` and it made lots of local modifications that I can't understand at all. What does the second command do and is it possible to revert what was done?
`git checkout -` checks out the previously checked out branch. So I would assume that `git checkout - .` will replace the contents of the working copy with the contents of the previously checked out branch. You can not undo that, but since you wanted to reset the contents of your working dir anyways, why don’t you jus...
9308119
git cannot execute python-script as hook
17
2012-02-16 08:53:39
<p>I have created a little <code>pre-commit</code> hook in python. This hook works like a charm under Linux, but in Windows it keeps telling me:</p> <pre><code>error: cannot spawn .git/hooks/pre-commit: No such file or directory </code></pre> <p>I know there have been similar questions here about the same issue and t...
15,999
717,341
2012-06-05 15:09:25
10,899,907
19
2012-06-05 15:09:25
717,341
2012-06-05 15:09:25
https://stackoverflow.com/q/9308119
https://stackoverflow.com/a/10899907
<p>I used the proxy-approach to make the python script work under windows (with msysgit). The complete script (with description on how I did it) might be found here: <a href="https://gist.github.com/1839424" rel="noreferrer">https://gist.github.com/1839424</a></p> <p>Here is the important part about making it work und...
<p>I used the proxy-approach to make the python script work under windows (with msysgit). The complete script (with description on how I did it) might be found here: <a href="https://gist.github.com/1839424" rel="noreferrer">https://gist.github.com/1839424</a></p> <p>Here is the important part about making it work und...
16, 64, 119, 21628, 43087
git, githooks, msysgit, python, windows
<h1>git cannot execute python-script as hook</h1> <p>I have created a little <code>pre-commit</code> hook in python. This hook works like a charm under Linux, but in Windows it keeps telling me:</p> <pre><code>error: cannot spawn .git/hooks/pre-commit: No such file or directory </code></pre> <p>I know there have been...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,772
git
# git cannot execute python-script as hook I have created a little `pre-commit` hook in python. This hook works like a charm under Linux, but in Windows it keeps telling me: ``` error: cannot spawn .git/hooks/pre-commit: No such file or directory ``` I know there have been similar questions here about the same issue...
I used the proxy-approach to make the python script work under windows (with msysgit). The complete script (with description on how I did it) might be found here: <https://gist.github.com/1839424> Here is the important part about making it work under Windows --- If you're working with Windows (and "msysgit"), it's a...
72312460
How to replace a Go Module with a major version to a fork @ master
16
2022-05-20 00:48:22
<p>I have trouble mapping a fork through any pinned branch with go.mod that use a project with the <code>/v2</code> / major version mapping.</p> <p>I have the following go.mod:</p> <pre><code>go 1.18 require ( github.com/versent/saml2aws/v2 v2.35.0 ) </code></pre> <p>Notice the module requires the <code>/v2</code>...
30,747
1,568,940
2024-03-18 09:43:41
72,312,461
19
2022-05-20 00:48:22
1,568,940
2022-05-20 16:11:34
https://stackoverflow.com/q/72312460
https://stackoverflow.com/a/72312461
<p>After a lot of digging, here are the steps I found that seem to be working:</p> <ol> <li>Create a fork of any project</li> <li>Change the <code>go.mod</code> first line to your new fork name, commit &amp; push</li> <li>Commit&amp;Push any change you need, in a branch or in master</li> <li>In your original project, d...
<p>After a lot of digging, here are the steps I found that seem to be working:</p> <ol> <li>Create a fork of any project</li> <li>Change the <code>go.mod</code> first line to your new fork name, commit &amp; push</li> <li>Commit&amp;Push any change you need, in a branch or in master</li> <li>In your original project, d...
119, 2347, 2498, 15627, 134371
fork, git, go, go-modules, replace
<h1>How to replace a Go Module with a major version to a fork @ master</h1> <p>I have trouble mapping a fork through any pinned branch with go.mod that use a project with the <code>/v2</code> / major version mapping.</p> <p>I have the following go.mod:</p> <pre><code>go 1.18 require ( github.com/versent/saml2aws/v...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,773
git
# How to replace a Go Module with a major version to a fork @ master I have trouble mapping a fork through any pinned branch with go.mod that use a project with the `/v2` / major version mapping. I have the following go.mod: ``` go 1.18 require ( github.com/versent/saml2aws/v2 v2.35.0 ) ``` Notice the module r...
After a lot of digging, here are the steps I found that seem to be working: 1. Create a fork of any project 2. Change the `go.mod` first line to your new fork name, commit & push 3. Commit&Push any change you need, in a branch or in master 4. In your original project, do the following command: `go get -d -u github.com...
34298273
Does git rebase create more conflicts than git merge?
16
2015-12-15 19:57:48
<p>Is it true that <code>git rebase</code> is more prone to conflicts than <code>git merge</code>? I have heard that before and it is referenced in <a href="http://nathanleclaire.com/blog/2014/09/14/dont-be-scared-of-git-rebase/" rel="noreferrer">this post</a></p> <blockquote> <p>I am speculating based on anecdata ...
2,943
1,086,540
2019-10-17 14:52:39
34,298,570
19
2015-12-15 20:15:46
3,474,528
2015-12-16 00:10:40
https://stackoverflow.com/q/34298273
https://stackoverflow.com/a/34298570
<p>You'll end up with more conflicts with a rebase if you have multiple commits. This is because when you rebase you'll have to solve conflicts for each commit. That means if you're trying to rebase a branch that is 5 commits ahead of your master and you introduced a merge conflict in the first of those 5 commits you'l...
<p>You'll end up with more conflicts with a rebase if you have multiple commits. This is because when you rebase you'll have to solve conflicts for each commit. That means if you're trying to rebase a branch that is 5 commits ahead of your master and you introduced a merge conflict in the first of those 5 commits you'l...
119, 28897, 29934
git, git-merge, git-rebase
<h1>Does git rebase create more conflicts than git merge?</h1> <p>Is it true that <code>git rebase</code> is more prone to conflicts than <code>git merge</code>? I have heard that before and it is referenced in <a href="http://nathanleclaire.com/blog/2014/09/14/dont-be-scared-of-git-rebase/" rel="noreferrer">this post<...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,774
git
# Does git rebase create more conflicts than git merge? Is it true that `git rebase` is more prone to conflicts than `git merge`? I have heard that before and it is referenced in [this post](http://nathanleclaire.com/blog/2014/09/14/dont-be-scared-of-git-rebase/) > I am speculating based on anecdata here, but I suspe...
You'll end up with more conflicts with a rebase if you have multiple commits. This is because when you rebase you'll have to solve conflicts for each commit. That means if you're trying to rebase a branch that is 5 commits ahead of your master and you introduced a merge conflict in the first of those 5 commits you'll h...
23550614
How to view files in bare repositories?
16
2014-05-08 19:15:02
<p>I have a bare repository in my remote. I want to look at files, that is open in an editor and view the code. For listing files, git ls-files master or git ls-tree master. and for viewing single file, I could do git show 100644 But how do I view files in directories. Here is an example:</p> <pre><code>100644 blob 03...
8,380
1,988,876
2020-07-01 19:05:41
23,550,734
19
2014-05-08 19:22:23
140,750
2020-07-01 19:05:41
https://stackoverflow.com/q/23550614
https://stackoverflow.com/a/23550734
<pre><code>git show ${branch}:templates/base.html </code></pre>
<pre><code>git show ${branch}:templates/base.html </code></pre>
119, 64465, 74295
git, git-bare, git-show
<h1>How to view files in bare repositories?</h1> <p>I have a bare repository in my remote. I want to look at files, that is open in an editor and view the code. For listing files, git ls-files master or git ls-tree master. and for viewing single file, I could do git show 100644 But how do I view files in directories. H...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,775
git
# How to view files in bare repositories? I have a bare repository in my remote. I want to look at files, that is open in an editor and view the code. For listing files, git ls-files master or git ls-tree master. and for viewing single file, I could do git show 100644 But how do I view files in directories. Here is an...
``` git show ${branch}:templates/base.html ```
12192095
How to discard change to git submodule?
16
2012-08-30 07:39:50
<p>I changed the commit pointer of a git submodule:</p> <pre><code>% git status # On branch fix # Your branch is behind 'origin/fix' by 1 commit, and can be fast-forwarded. # # Changes not staged for commit: # (use "git add &lt;file&gt;..." to update what will be committed) # (use "git checkout -- &lt;file&gt;..."...
7,222
199,649
2012-08-30 07:43:14
12,192,146
19
2012-08-30 07:43:14
221,955
2012-08-30 07:43:14
https://stackoverflow.com/q/12192095
https://stackoverflow.com/a/12192146
<p>Git doesn't update submodules automatically when the SHA in them has changed.</p> <p>You either need to <code>git submodule update</code> which will put the submodule back to the expected SHA, or <code>git add app/lib</code> which will change the expected SHA to the current value in the submodule.</p>
<p>Git doesn't update submodules automatically when the SHA in them has changed.</p> <p>You either need to <code>git submodule update</code> which will put the submodule back to the expected SHA, or <code>git add app/lib</code> which will change the expected SHA to the current value in the submodule.</p>
119, 41612
git, git-submodules
<h1>How to discard change to git submodule?</h1> <p>I changed the commit pointer of a git submodule:</p> <pre><code>% git status # On branch fix # Your branch is behind 'origin/fix' by 1 commit, and can be fast-forwarded. # # Changes not staged for commit: # (use "git add &lt;file&gt;..." to update what will be comm...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,777
git
# How to discard change to git submodule? I changed the commit pointer of a git submodule: ``` % git status # On branch fix # Your branch is behind 'origin/fix' by 1 commit, and can be fast-forwarded. # # Changes not staged for commit: # (use "git add <file>..." to update what will be committed) # (use "git check...
Git doesn't update submodules automatically when the SHA in them has changed. You either need to `git submodule update` which will put the submodule back to the expected SHA, or `git add app/lib` which will change the expected SHA to the current value in the submodule.
10220374
Can I git svn rebase to a certain svn revision? (Similar to svn up -r ...)
16
2012-04-19 01:20:12
<p>Short question: what is the git-svn equivalent of <code>svn up -r r1130</code> to update only to a numbered commit (with the svn number)?</p> <p>I am using git-svn so I can both use git and manage (many) local branches of my team's svn repository. I have a version of the software that I hack up to work with a part...
7,747
527,489
2012-07-27 04:16:52
11,365,457
19
2012-07-06 15:43:56
1,507,239
2012-07-06 15:43:56
https://stackoverflow.com/q/10220374
https://stackoverflow.com/a/11365457
<p>I prefer <code>rebase</code> because git-svn is going to have to rebase your changes anyway before a <code>dcommit</code>. Try this instead:</p> <pre><code>git checkout `git svn find-rev r1241` # Go to the svn version of interest git checkout -b master_r1241 # Create a new brach matching it git checkout ...
<p>I prefer <code>rebase</code> because git-svn is going to have to rebase your changes anyway before a <code>dcommit</code>. Try this instead:</p> <pre><code>git checkout `git svn find-rev r1241` # Go to the svn version of interest git checkout -b master_r1241 # Create a new brach matching it git checkout ...
6452, 8974
git-svn, rebase
<h1>Can I git svn rebase to a certain svn revision? (Similar to svn up -r ...)</h1> <p>Short question: what is the git-svn equivalent of <code>svn up -r r1130</code> to update only to a numbered commit (with the svn number)?</p> <p>I am using git-svn so I can both use git and manage (many) local branches of my team's ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,778
git
# Can I git svn rebase to a certain svn revision? (Similar to svn up -r ...) Short question: what is the git-svn equivalent of `svn up -r r1130` to update only to a numbered commit (with the svn number)? I am using git-svn so I can both use git and manage (many) local branches of my team's svn repository. I have a ve...
I prefer `rebase` because git-svn is going to have to rebase your changes anyway before a `dcommit`. Try this instead: ``` git checkout `git svn find-rev r1241` # Go to the svn version of interest git checkout -b master_r1241 # Create a new brach matching it git checkout hwTesting # Merge pr...
3480741
git move a branch's start forward in the tree
16
2010-08-13 21:21:13
<p>Okay I almost have this rebase thing figured out.</p> <p>I can feel a breakthrough coming - here is the tipping point:</p> <p>How do I do a rebase to go from:</p> <pre><code>A - - B - - C - - D - - E (HEAD) | \ - - F - - G (branch1) </code></pre> <p>To:</p> <pre><code>A - - B - - C - - D - - E (HEAD) ...
10,006
33,822
2010-08-13 21:37:12
3,480,761
19
2010-08-13 21:24:34
309,308
2010-08-13 21:24:34
https://stackoverflow.com/q/3480741
https://stackoverflow.com/a/3480761
<p>This is a standard <code>rebase</code>, there's nothing tricky going on. You want to:</p> <pre><code>git checkout branch1 git rebase D </code></pre>
<p>This is a standard <code>rebase</code>, there's nothing tricky going on. You want to:</p> <pre><code>git checkout branch1 git rebase D </code></pre>
119, 1879, 8974
branch, git, rebase
<h1>git move a branch's start forward in the tree</h1> <p>Okay I almost have this rebase thing figured out.</p> <p>I can feel a breakthrough coming - here is the tipping point:</p> <p>How do I do a rebase to go from:</p> <pre><code>A - - B - - C - - D - - E (HEAD) | \ - - F - - G (branch1) </code></pre> <p>To:</p> ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,780
git
# git move a branch's start forward in the tree Okay I almost have this rebase thing figured out. I can feel a breakthrough coming - here is the tipping point: How do I do a rebase to go from: ``` A - - B - - C - - D - - E (HEAD) | \ - - F - - G (branch1) ``` To: ``` A - - B - - C - - D - - E (HEAD) ...
This is a standard `rebase`, there's nothing tricky going on. You want to: ``` git checkout branch1 git rebase D ```
64122620
How to list the URL for all Git submodules?
15
2020-09-29 15:18:51
<p>The &quot;git remote get-url origin&quot; can be used to fetch the location of the remote. How do I do the same for all the submodules?</p>
9,743
11,818,542
2023-02-10 08:44:34
64,123,121
19
2020-09-29 15:47:23
7,976,758
2022-07-29 21:03:28
https://stackoverflow.com/q/64122620
https://stackoverflow.com/a/64123121
<p>Run the command for every submodule:</p> <pre><code>git submodule foreach --recursive git remote get-url origin </code></pre>
<p>Run the command for every submodule:</p> <pre><code>git submodule foreach --recursive git remote get-url origin </code></pre>
119, 41612
git, git-submodules
<h1>How to list the URL for all Git submodules?</h1> <p>The &quot;git remote get-url origin&quot; can be used to fetch the location of the remote. How do I do the same for all the submodules?</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,783
git
# How to list the URL for all Git submodules? The "git remote get-url origin" can be used to fetch the location of the remote. How do I do the same for all the submodules?
Run the command for every submodule: ``` git submodule foreach --recursive git remote get-url origin ```
58124219
How can I use the new `git switch` syntax to create a new branch?
15
2019-09-26 20:21:55
<p>I am used to <code>git checkout -b branchname</code> to switch to a new branch named <code>branchname</code>. How do I do the same with <code>git switch</code>?</p>
37,658
1,226,434
2019-09-26 20:30:20
58,124,339
19
2019-09-26 20:30:20
6,309
2019-09-26 20:30:20
https://stackoverflow.com/q/58124219
https://stackoverflow.com/a/58124339
<p>Actually, you don't even (always) need the <code>--create</code> option when creating a new branch with <a href="https://git-scm.com/docs/git-switch" rel="noreferrer"><code>git switch</code></a>:</p> <p>if that branch matches a remote tracking one, it will create a local branch, and automatically track the remote o...
<p>Actually, you don't even (always) need the <code>--create</code> option when creating a new branch with <a href="https://git-scm.com/docs/git-switch" rel="noreferrer"><code>git switch</code></a>:</p> <p>if that branch matches a remote tracking one, it will create a local branch, and automatically track the remote o...
119
git
<h1>How can I use the new `git switch` syntax to create a new branch?</h1> <p>I am used to <code>git checkout -b branchname</code> to switch to a new branch named <code>branchname</code>. How do I do the same with <code>git switch</code>?</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,784
git
# How can I use the new `git switch` syntax to create a new branch? I am used to `git checkout -b branchname` to switch to a new branch named `branchname`. How do I do the same with `git switch`?
Actually, you don't even (always) need the `--create` option when creating a new branch with [`git switch`](https://git-scm.com/docs/git-switch): if that branch matches a remote tracking one, it will create a local branch, and automatically track the remote one! Meaning a simple `git switch <branch>` is enough. > If...
57156664
How to let git pull from branch not from tag?
15
2019-07-23 04:22:04
<p>Our repo happens to have a tag that has the same name as the branch name. So when I try to pull from that branch, git confused and pulled from tag, like this. I have to delete that tag first to make my git pull work.</p> <p>So how do I tell git pull from branch not from tag ?</p> <pre><code>cc-backend ➤ git pull o...
7,510
301,513
2024-11-22 01:44:59
57,156,943
19
2019-07-23 04:59:08
6,330,106
2024-11-22 01:44:59
https://stackoverflow.com/q/57156664
https://stackoverflow.com/a/57156943
<p>It seems the remote repository has a tag and a branch with the same name <code>0.9.0-rc6-patch1</code>. Use the full name to fetch/pull,</p> <pre><code># fetch/pull the tag git fetch/pull origin refs/tags/0.9.0-rc6-patch1 # fetch/pull the branch git fetch/pull origin refs/heads/0.9.0-rc6-patch1 </code></pre> <p>The...
<p>It seems the remote repository has a tag and a branch with the same name <code>0.9.0-rc6-patch1</code>. Use the full name to fetch/pull,</p> <pre><code># fetch/pull the tag git fetch/pull origin refs/tags/0.9.0-rc6-patch1 # fetch/pull the branch git fetch/pull origin refs/heads/0.9.0-rc6-patch1 </code></pre> <p>The...
119, 28896
git, git-pull
<h1>How to let git pull from branch not from tag?</h1> <p>Our repo happens to have a tag that has the same name as the branch name. So when I try to pull from that branch, git confused and pulled from tag, like this. I have to delete that tag first to make my git pull work.</p> <p>So how do I tell git pull from branch...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,785
git
# How to let git pull from branch not from tag? Our repo happens to have a tag that has the same name as the branch name. So when I try to pull from that branch, git confused and pulled from tag, like this. I have to delete that tag first to make my git pull work. So how do I tell git pull from branch not from tag ? ...
It seems the remote repository has a tag and a branch with the same name `0.9.0-rc6-patch1`. Use the full name to fetch/pull, ``` # fetch/pull the tag git fetch/pull origin refs/tags/0.9.0-rc6-patch1 # fetch/pull the branch git fetch/pull origin refs/heads/0.9.0-rc6-patch1 ``` There could be other refs. According to...
45137769
What exactly does "git pull" do?
15
2017-07-17 06:56:14
<p>I know that <code>git pull</code> is actually a combination of <code>git fetch</code> and <code>git merge</code>, and that it basically brings in the repository as it is in the remote repository.</p> <ol> <li>But still, does it mean that after <code>git pull</code> my working tree will be identical to the remote rep...
26,347
5,402,618
2024-10-04 21:58:30
45,148,040
19
2017-07-17 15:25:11
1,256,452
2019-11-20 07:18:26
https://stackoverflow.com/q/45137769
https://stackoverflow.com/a/45148040
<p>The <em>exactly</em> part is really quite tough. It's often said—and it's mostly true—that <code>git pull</code> runs <code>git fetch</code> followed by either <code>git merge</code> or <code>git rebase</code>, and in fact, <code>git pull</code>, which used to be a shell script and is now a C program, quite literal...
<p>The <em>exactly</em> part is really quite tough. It's often said—and it's mostly true—that <code>git pull</code> runs <code>git fetch</code> followed by either <code>git merge</code> or <code>git rebase</code>, and in fact, <code>git pull</code>, which used to be a shell script and is now a C program, quite literal...
119
git
<h1>What exactly does "git pull" do?</h1> <p>I know that <code>git pull</code> is actually a combination of <code>git fetch</code> and <code>git merge</code>, and that it basically brings in the repository as it is in the remote repository.</p> <ol> <li>But still, does it mean that after <code>git pull</code> my workin...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,790
git
# What exactly does "git pull" do? I know that `git pull` is actually a combination of `git fetch` and `git merge`, and that it basically brings in the repository as it is in the remote repository. 1. But still, does it mean that after `git pull` my working tree will be identical to the remote repo? 2. I found some c...
The *exactly* part is really quite tough. It's often said—and it's mostly true—that `git pull` runs `git fetch` followed by either `git merge` or `git rebase`, and in fact, `git pull`, which used to be a shell script and is now a C program, quite literally ran `git fetch` first, though now it directly invokes the C cod...
43708262
Yarn package manager: install dependencies from private Bitbucket repository
15
2017-04-30 15:49:42
<p>I'm trying to migrate a project <strong>from NPM to Yarn</strong>.</p> <p>Part of my <strong>node dependencies</strong> are <strong>private packages hosted on Bitbucket</strong> (not published on NPM registry) under the namespace of the company I'm working for.</p> <p>With NPM I'm able to declare those kind of dep...
11,864
2,902,821
2024-07-31 16:10:32
43,779,670
19
2017-05-04 09:58:25
232,990
2017-05-04 09:58:25
https://stackoverflow.com/q/43708262
https://stackoverflow.com/a/43779670
<p>Try </p> <pre><code>"@myCompany/package-name": "git+ssh://git@bitbucket.org/bitbucket-username/repo-name.git", </code></pre> <p>At least, that's what I'm using and it works without any problems.</p>
<p>Try </p> <pre><code>"@myCompany/package-name": "git+ssh://git@bitbucket.org/bitbucket-username/repo-name.git", </code></pre> <p>At least, that's what I'm using and it works without any problems.</p>
119, 8337, 46426, 122493
bitbucket, git, node.js, yarnpkg
<h1>Yarn package manager: install dependencies from private Bitbucket repository</h1> <p>I'm trying to migrate a project <strong>from NPM to Yarn</strong>.</p> <p>Part of my <strong>node dependencies</strong> are <strong>private packages hosted on Bitbucket</strong> (not published on NPM registry) under the namespace ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,791
git
# Yarn package manager: install dependencies from private Bitbucket repository I'm trying to migrate a project **from NPM to Yarn**. Part of my **node dependencies** are **private packages hosted on Bitbucket** (not published on NPM registry) under the namespace of the company I'm working for. With NPM I'm able to d...
Try ``` "@myCompany/package-name": "git+ssh://git@bitbucket.org/bitbucket-username/repo-name.git", ``` At least, that's what I'm using and it works without any problems.
36112517
Git - exclude specific commit and push
15
2016-03-20 10:17:32
<p>How to exclude specific commit from series of commits. I mean if I have 5 commits, and I only want to push 4 commits. How to do this. Please help to resolve this.</p>
32,011
3,265,777
2021-07-19 21:20:17
36,112,625
19
2016-03-20 10:30:36
1,755,598
2021-07-19 21:20:17
https://stackoverflow.com/q/36112517
https://stackoverflow.com/a/36112625
<p>You will need to have a new branch with the desired commits.</p> <p>You can do it in several ways</p> <hr /> <h3 id="recommended-solution-e7g3">Recommended solution:</h3> <h3 id="git-cherry-pick-ncbl"><em><strong><code>git cherry-pick</code></strong></em></h3> <p>Checkout a new branch to the specific sha-1 you want ...
<p>You will need to have a new branch with the desired commits.</p> <p>You can do it in several ways</p> <hr /> <h3 id="recommended-solution-e7g3">Recommended solution:</h3> <h3 id="git-cherry-pick-ncbl"><em><strong><code>git cherry-pick</code></strong></em></h3> <p>Checkout a new branch to the specific sha-1 you want ...
119, 28898, 53850
git, git-commit, git-push
<h1>Git - exclude specific commit and push</h1> <p>How to exclude specific commit from series of commits. I mean if I have 5 commits, and I only want to push 4 commits. How to do this. Please help to resolve this.</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,792
git
# Git - exclude specific commit and push How to exclude specific commit from series of commits. I mean if I have 5 commits, and I only want to push 4 commits. How to do this. Please help to resolve this.
You will need to have a new branch with the desired commits. You can do it in several ways --- ### Recommended solution: ### ***`git cherry-pick`*** Checkout a new branch to the specific sha-1 you want to start from: ``` git checkout <origin branch> git checkout -b <new branch> # now cherry-pick the desired comm...
22242604
Find first existence of a line of code in Git
15
2014-03-07 05:53:43
<p>I am trying to trace a piece of code (just a single line) to it's commit.</p> <p>Using blame only points me to a commit where this line in question was moved as a part of an extract method style refactoring.</p> <p>What techniques can I use to get to the commit were that particular text existed in the codebase for...
5,686
410,357
2014-08-13 11:15:54
22,247,669
19
2014-03-07 10:33:54
null
2014-03-07 10:33:54
https://stackoverflow.com/q/22242604
https://stackoverflow.com/a/22247669
<p>As noted in <a href="https://stackoverflow.com/a/5816177/456814">this answer</a> to <a href="https://stackoverflow.com/questions/5816134/git-finding-a-commit-that-introduced-a-string">git: finding a commit that introduced a string</a>, you can simply use</p> <pre><code>git log -S &lt;line&gt; # or git log -G &lt;re...
<p>As noted in <a href="https://stackoverflow.com/a/5816177/456814">this answer</a> to <a href="https://stackoverflow.com/questions/5816134/git-finding-a-commit-that-introduced-a-string">git: finding a commit that introduced a string</a>, you can simply use</p> <pre><code>git log -S &lt;line&gt; # or git log -G &lt;re...
119, 105902
git, git-blame
<h1>Find first existence of a line of code in Git</h1> <p>I am trying to trace a piece of code (just a single line) to it's commit.</p> <p>Using blame only points me to a commit where this line in question was moved as a part of an extract method style refactoring.</p> <p>What techniques can I use to get to the commi...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,793
git
# Find first existence of a line of code in Git I am trying to trace a piece of code (just a single line) to it's commit. Using blame only points me to a commit where this line in question was moved as a part of an extract method style refactoring. What techniques can I use to get to the commit were that particular ...
As noted in [this answer](https://stackoverflow.com/a/5816177/456814) to [git: finding a commit that introduced a string](https://stackoverflow.com/questions/5816134/git-finding-a-commit-that-introduced-a-string), you can simply use ``` git log -S <line> # or git log -G <regex> ``` to find the first occurrence of a l...
16821151
What characters can I use in a Git alias?
15
2013-05-29 18:19:15
<p>What characters can I use in a Git alias? For example can "my.branch" or "@mine" be aliases? </p> <p>Is there a way to make the aliases case sensitive? ex: my<b>B</b>ranch</p> <p>The <a href="https://git.wiki.kernel.org/index.php/Aliases">alias documentaion</a> does not list acceptable characters or anything about...
1,964
444,639
2021-03-22 17:35:18
16,821,201
19
2013-05-29 18:22:20
46,194
2013-05-30 04:54:59
https://stackoverflow.com/q/16821151
https://stackoverflow.com/a/16821201
<p>From the <a href="http://git-scm.com/docs/git-config" rel="noreferrer">git-config man page</a></p> <blockquote> <p>The variable names are case-insensitive, allow only alphanumeric characters and -, and must start with an alphabetic character</p> </blockquote> <p>Git aliases are variables in the git config options (e...
<p>From the <a href="http://git-scm.com/docs/git-config" rel="noreferrer">git-config man page</a></p> <blockquote> <p>The variable names are case-insensitive, allow only alphanumeric characters and -, and must start with an alphabetic character</p> </blockquote> <p>Git aliases are variables in the git config options (e...
119, 1448
alias, git
<h1>What characters can I use in a Git alias?</h1> <p>What characters can I use in a Git alias? For example can "my.branch" or "@mine" be aliases? </p> <p>Is there a way to make the aliases case sensitive? ex: my<b>B</b>ranch</p> <p>The <a href="https://git.wiki.kernel.org/index.php/Aliases">alias documentaion</a> do...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,794
git
# What characters can I use in a Git alias? What characters can I use in a Git alias? For example can "my.branch" or "@mine" be aliases? Is there a way to make the aliases case sensitive? ex: my**B**ranch The [alias documentaion](https://git.wiki.kernel.org/index.php/Aliases) does not list acceptable characters or a...
From the [git-config man page](http://git-scm.com/docs/git-config) > The variable names are case-insensitive, allow only alphanumeric > characters and -, and must start with an alphabetic character Git aliases are variables in the git config options (e.g. in the `.gitconfig` file). So, git aliases are case-insensiti...
36781508
Still getting 413 Request Entity Too Large even after client_max_body_size 100M
14
2016-04-21 22:26:34
<p>I'm using Rails and Nginx on Digital ocean and I've been trying to upload a 17.6 MB file and I'm still getting <code>413 Request Entity Too Large</code> even after setting <code>client_max_body_size 100M</code> in my /etc/nginx/nginx.conf file.</p> <p>Here's the snippet from the file:</p> <pre><code>http { ## ...
14,927
3,161,192
2017-03-09 12:43:32
36,801,699
19
2016-04-22 19:16:04
3,161,192
2016-04-22 19:16:04
https://stackoverflow.com/q/36781508
https://stackoverflow.com/a/36801699
<p>Okay. I figured this out. Following the Digital Ocean guide for <a href="https://www.digitalocean.com/community/tutorials/how-to-configure-the-nginx-web-server-on-a-virtual-private-server" rel="noreferrer">how to configure nginx</a>, I was setting <code>client_max_body_size 100M</code> in the file <code>/etc/nginx/n...
<p>Okay. I figured this out. Following the Digital Ocean guide for <a href="https://www.digitalocean.com/community/tutorials/how-to-configure-the-nginx-web-server-on-a-virtual-private-server" rel="noreferrer">how to configure nginx</a>, I was setting <code>client_max_body_size 100M</code> in the file <code>/etc/nginx/n...
4984, 6605, 97102
digital-ocean, nginx, ruby-on-rails
<h1>Still getting 413 Request Entity Too Large even after client_max_body_size 100M</h1> <p>I'm using Rails and Nginx on Digital ocean and I've been trying to upload a 17.6 MB file and I'm still getting <code>413 Request Entity Too Large</code> even after setting <code>client_max_body_size 100M</code> in my /etc/nginx/...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,800
git
# Still getting 413 Request Entity Too Large even after client_max_body_size 100M I'm using Rails and Nginx on Digital ocean and I've been trying to upload a 17.6 MB file and I'm still getting `413 Request Entity Too Large` even after setting `client_max_body_size 100M` in my /etc/nginx/nginx.conf file. Here's the sn...
Okay. I figured this out. Following the Digital Ocean guide for [how to configure nginx](https://www.digitalocean.com/community/tutorials/how-to-configure-the-nginx-web-server-on-a-virtual-private-server), I was setting `client_max_body_size 100M` in the file `/etc/nginx/nginx.conf`. And for sure, changing things there...
25280199
How to upgrade Git in Babun
14
2014-08-13 07:14:08
<p>I have just installed:</p> <p><a href="https://github.com/babun/babun">https://github.com/babun/babun</a> </p> <p>in windows 8 but how do I upgrade Git to latest version?</p> <p>It comes with </p> <p>{ ~ } » git --version ...
8,325
363,603
2019-06-28 14:15:36
32,815,841
19
2015-09-28 04:45:38
1,332,828
2015-09-28 04:45:38
https://stackoverflow.com/q/25280199
https://stackoverflow.com/a/32815841
<p><code>pact update git</code></p> <p>Updated to the latest version of Git, 2.5.3, just now.</p>
<p><code>pact update git</code></p> <p>Updated to the latest version of Git, 2.5.3, just now.</p>
64, 119, 118563
babun, git, windows
<h1>How to upgrade Git in Babun</h1> <p>I have just installed:</p> <p><a href="https://github.com/babun/babun">https://github.com/babun/babun</a> </p> <p>in windows 8 but how do I upgrade Git to latest version?</p> <p>It comes with </p> <p>{ ~ } » git --version ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,801
git
# How to upgrade Git in Babun I have just installed: <https://github.com/babun/babun> in windows 8 but how do I upgrade Git to latest version? It comes with { ~ } » git --version ~ git version 1.7.9 I did try: ``` pact install git-2.0.4.tar ``` Where git-2.0.4.tar is located in the current directory. I also tr...
`pact update git` Updated to the latest version of Git, 2.5.3, just now.
26347516
Using "go get" on a personal git repo
14
2014-10-13 19:31:54
<p>I host my git repositories on a personal VPS and I have one package that I want to make "go get"-able. I have tried to set everything up per the help document found by issuing "go help importpath" with no luck. No matter what I do I get the following error:</p> <pre><code>package example.com/user/package: unrecogni...
5,990
3,210
2016-11-24 23:29:33
26,348,986
19
2014-10-13 21:15:04
1,239,701
2014-10-13 21:25:06
https://stackoverflow.com/q/26347516
https://stackoverflow.com/a/26348986
<p>This is the meta tag I've configured nginx to return for a gitlab server: if you request <code>http://mygit.server/group/project?go-get=1</code></p> <p>you get:</p> <pre><code>&lt;meta content='mygit.server/group/project git git+ssh://git@mygit.server/group/project.git' name='go-import'&gt; </code></pre> <p>And ...
<p>This is the meta tag I've configured nginx to return for a gitlab server: if you request <code>http://mygit.server/group/project?go-get=1</code></p> <p>you get:</p> <pre><code>&lt;meta content='mygit.server/group/project git git+ssh://git@mygit.server/group/project.git' name='go-import'&gt; </code></pre> <p>And ...
119, 15627
git, go
<h1>Using "go get" on a personal git repo</h1> <p>I host my git repositories on a personal VPS and I have one package that I want to make "go get"-able. I have tried to set everything up per the help document found by issuing "go help importpath" with no luck. No matter what I do I get the following error:</p> <pre><c...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,802
git
# Using "go get" on a personal git repo I host my git repositories on a personal VPS and I have one package that I want to make "go get"-able. I have tried to set everything up per the help document found by issuing "go help importpath" with no luck. No matter what I do I get the following error: ``` package example....
This is the meta tag I've configured nginx to return for a gitlab server: if you request `http://mygit.server/group/project?go-get=1` you get: ``` <meta content='mygit.server/group/project git git+ssh://git@mygit.server/group/project.git' name='go-import'> ``` And it works like a charm. Here is the nginx rewrite ru...
26176951
git create patch from unpushed commits
14
2014-10-03 10:02:25
<p>I cannot push when working remotely, so I want to create a single patch from all the commits that have not yet been pushed on my develop branch to email it. How do I do that?</p>
6,533
158,742
2014-10-03 12:24:56
26,178,271
19
2014-10-03 11:37:58
1,207,791
2014-10-03 11:47:55
https://stackoverflow.com/q/26176951
https://stackoverflow.com/a/26178271
<p><code>git format-patch &lt;commit-ish&gt;</code> creates a patch file for every commit you made since the specified commit.</p> <p>So, to export all your unpushed commits, simply put</p> <pre><code>git format-patch origin/master -o patches/ </code></pre> <p>and all of them will be output into the <code>patches/</...
<p><code>git format-patch &lt;commit-ish&gt;</code> creates a patch file for every commit you made since the specified commit.</p> <p>So, to export all your unpushed commits, simply put</p> <pre><code>git format-patch origin/master -o patches/ </code></pre> <p>and all of them will be output into the <code>patches/</...
119, 2132
git, patch
<h1>git create patch from unpushed commits</h1> <p>I cannot push when working remotely, so I want to create a single patch from all the commits that have not yet been pushed on my develop branch to email it. How do I do that?</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,803
git
# git create patch from unpushed commits I cannot push when working remotely, so I want to create a single patch from all the commits that have not yet been pushed on my develop branch to email it. How do I do that?
`git format-patch <commit-ish>` creates a patch file for every commit you made since the specified commit. So, to export all your unpushed commits, simply put ``` git format-patch origin/master -o patches/ ``` and all of them will be output into the `patches/` directory. If you want to have a **single file**, add `...
17214368
What is the syntax of git's repository root path?
14
2013-06-20 13:02:30
<p>When using <code>git add -u</code> I can provide a path as the last argument, e.g. <code>git add -u .</code>. How does one give the repositories root path?</p> <p>I would like to use this to quickly add all changes to tracked files to the index, including changes to files further up the directory tree.</p> <p><str...
4,854
1,671,066
2017-03-29 08:58:34
17,214,622
19
2013-06-20 13:14:11
946,850
2013-06-20 15:51:26
https://stackoverflow.com/q/17214368
https://stackoverflow.com/a/17214622
<p>The colon <code>:</code> helps here, you can refer to the root of the repository by <code>:/</code>:</p> <pre><code>git init test cd test mkdir a touch a/a git add a git commit -m a # Here comes the interesting part: cd a touch ../root git add :/ git commit -m root </code></pre> <p>The script above initializes a toy...
<p>The colon <code>:</code> helps here, you can refer to the root of the repository by <code>:/</code>:</p> <pre><code>git init test cd test mkdir a touch a/a git add a git commit -m a # Here comes the interesting part: cd a touch ../root git add :/ git commit -m root </code></pre> <p>The script above initializes a toy...
119
git
<h1>What is the syntax of git's repository root path?</h1> <p>When using <code>git add -u</code> I can provide a path as the last argument, e.g. <code>git add -u .</code>. How does one give the repositories root path?</p> <p>I would like to use this to quickly add all changes to tracked files to the index, including c...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,806
git
# What is the syntax of git's repository root path? When using `git add -u` I can provide a path as the last argument, e.g. `git add -u .`. How does one give the repositories root path? I would like to use this to quickly add all changes to tracked files to the index, including changes to files further up the directo...
The colon `:` helps here, you can refer to the root of the repository by `:/`: ``` git init test cd test mkdir a touch a/a git add a git commit -m a # Here comes the interesting part: cd a touch ../root git add :/ git commit -m root ``` The script above initializes a toy repository that contains one single file `a` i...
10821825
How to set GIT_DIR & GIT_WORK_TREE when maintaining multiple repositories
14
2012-05-30 18:07:17
<p>Much like <a href="https://stackoverflow.com/questions/6635018/reuse-git-work-tree-in-post-receive-hook-to-rm-a-few-files">this SO post</a>, I have the following workflow that i would like to maintain with git:</p> <ol> <li>Multiple people develop locally </li> <li>Commit a few things </li> <li>Commit more things <...
31,814
263,900
2016-04-03 19:08:06
10,824,664
19
2012-05-30 21:41:39
1,407,067
2016-04-03 19:08:06
https://stackoverflow.com/q/10821825
https://stackoverflow.com/a/10824664
<p>If I understand correctly, you've got a different repository for each web root. If that's the case, you can set the work tree at the repository level (in the <code>.git/config</code> file): <code>core.worktree</code>. It won't work if the repo is configured as <code>bare</code>:</p> <pre><code>[core] bare = fal...
<p>If I understand correctly, you've got a different repository for each web root. If that's the case, you can set the work tree at the repository level (in the <code>.git/config</code> file): <code>core.worktree</code>. It won't work if the repo is configured as <code>bare</code>:</p> <pre><code>[core] bare = fal...
119, 7330
git, repository
<h1>How to set GIT_DIR & GIT_WORK_TREE when maintaining multiple repositories</h1> <p>Much like <a href="https://stackoverflow.com/questions/6635018/reuse-git-work-tree-in-post-receive-hook-to-rm-a-few-files">this SO post</a>, I have the following workflow that i would like to maintain with git:</p> <ol> <li>Multiple ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,808
git
# How to set GIT_DIR & GIT_WORK_TREE when maintaining multiple repositories Much like [this SO post](https://stackoverflow.com/questions/6635018/reuse-git-work-tree-in-post-receive-hook-to-rm-a-few-files), I have the following workflow that i would like to maintain with git: 1. Multiple people develop locally 2. Comm...
If I understand correctly, you've got a different repository for each web root. If that's the case, you can set the work tree at the repository level (in the `.git/config` file): `core.worktree`. It won't work if the repo is configured as `bare`: ``` [core] bare = false worktree = /webroot/dir/for/this/repo ``...
9413487
automated code formatting git
14
2012-02-23 12:54:16
<p>I'm working on a project(PHP) and on every commit there are some breaks on code convention. I'm using git for version control. Is there a way for automated code formatting so that all the code stays clean?</p>
10,925
450,598
2012-02-23 14:27:23
9,414,113
19
2012-02-23 13:35:12
761,202
2012-02-23 14:06:26
https://stackoverflow.com/q/9413487
https://stackoverflow.com/a/9414113
<p>There are two parts to the question: automatically formatting the code, and detecting when it doesn't conform to your coding standards.</p> <p><strong>Automatically formatting</strong> the code is not really something you want to put inbetween you and your repo directly. Modifying files, or attempting to modify fil...
<p>There are two parts to the question: automatically formatting the code, and detecting when it doesn't conform to your coding standards.</p> <p><strong>Automatically formatting</strong> the code is not really something you want to put inbetween you and your repo directly. Modifying files, or attempting to modify fil...
5, 119, 4162
code-formatting, git, php
<h1>automated code formatting git</h1> <p>I'm working on a project(PHP) and on every commit there are some breaks on code convention. I'm using git for version control. Is there a way for automated code formatting so that all the code stays clean?</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,809
git
# automated code formatting git I'm working on a project(PHP) and on every commit there are some breaks on code convention. I'm using git for version control. Is there a way for automated code formatting so that all the code stays clean?
There are two parts to the question: automatically formatting the code, and detecting when it doesn't conform to your coding standards. **Automatically formatting** the code is not really something you want to put inbetween you and your repo directly. Modifying files, or attempting to modify files, in a `pre-commit` h...
4126442
Recommended format for Git commit messages
14
2010-11-08 17:45:43
<p>What is the recommended format for Git commit messages, if there is any?</p>
11,879
220,918
2023-05-16 10:35:27
4,126,676
19
2010-11-08 18:14:28
247,563
2010-11-08 18:19:45
https://stackoverflow.com/q/4126442
https://stackoverflow.com/a/4126676
<p>It varies, of course, but a very common format is something like this (taken from <a href="http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html" rel="noreferrer">http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html</a>, that I think sums it up really well):</p> <pre><code>Short (50 c...
<p>It varies, of course, but a very common format is something like this (taken from <a href="http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html" rel="noreferrer">http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html</a>, that I think sums it up really well):</p> <pre><code>Short (50 c...
119, 456, 555, 5494
conventions, formatting, git, version-control
<h1>Recommended format for Git commit messages</h1> <p>What is the recommended format for Git commit messages, if there is any?</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%git%'; a.Body LIKE '%<code>%git%'; q.Score > 5; a.Score > 10
20,811
git
# Recommended format for Git commit messages What is the recommended format for Git commit messages, if there is any?
It varies, of course, but a very common format is something like this (taken from <http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html>, that I think sums it up really well): ``` Short (50 chars or less) summary of changes More detailed explanatory text, if necessary. Wrap it to about 72 characters ...