GitHub for Mac crashes on open because of local repository issue - macos

I am trying to figure out why my GitHub for Mac crashes on start when I choose a local repository. I added this local repository from a folder I had cloned. Unfortunately, I was playing around with the git command line and I must have done something to corrupt the local repository.
Now my GitHub for Mac is trying to access this corrupted repository on reopen and I can't change it within the program before it crashes. I would rather not purge the system of files because I have other repositories saved in GitHub for Mac.
How exactly would I be able to solve this issue or delete the reference to this local repository that is causing me massive issues? I have attempted to get an answer from the people at GitHub but they have not responded to me yet. Thank you. The error I am getting is below.
*** Terminating app due to uncaught exception
NSInternalInconsistencyException', reason: 'Received error from <RACDynamicSignal: 0x600000e3dca0> name: in binding for key path` "headerContentViewModel" on <GHChangesViewModel: 0x600000129420>:
NSError { domain: GTGitErrorDomain, code: -12, description: "Failed to create reference to tracking branch from <GTBranch: 0x600000e20c00> name: refs/heads/master, shortName: master, sha:
b5db93cacaf51cde5ad27c605c4bdb114cd23605, remoteName: (null), repository: <GTRepository: 0x60000041b4e0> fileURL: file:///Users/name/Desktop/personalWebsite/", underlying error: NSError { domain:
GTGitErrorDomain, code: -12, description: "'https://github.com/name/git.git' is not a valid remote name." } }'
terminating with uncaught exception of type NSExceptionabort() called

I had this same problem, the source turned out to be an incorrect line in my .git/config file.
The master branch had these lines:
[branch "master"]
remote = git#github.com:/.git
which matched most of the url value for the [remote "origin"] line.
Changing the line to this:
remote = origin
Fixed the problem immediately, and no more "Unable to create tracking branch" errors like I've had for quite some time.
Be sure to make a copy of that line in case it doesn't work.
GitHub support verified that this was the correct solution - at least in my case.

It looks like you've changed the config file, specifically for the repo location. If you're not able to repair the git config file yourself, can you do cat ./.git/config for us?

Related

golang import github private repo

Completely confused.
go 1.13.5 using modules
I am trying to import a private repo from github. Searching is increasing the confusion not reducing it. I have tried a number of approaches including the keychain helper but I am going nowhere fast.
SSH is enabled and when tested establishes a connection successfully
My global gitconfig in C:/Users/me :
[user]
name = xxxxxxx
email = xxx.xxx#me.com
[core]
autocrlf = input
[alias]
st = status
[url "ssh://git#github.com/"]
insteadOf = https://github.com/
go get github.com/user/repo#master produces
go: finding github.com master
go: finding github.com/user master
go: finding github.com/user/repo master
go: finding github.com/user/repo master
go: downloading github.com/user/repo v0.0.0-20191211180807-ee1bcd94c84f
verifying github.com/user/repo#v0.0.0-20191211180807-ee1bcd94c84f:
github.com/user/repo#v0.0.0-20191211180807-ee1bcd94c84f: reading
https://sum.golang.org/lookup/github.com/!user/repo#v0.0.0-20191211180807-
ee1bcd94c84f:410 Gone
The link yields :
not found: github.com/user/repo#v0.0.0-20191211180807-ee1bcd94c84f: invalid version: git
fetch -f origin refs/heads/*:refs/heads/* refs/tags/*:refs/tags/* in/tmp/gopath/pkg/mod/cache/vcs/9524fc42cfd4910346f55f112665f9a51df7c4b31085d50baa5e01453e55ca58:
exit status 128:
fatal: could not read Username for 'https://github.com': terminal prompts disabled
Doesn't matter what I do I get this "cannot read Username" but I thought it should be using SSH not HTTPS
What's going on??
Not feeling the love for Modules making my life easier so far...
After more searching and much experimentation, the issue is with the checksum failing on download of a private repo as by definition there is no checksum defined.
This was buried within a chain of responses on Github. There is an open issue to improve the documentation. Good idea.
This worked for me:
GONOSUMDB=github.com/username/*
go get github.com/username/repo

Github App for Mac crashes upon opening

Downloaded the Github for Mac app and it crashes instantly upon opening. Here is the error report:
Application Specific Information:
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Received error from name: in binding for key path "currentActionViewModel" on : NSError { domain: GTGitErrorDomain, code: -12, description: "Failed to create reference to tracking branch from name: refs/heads/master, shortName: master, sha: { SHA: da048479dec26b5e59ccd594bc32a4c7c8e93dc5 }, remoteName: (null), repository: fileURL: file:///Users/johnfarmer/.Trash/first_app/", underlying error: NSError { domain: GTGitErrorDomain, code: -12, description: "'https://github.com/johnfarmernyc/first_app.git' is not a valid remote name." } }'
terminating with uncaught exception of type NSException
abort() called
This is a problem with the repository configuration. You will have to diagnose it yourself.
I don't use Github for Mac I use Git from the command line.
Open up the Terminal.app and cd <the path of the first_app folder> then do a git fetch origin and see if that reviles anything works. You can also edit the first_app/.git/config file and remove references to tracking branches in hopes Github for Mac recovers again.
You can also attempt to delete the first_app repo and then use Github for Mac to re clone it again.
As a side note, You might be better off not using Github for Mac and just use Git out of the box (on the command line) it takes a little bit more of a learning curve but worth it, and there is a much larger Git community then there is a Github for Mac community.
I had the same problem, and changing my .git/config file for the master branch from:
[branch "master"]
remote = git#github.com:/.git
to:
[branch "master"]
remote = origin
Fixed the problem. GitHub support confirmed this is the correct solution.

Git pull error: unable to create file (Invalid argument)

I am trying to sync remote repo with local repo but getting following errors. Some files (which have not extention) are not getting sync with local repo on WINDOWS machine, but I could sync successfully on MAC machine.
Is there any configuration settings in WINDOWS to handle such case?
Using TortoiseGit
Windows 7 64 bit machine
ERROR DETAILS
git.exe clone --progress -v "https://github.com/xxxx/xxxxx.git" "C:\Data\GitHub\simility\vishesh-common"
Cloning into 'C:\Data\GitHub\simility\vishesh-common'...
POST git-upload-pack (200 bytes)
remote: Counting objects: 3912, done.
remote: Compressing objects: 100% (487/487), done.
Receiving objects: 100% (3912/3912), 2.70 MiB | 567.00 KiB/s, done.
Resolving deltas: 100% (1578/1578), done.
remote: Total 3912 (delta 409), reused 0 (delta 0)
Checking connectivity... error: unable to create file kickstarter/parsers/data/kickstarter/campaigndetails/_projects_1030050305_fantasy-trilogy-spin?ref=users (Invalid argument)
error: unable to create file kickstarter/parsers/data/kickstarter/campaigndetails/_projects_1030295038_laser-dogs?ref=users (Invalid argument)
error: unable to create file kickstarter/parsers/data/kickstarter/campaigndetails/_projects_1030315317_arizona-native-bird-painting-series?ref=users (Invalid argument)
error: unable to create file kickstarter/parsers/data/kickstarter/campaigndetails/_projects_1030315317_native-birds-ii?ref=users (Invalid argument)
error: unable to create file kickstarter/parsers/data/kickstarter/campaigndetails/_projects_1030552097_ikeyboard-0?ref=users (Invalid argument)
error: unable to create file kickstarter/parsers/data/kickstarter/campaigndetails/_projects_1030552097_ikeyboard?ref=users (Invalid argument)
error: unable to create file kickstarter/parsers/data/kickstarter/campaigndetails/_projects_1030552097_only-you-can-prevent-computercide?ref=users (Invalid argument)
error: unable to create file kickstarter/parsers/data/kickstarter/campaigndetails/_projects_1030552097_vector-cupholder-protect-your-laptop-and-your-lap?ref=users (Invalid argument)
error: unable to create file kickstarter/parsers/data/kickstarter/campaigndetails/_projects_103055429_death-of-an-angel?ref=users (Invalid argument)
error: unable to create file kickstarter/parsers/data/kickstarter/campaigndetails/_projects_1030650665_rachel-vanslyke-making-a-new-record-together-we-ca?ref=users (Invalid argument)
error: unable to create file kickstarter/parsers/data/kickstarter/campaigndetails/_projects_1030835091_russian-trucks-of-world-war-two?ref=users (Invalid argument)
error: unable to create file kickstarter/parsers/data/kickstarter/campaigndetails/_projects_1031873800_prop-expansion-next-level?ref=users (Invalid argument)
error: unable to create file kickstarter/parsers/data/kickstarter/campaigndetails/_projects_1031873800_prop-project-expansion?ref=users (Invalid argument)
error: unable to create file kickstarter/parsers/data/kickstarter/campaigndetails/_projects_1099860912_yaw-clock?ref=users (Invalid argument)
error: unable to create file kickstarter/parsers/data/kickstarter/campaigndetails/_projects_1099992656_heavenly-sight-a-vision-out-of-blindness?ref=users (Invalid argument)
fatal: unable to checkout working tree
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status' and retry the checkout with 'git checkout -f HEAD'
git did not exit cleanly (exit code 128) (21746 ms # 29-09-2014 13:32:13)
I ran into the same problem, but wasn't willing to rename or delete these files. So here's a workaround in case you can live without accessing those files using a sparse-checkout:
Go to the .git folder in your repo and open the file config. (You can also edit your configuration using tortoise-git, but I havn't got it installed here.) In the [core]section add the line
sparsecheckout = true
then go to the folder .git/info and create the file sparse-checkout. Add something like
*
!kickstarter/parsers/data/kickstarter/campaigndetails/*
The first line includes everything, while the second excludes all files in kickstarter/parsers/data/kickstarter/campaigndetails/. You should now be able to checkout the repo. Using wild-cards you can probably do more sophisticated excludes.
If I read that log well, those files have names that end with "?ref=users"
Windows does not allow you to have a '?' in a filename, just like it does not allow to have a "\" or "*". Under Linux it is possible, if you escape those characters. On Windows, I think it's not possible at all. See http://msdn.microsoft.com/en-us/library/windows/desktop/aa365247
You will have a hard time with such names.. I actually can't come up with any idea that would allow you to sync that 1:1. You certainly can fetch them and save them under some safe names like _projects_1099992656_heavenly-sight-a-vision-out-of-blindness__ref=users but I don't know how to do that automatically, or how to later inform Git about that mapping, sorry..
These filenames look like they have a HTML-query-parameters suffixed to them. Is it really required? maybe that's just some artifact that could be removed? try talking to the mantainers of the project, maybe they will be able to simply remove that odd suffix?
I'm using bitbucket and it has function that you can delete a problem file.
This is what I do.
Go to your repository.
Choose menu "commit".
Select your branch that you want to remove problem file.
Go to your file and click it. You will reach the file overview that show the detail of the file e.g. your code, date time of this file committed, etc.
Look at upper right corner, you will see the button with arrow down image (similar to alphabet v) click it.
It will dropdown and show you rename button and delete button inside it.
Then it's your choice, will rename it or delete it. Choose wisely.
After you click a button. Bitbucket will show you a dialog box do as it said and commit your file with commit button.
After commit you can return to sourcetree and pull your code with no problem.
Enjoy!
For me, this error occured when I was working on Windows machine. And git repo was cloned inside One-Drive. Altimately, after changing git location to outside One-Drive worked for me. Somehow, One-Drive couldn't update the file index I was trying to commit. Either you can try outside of One-Drive location or try resetting to previous commit and then update.
In general if you get this git "invalid argument" error on Windows, try making sure your /.git/ folder is not set to "read only". This fixed it for me.
I ran into this and tried a few of the solutions above with no success.
What I did is weird but worked for me, I:
Copied all my changes for the 1 file I had issues to notepad
Reverted changes in GIT
Copied the text from notepad with my updated code
Saved the file with the changes again
Used Git Desktop to push the changes
This time it worked.
I did this for 2 different files and it worked for me at least. Easy/quick thing to try before you try the others if you only have a file or 2 causing the issues.
I was also facing "Git: unable to write file, invalid object" and try many ways but nothing has been worked. Alterably I tried simple way i have created new repo folder at my local and take checkout again of the branch and implement changes. then commit and it works.
Please note before doing just take back of the changes or if you are creating new folder for repo then dont delete till your changes committed into folder.
Something similar happened to me locally: I was suddenly unable to do git add -A and got this message:
error: unable to write file .git/objects/99/8fe363fa337daab318f7fc378727d9dcce28d5: Invalid argument
error: [some file].js: failed to insert into database
error: unable to index file '[some file].js'
fatal: adding files failed
I removed the file from the repo (temporarily copied it elsewhere), commited and pushed the repo (without the problematic file) to GitHub. Then, in GitHub, I manually added the file and commited.
At this point, pulling to my local machine failed. I deleted the directory/repo and got a fresh clone from GitHub. It's a weird solution but it seems to work.

How to debug Errno::EIO error in Chef recipe using Chef::Provider::Git

I'm trying to use chef to check out a git repo to a windows client node.
This seems simple enough and I've got the following resource definition:
git "C:\\pathtocheckout" do
repo "https://gitserver/repo.git"
action [ :checkout, :sync]
end
But when this is reached by chef-client I get:
Errno::EIO: git[C:\pathtocheckout] (cookbook_name::test line 21) had an error: Errno::EIO: Input/output error - CreateProcessW
I've had a look at the stacktrace produced and it appears to be something to do with creating a process to run the git command - but this is the limit of my knowledge.
I've made sure git is installed on on Path, removed all other recipes from the run list, running as a different admin user and I've tried different repositories but all with the same error.
So I'm pretty stumped - anyone got a way I can dig into this error and see what is going on?

Mercurial - block access to a branch using ACL extension on Windows

I am trying to deny everyone commit access to a branch using ACL on Windows but can't quite seem to figure it out. According to the little documentation I've found this should work.
My hgrc file:
[extensions]
hgext.acl=
[hooks]
pretxncommit.acl = python:hgext.acl.hook
[acl]
sources = commit
[acl.deny.branches]
default = *
Shouldn't this deny everyone commit access to the default branch? I tried and now every commit, no matter the branch give:
error: pretxncommit.acl hook failed: config error - hook type "pretxncommit" can
not stop incoming changesets
transaction abort!
rollback completed
abort: config error - hook type "pretxncommit" cannot stop incoming changesets
Leads me to think I configured it wrong, but it's pretty much exactly how they do it in the AclExtension documentation.
Here's the relevant code from acl.py:
if hooktype not in ['pretxnchangegroup', 'pretxncommit']:
raise util.Abort(_('config error - hook type "%s" cannot stop '
'incoming changesets nor commits') % hooktype)
Which I would think checks after the ".acl" from your hook name is removed, but perhaps in your version of mercurial (what version?) it isn't?
Try changing your [hooks] section to just this:
[hooks]
pretxncommit = python:hgext.acl.hook
the .acl is only necessary when you have multiple hooks of the same type.

Resources