Unable to push Swift code to Heroku because of "GIT_DISCOVERY_ACROSS_FILESYSTEM not being set" - swift

I am trying to push my Swift code to Heroku via Git. This is the error I am getting:
remote: fatal: not a git repository (or any parent up to mount point /)
remote: Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
So far I have tried the following:
git init
git remote add heroku [URL]
export GIT_DISCOVERY_ACROSS_FILESYSTEM=1
heroku config:set GIT_DISCOVERY_ACROSS_FILESYSTEM=1 --remote origin
But still when I try to push code to master, it fails. This is the command I am using to push code:
git push heroku master

Double check, after your git init (I would prefer git init . to be sure), that you have indeed a .git/ subfolder created in your current folder.
As long as you don't see it, you would get that error message.

Related

What's wrong in git init ...?

When I use git init it only shows (master) and not (master -> origin), and then that when I use the command: git push -u origin master it returns an error:
error: src refspec master does not match any.
error: failed to push some refs to 'github.com:BghAek/something.git'
Most probably this happened:
Forget to add the remote repo link
You have created a new repository using the init command, but it looks like you forgot to add the link to the remote repository. So do the following:
Remove the `.git` file from you local system.
Create a clean repository using the following:
git init
git add .
git commit -m "COMMIT MESSAGE"
git branch -M main
git remote add origin REMOTE_REPOSITORY_LINK
git push -u origin main
replace REMOTE_REPOSITORY_LINK with that of the remote repository link. Remember your are on main branch, so as to keep it consistent with the remote branch( read more here).

git clone is throwing repository not found error

While trying to clone my private repository, I'm getting the following error
fatal: repository 'https://github.com/kefitech/qp-guard.git/' not found
I have done some googling but unable to solve the issue.
Steps completed
1. config --global user.name and password is set using terminal (windows cmd)
2. git remote -v
git remote -v is returning an error:
fatal: not a git repository (or any of the parent directories): .git
So, tried set the remote URL to my repository using the command:
git remote set-url origin https://<my-user>#github.com/<my-org>/qp-guard.git
Bur this also returning the same error returned by git remote -v command
Please note that:
1. I'm a collaborator
2. I can clone any public repos
3. I have not used git client (terminal, cmd) for a long time but it was working before.
Looking forward to any pointers to solve this issue.

Fatal: master cannot be resolved to branch

Here's a screenshot of what I'm dealing with:
I'm a new GitBash user and am getting this error when trying to push to GitHub.
I was following this tutorial. So far I've not run into any problems, except I get this error when I try to push:
Fatal: master cannot be resolved to branch
Things I've done correctly:
I am signed in
I have specified my name and email using git config -global... *blah blah*
Everything is committed and should be ready to push
I'm on the master branch that I wish to push.
I've added my remote repository using command git remote add origin https://github.com/Tawnwen/MyApp.git.
I tried to push using the command git push -u origin master
Can anyone please help?

Push a local file to an existing GitHub remote repo

Trying to push a committed file to an existing remote repository on GitHub.
Below I verified and I'm trying to push to the Django. I've tried git push, and git push -u Django master. Any help would be appreciated. I have been saving all of my files locally and I am now adding all to GitHub and it's a little confusing.
Roberts-MBP:Django robertamato$ git remote -v
Django https://github.com/CodingDojo-Python-09-04/Robert_Amato.git (fetch)
Django https://github.com/CodingDojo-Python-09-04/Robert_Amato.git (push)
origin https://github.com/CodingDojo-Python-09-04/RobertAmato (fetch)
origin https://github.com/CodingDojo-Python-09-04/RobertAmato (push)
Roberts-MBP:Django robertamato$
Here is a error code it threw, I see it suggests to fetch first but I'm not to familiar with how that process works.
Roberts-MBP:Django robertamato$ git push -u Django master
To https://github.com/CodingDojo-Python-09-04/Robert_Amato.git
! [rejected] master -> master (fetch first)
error: failed to push some refs to 'https://github.com/CodingDojo-Python-09-04/Robert_Amato.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.

can't able to perform git push, permission denied?

I already made a repository in github as wordpress-template.
I created a .git repository locally, added some files there, and committed it.
Then I created a remote as origin and give it the url of the github repository as:
git remote add origin git#github.com:squalporeover/wordpress-template.git
Now I want to push my master branch to that repository. I ran the following command:
git push origin master
But it shows:
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
It looks like you added the SSH version of the remote URL. In order to use this you need to set-up Github with SSH.
Otherwise use the HTTPS version of the clone URL which will ask for your username and password:
You need to use ssh-keygen to generate an ssh key pair.
See: https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/
Duplicate found here: Git - Permission denied (publickey)
This worked for me:
Step 1- git remote rm origin
Step 2-select the http option in github
step 3- run the following command again
git remote add origin https://github.com/yourdirectory/link.git
git branch -M main
git push -u origin main