Linking your github through the aws cloud 9 text editor - ruby-on-rails

I keep getting the error message below when I try to commit my changes to GitHub. Any solution on how to get around this? I'm still a novice when understanding how to push changes I've made to github from the new code I've added.
fatal: 'changes' 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.

Git is trying to push to the repository named changes. But returns a failed response either because the remote name doesn't exist or the path given is wrong. Here, the remote name doesn't even exist (that's the meaning of this error).
[ ] Check your `git remote -v` to see if a remote named `changes` exist
[ ] Configure `changes` as a remote address
First, check what you've configured remote to be
$ git remote -v
origin git#github.com:ashwink823/project.git (fetch)
origin git#github.com:ashwink823/project.git (push)
In the above example origin is the name of the remote we've configured git to fetch from or push to. If I try to push to a remote named changes it will return a fatal error because we haven't configured changes to be a remote address.
$ git push changes
fatal: 'changes' 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.
But if I add changes like
$ git remote add changes git#githubcom:clmno/project.git
# now, this will work
$ git push changes

Related

Laravel + Angular project commit error: src refspec master does not match any

There is a project that is coded using angular and laravel. I downloaded it from server to my local. After doing some cleaning, tried to commit to git. But I see the same error everytime which I specified on header.
After some tests, when I was looking here for the same errors, I couldn't find any solution. There are my steps:
1. cd sysGarden
2. git init
3. git add .
4. git commit -m "first commit"
5. git remote add origin git#github.com:biyro02/sysGarden.git
6. git push -u origin master
After the last step I saw errors. I have an account on github. You can look: https://github.com/biyro02/sysGarden
On git bash, I have logged in with my user name and password. Everything ok but I see errors. Please help me. This is my first git commit. I am ready to share my all infos. Just, I want to exceed this problem.
Edit: I execute "git branch" result: * master
Edit 2: I got the error below:
git#github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists
You should be able to resolve this issue by running the following commands again.
git add .
git commit -m 'Commit Message Here'
git push -u origin master
You may also try git push origin HEAD:master and if you need more information to share you can try git show-ref to see more verbose your local branch information.
This issue likely happens because of unstaged / untracked files or because your current branch is different to the branch you are pushing but I cannot be certain.

Issue trying to push to git repository

Problem when pushing app to github. This is what I entered into the command line. Hopefully it's just a small problem I can fix thanks.
git init
git add README.md
git commit -m "first commit"
git remote add origin git#github.com:travi5567/first_app.git
git push -u origin master
This is the error I get:
Traviss-MacBook-Pro:sample_app Travis$ git push -u origin master
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
If you don't know how to use SSH keys or would rather not you can also use the https remote like so:
git remote add origin https://travis5567#github.com/travis5567/first_app.git
git push origin master
Password for travis5567: <enter your password>
# regular output from a git push
GitHub uses SSH keys to configure access to git repositories. If you are the owner you can push to the repo but you need to tell git your SSH key so they know who you are first.
It's all explained on the GitHub website - https://help.github.com/articles/generating-ssh-keys

Heroku: how to "git pull" after 'git push -f'

I got this error message (copied below) after trying to push to Heroku. I initially set up a facebook canvas app and selected the hosting on heroku options. It gave me a heroku url, which I added as a remote on the app I was developing on my machine
heroku git:remote -a desolate-springs-1684
But when I pushed, I got this error
error: failed to push some refs to 'git#heroku.com:desolate-springs-1684.git'
To prevent you from losing history, non-fast-forward updates were rejected
Merge the remote changes (e.g. 'git pull') before pushing again. See the
'Note about fast-forwards' section of 'git push --help' for details.
localhost:nhl michaelmitchell$
So I did
git push -f heroku master
But now I apparently have to do a 'git pull'. However, what do i put after the 'git pull'? The name of the heroku url? or something else?
Forcing your git push was not a good idea because you lost any commit that was done by you or other collaborators you were missing on your working copy.
Before pushing, you should have either merged or rebased the upstream changes into your local working copy.
To merge the changes locally
$ git pull heroku master
$ git push heroku master
To rebase the changes locally
$ git pull --rebase heroku master
$ git push heroku master
BTW, now that you have pushed your changes, you actually don't need to do anything else. The remote repository already contains all your changes.
If for whatever reason the $ git status command is returning outdated references, simply run
$ git pull heroku
to fetch all the remote changes. Please note that unless you specify a target branch (or you have the tracking branch enabled), git pull will simply download (and not merge) the upstream changes.
Also note that Heroku should not be considered a git hosting. It means that it's extremely uncommon to perform a git pull from Heroku. Instead, you should use a git hosting (such as GitHub or BitBucket) to store your repository and only perform push to Heroku to deploy the application.
That error basically means that there is code in the repo that is newer than the code you're trying to push to it.
you have to do a pull and update your own working repository then push again, or just force a push
git pull heroku master
As a side note, if you aren't familiar with all the git commands, I would recommend you use a GUI as it may make the whole process a lot less overwhelming.
There are plenty of great clients here: http://git-scm.com/downloads/guis

error : remote gerrit already exists

I am trying to add remote gerrit but I am getting the error as :
fatal: remote gerrit already exists.
how to remove existing gerrit?
You didn't list what command was causing this error output, but I assume it was something like:
git remote add gerrit <url>
If you already have a remote named gerrit, you will get this error. You can see what remotes are in your repository with
git remote -v
To remove a remote, use
git remote rm <name>
name is 'gerrit' in your case.
A remote which name "gerrit" already exists. You can find it by:
git remote -v
So, remove this old remote:
git remote rm gerrit
Then add it again:
git remote add gerrit <url>

How to push existing source code to a repository in github?

I have a rails app hosted on heroku and i want to push the code to github(Aready created a repo on there).I tried to follow the steps in this question .Since i already have a local repository and currently can push and pull from heroku i skipped step 2 and 3 .But when i do step 4
git remote add origin git#github.com:sparkz19/stark-journey-1727.git
It says
fatal: remote origin already exists.
And when i do git remote -v
It says
origin git#heroku.com:stark-journey-1727.git (fetch)
origin git#heroku.com:stark-journey-1727.git (push)
What do i need to do here?Thank you in advance.
Git complains because origin is already defined. If you still want to keep the heroku remote you could use git remote rename to save it as another remote:
git remote rename origin heroku
Reset the url with git remote set-url:
git remote set-url origin git#github.com:sparkz19/stark-journey-1727.git
Now you can push and pull to any you like:
git pull heroku master
git push origin master
Just give your new remote a different name than origin and you'll be good to go.

Resources