I have started to work with project, which I cloned from bitbucket.
I use as Git Bash, as SourceTree.
I changed one file and try to commit my change.
I can execute the command "add", but when I try to execute the command "commit" (git commit -m "for testing"), I get the following error:
Segmentation fault.
I got an error in SourceTree too.
But if I create my new folder & file, the commit happens successfully
How I can fix the problem situation?
Thanks in advance.
Running git 2.15.1.windows.2 on Windows 10 x64 v1709
For me the problem was caused by a faulty index. To resolve I ran the following from the project directory:
rm .git/index
git reset
As you can see from the image in this link, I didn't loose any changes by performing a reset.
If you already have Git installed, you can get the latest development version via Git itself:
git clone https://github.com/git/git
but this didn't work for me.I uninstalled the git and then again downloaded then my problem got resolved.
I have resolved the problem.
The last git version (2.13.1) has the bug - it has been released 05.06.2017.
I installed previous version (2.12.2) and now all is OK.
I had the same issue on some project, I could no checkout a new or an existing branch.
I installed the latest version of git from the website and now my version is
> git --version
git version 2.13.1.windows.2
The issue seems fixed with this build. For now.
use git reset SHA --hard
Where SHA points to a valid SHA before the error
Changes done after this point is lost. But repo is saved.
For me the problem was caused by a faulty index.
With Git 2.36 (Q2 2022), you will see more details instead of a segfault.
Git now check the return value from parse_tree_indirect() to turn segfaults into calls to die().
For clone/checkout, but can also be applied to commit.
See commit 8d2eaf6 (01 Mar 2022) by Glen Choo (chooglen).
(Merged by Junio C Hamano -- gitster -- in commit bde1e3e, 13 Mar 2022)
checkout, clone: die if tree cannot be parsed
Signed-off-by: Glen Choo
When a tree oid is invalid, parse_tree_indirect() can return NULL.
Check for NULL instead of proceeding as though it were a valid pointer and segfaulting.
Related
I am not able to undo the commits in git. It shows technical errors while doing so.
I have tried to navigate to the folder for my git repo and expecting to solve the problem at the earliest.
This post has explained undoing commits previously, presuming the issue is sourced in your local repository.
Link: How do I undo the most recent local commits in Git?
command:
git revert HEAD
you can mention the commit ID to revert the commit, if mentioned HEAD it will revert the last commit
I've just updated my Xcode from 6 to 7 (and code from Swift 1.2 to Swift 2.0) and try to create new branch in Xcode. After that I can't push my code to Bitbucket.
Is there a way how can I delete repository from directory and setup Bitbucket again and maybe push to another (a new one) repository? Fix of this problem will be great, but I will be satisfied even with move to another repository.
I had this error in xcode 7.1 on a year old project that was working fine. In my case I have a project with the default local repository created by xcode. For anyone who is not going to re-install and re-setup. It is possible to find out what the dangling command is and fix it from command line.
To find the dangling command Open Terminal from the project directory:
xcrun git status
In my case the status returned:
On branch master
You are currently rebasing.
(all conflicts fixed: run "git rebase --continue")
To fix the problem I used:
xcrun git rebase --skip
In my case I ran git status which revealed that You are currently bisecting. (I was doing a bisect and must had forgotten to reset). I did a git bisect reset and attached the head to my latest commit and it was all fine afterwards.
When I am merging from currentBranchA into branchB, I got conflicts,I didn't want to solve the conflicts immediately and quit the merging process. But when I try to merge again, the Xcode shows "The working copy is currently in the middle of another operation..."
I opened the terminal ,cd to the project directory, and check the git status:
git status
it shows:
On branch currentBranchA
Your branch is up to date with 'origin/currentBranchA'.
All conflicts fixed but you are still merging.
(use "git commit" to conclude merge)
Just do it as it says. Continue to input
git commit and click Ctrl + C to close the commit message window.
The problem will be zero.
The problem was with installation of GitHub. I had a master repository. After reinstall and resetup everything works like before.
EDIT: For anyone who has a problem with Xcode and GIT I have a best advice. Don't use it. Use for example Source Tree
When you start developing for a living, you are gonna have to use more reliable solution for GIT. Imagine you have 70 branches. Using Source Tree you can easily solve conflicts and other things about working in team. Xcode GIT solution is not reliable and you are gonna be only frustrated.
After pulling from main master, encountering a conflict and resolving conflict.
I'm working in a sub-folder of the main project repo (on automated tests) and so generally don't have to worry about conflicts. It seems however that every time a conflict is encountered and fixed, where I attempt to commit the pulled files RubyMine gives me this error message and won't allow anything to be done to resolve. I've previously taken a new fork from the GitHub main and manually merged in my own lost commits but it's happened again.
I can't find any reference to this dialog on searching the web and our TA has investigated the issue, concluding that it may be a RubyMine bug. I'm continuing my search for relevant info but aside from poring through the bugs in http://youtrack.jetbrains.com/issues/RUBY (which I have now done with no relevant issues found) I can't see where any leads might come from.
Latest version of RM (6.0.3) running on Macbook Pro (Mavericks)
RubyMine was used to resolve the conflicts; git status shows only the pulled files I'm now trying to commit as tracked and uncommitted - I have untracked files managed in a gitignore file
The dialog says:
Commit
Commit failed with errors
With error message displayed in terminal:
Error: Error executing git commit --only -F
[list of files I attempted to commit]
Try like this
Goto Tools -> Open terminal
Use this command
git status
Then add untracked files
git add .
Commit changes like this
git commit -i * -m "commit message"
If you still have errors please post the error. You can see the Version control logs at the bottom of rubymine
Are you using Rubymine to resolve the conflicts? If not, it's possible RubyMine has kept stale state of the filesystem and is reporting the errors because of this.
What does git status . tell you in your working directory? Is your current tree clean, or do you have unmerged changes?
Sometimes a git checkout command gives progress feedback:
$ git checkout develop
Checking out files: 100% (10779/10779), done.
Switched to branch 'develop'
Sometimes it doesn't, (very next command line, same repo context):
$ git checkout master
Switched to branch 'master'
It's not because the branches are equal, because switching back on the very next command shows this feedback:
$ git checkout develop
Checking out files: 47% (5067/10779), done.
Switched to branch 'develop'
This happens for small repos also. I have a repo with just 13 files in it and when I add a file in a branch and use checkout to switch back and forth, I get no feedback either way. Is it some kind of "this is taking a long time, start showing feedback" timer?
I searched (Google, Stackoverflow) but didn't find anything specific. I did find some patch documentation that shows the addition of a --verbose flag to checkout that forces feedback to always happen, but I couldn't find an explanation for why feedback only happens sometimes without that patch. The same notes pointed out that feedback only happens if isatty() returns true, but that's not relevant here, since all of the commands above were typed into the same bash window, which presumably isatty.
I'm using git version 1.8.1.msysgit.1 (downloaded from git-scm.com as 1.8.1.3), which does not have the --verbose patch as far as I can tell.
This checkout output should now be more consistent with Git 2.7 (Nov./Dec. 2015)
See commit 870ebdb (01 Nov 2015) by Edmundo Carmona Antoranz (eantoranz).
(Merged by Junio C Hamano -- gitster -- in commit 6a38bd6, 05 Nov 2015)
"git checkout" did not follow the usual "--[no-]progress" convention and implemented only "--quiet" that is essentially a superset of "--no-progress".
Extend the command to support the usual "--[no-]progress".
The git checkout doc now shows:
--[no-]progress::
Progress status is reported on the standard error stream by default when it is attached to a terminal, unless --quiet is specified.
This flag enables progress reporting even if not attached to a terminal, regardless of --quiet.
checkout: add --progress option
Under normal circumstances, and like other git commands, git checkout will write progress info to stderr if attached to a terminal.
This option allows progress to be forced even if not using a terminal.
Also, progress can be skipped if using option --no-progress.
Under normal conditions, you will see output when checking out if the operation's been running for more than one second.
Given a (source) patch file, what's the easiest way to apply this patch on the source files under Windows?
A GUI tool where I can visually compare the unchanged-changed source lines would be great.
A good way to apply a patch file under Windows OS is using Git.
As I understood, Git is a version control solution like SVN.
Here is a guideline to apply a patch :
First of all, download the latest release of the Windows Git Edition here :
GIT
With the cmd prompt, change directory to the patch file and files to patch
Now you can use the following command line :
git apply --ignore-space-change --ignore-whitespace --whitespace=nowarn file.patch
Not that since Git 2.3.3 (March 2015), you can use git apply --unsafe-paths to use git apply outside a git repo.
See commit 5244a31 by Junio C Hamano (gitster)
"git apply" was not very careful about reading from, removing, updating and creating paths outside the working tree (under --index/--cached) or the current directory (when used as a replacement for GNU patch).
The documentation now includes:
--unsafe-paths:
By default, a patch that affects outside the working area (either a Git controlled working tree, or the current working directory when "git apply" is used as a replacement of GNU patch) is rejected as a mistake (or a mischief).
When git apply is used as a "better GNU patch", the user can pass the --unsafe-paths option to override this safety check.
This option has no effect when --index or --cached is in use.
So if you have git installed, git apply could help, even outside of any git repo.
Patch for Windows is what you're looking for.
WinMerge is awesome.
http://winmerge.org/