'git status' failed with code 128: fatal: unable to read - ios

I want to use Bitbucket for my iOS project but I am getting error after creating repository. Please find error given below:
'git status' failed with code 128: fatal: unable to read
How can I resolve this?

git status is a local operation, so it should not be impacted by the fact your repository is hosted on Bitbucket.
Try (outside of XCode) a git status to see if the issue persists: simply check the rights associated with those files, are they owned by the right user/group on your machine?
Try also to clone again your Bitbucket repository (to a new empty local folder) and see if you can read it (git status) and import it in XCode.
If the message is "unable to read <sha1>", then the repository might be corrupted, as detailed in:
"Git status does not work : unable to find, unable to read"
"How to fix corrupted Git repository?"
Check this with git fsck --full.

Related

How to fix Bitbucket warning "You appear to have cloned an empty repository"?

I am using the Bitbucket tool in my project, so I created the clone URL and I tried to add my local code into the repository. I am using Terminal for the cloning process. while the process I am getting the error like this "Warning: You appear to have cloned an empty repository.".
I want to clone my project and I have to upload my codes into the repository. if anyone knows how to fix this, could you please help me.
Once you have cloned your (empty) repository, you still need to:
add files in the local folder created by the git clone command.
type
:
git add .
git commit -m "First batch of files"
git push -u origin master
Then your remote BitBucket repository won't be empty anymore.
This happens when you are cloning a freshly created repository with no commits.
As it says, it is just a warning. If it is expected that there is nothing in the repository, you can go ahead and add files and commit and push back.
to push it
git add --all
git commit -m 'your commit message'
git push origin master
If it is not supposed to be empty, contact the person/admin who gave you the link.

Cannot clone Git repository into sourcetree, Login screen keeps appearing

In BitBucket, when I select clone into source tree, the URL is of format
Sourcetree opens with details to clone, but keeps asking for my login details no matter how many times I enter them.
https://myname#bitbucket.org/mygroup/myrepository.git
I have no problems on a different computer ( also Windows 10 )
I have tried upgrading SourceTree and Reinstalling Source Tree
I have tried System Git and Embedded Git and reinstalling both Git
I can clone Mercurial repositories
At the Dos prompt I can type
git clone https://myname#bitbucket.org/mygroup/myrepository.git
I get a message
fatal: HttpRequestException encountered
An error occurred wihe sending the request
then it asks for my password
then it proceeds with the clone
However in sourcetree the repository shows that there are more branches to pull.
I am unable to pull these branches
When I go to the Tools->Options->Authentication tab I can see myname#bitbucket.org as an Account.
If I try to add myname#mydomain.com.au I get
Authentication failed
Invalid URL: The hostname could not be parsed.
Atlassian community
"The only thing that worked for me was navigating to C:\Users\USERNAME\AppData\Local\Atlassian\SourceTree and removing the passwd file."
Had the same problem , but on MacOS. Just for completion of the answer I will add that on MacOS the passwords are stored in the KeyChain Access and they need to be deleted from there.

packagist error when adding bitbucket repository

I get the following error when trying to add a repository.
Uncaught Exception: [RuntimeException] Failed to execute git clone --mirror 'git#bitbucket.org:doppy/doppy.git' '/home/composer/.composer/cache/vcs/git-bitbucket.org-doppy-doppy.git/' Cloning into bare repository '/home/composer/.composer/cache/vcs/git-bitbucket.org-doppy-doppy.git'... Host key verification failed. fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.
The repository is public and when I copy and run the command locally I don't get any error.
I guess this an issue on the packagist server itself with the bitbucket servers?
side note: yeah, I understand it is a silly repo. I fully intend to remove it when done testing and cleanup my own mess.
Feedback from composer user mailing list:
https://groups.google.com/forum/#!topic/composer-users/ciGcpehsvy4
I think the problem is we don't support git# connections to bitbucket as
we don't have an ssh key set up for them. Make sure you use the HTTPS
clone URL and that should work:
https://bitbucket.org/doppy/doppy.git
Cheers

Unable to commit to git repo. Pathspec 'origin' did not match any file(s) known to git

I'm working off of an existing project that I have been committing and pushing to git. For a couple reasons, I had to change rails versions from 4.0 to 3.2.6 and use existing project files from a tutorial by downloading the files and replacing my local app folder with them.
Now I can't push to my existing repo on git that I have been working on.
If I try to commit, I get two errors:
error: pathspec 'origin' did not match any file(s) known to git.
error: pathspec 'master' did not match any file(s) known to git.
I tried to delete the local app folder, clone the repo and then replace all of the files with the 3.2.6 version app that I have been working on but I still get the same commit errors.
You can try to specify the full git push command:
git pull -u origin master
If it doesn't work, check if your remote declaration were altered in any way:
git remote -v
also, as show in this article, list references and branches:
git branch -avvv
git show-ref
check that you are in a branch, and not in a detached HEAD.
Make sure you don't have a branch named 'origin' (which would be confusing here)
As mentioned in this issue (for git svn, which isn't your case, but can still give interesting idea), trying to clone again the repo could lead to a non-corrupted .git folder, and the ability to push again.
Did you checked your git config file placed in
.git/config
in your project folder? You can find the details of your repo & branches information in this file.
Hope it helps.

github init error

I'm taking the ruby.railstutorial.org class (chapter 3) and I'm required to make a new github account. So I start up as normal.
$ git init
$ git commit -m "first commit"
$ git remote add origin git#github.com:<username>/sample_app.git
fatal: remote origin already exists.
Which is fine because it is only telling me that there is a github set up for this. Which is true, I can see that in my screenshot.
The next step accoding to github and my tutorial would be to:
$ git push -u origin master
fatal: 'git#github.com<username>/sample_app.git' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
What could be causing this? I have not been promted for a password which I also find odd.
You somehow ended up with an invalid URL for your origin remote; the colon is missing. You can update the URL like so:
git remote set-url origin git#github.com:<username>/sample_app.git
Where <username> is your username.
Alternatively, you could manually edit the repository configuration file .git/config and change the url value under the [remote "origin"] section.
After that everything should work fine.
Since you already have a github repo with that name you just clone it instead of creating a new one. In you console, trying doing:
git clone git#github.com:XXXXXX/sample_app.git
then continue with adding your first file, committing it, and pushing it.

Resources