My Sourcetree is not pushing to Github! When I hit push it says:
Any help is very much appreciated.
Please help, this is still a big issue for me.
As the hint indicates, try pulling first from the remote repo. Once merged, you should be able to push your changes.
Iâm sorry, I havenât used Github prior to this course. Whatâs the remote repo?
Simply click the âPullâ button in Sourcetree and once that completes, you can click âPushâ button. Perhaps youâve edited some file in github which created a commit that you now need to fetch on your local repository using your git client (sourcetree)
It says this:
git -c diff.mnemonicprefix=false -c core.quotepath=false push -v --tags origin master:master
fatal: HttpRequestException encountered.
An error occurred while sending the request.
POST git-receive-pack (chunked)
Thatâs still the output of a git push
. What it seems to be telling you is that there are changes that are checked into github that you donât have in your local copy. This may be something as simple as you changing the description of your project on its main page, as this is stored in a file called README.md. Did you try clicking on âPullâ in sourcetree as @martin-holkovic said? If so, and itâs still not working, can you post the output from that?
Changing the readme changed the origin/master and origin/head, but I still canât push. I have tried pressing the âPullâ button, and that text I showed above is the output of me trying to push after it successfully pulls. Still getting that error.
PC or Mac?
The issue youâre having now is most likely happening because youâre using HTTPS with git instead of SSH for a very large project. If youâre on a Mac, itâs really easy to switch to SSH. If youâre on PC itâs a little more involved, but still possible. There are some good instructions here on how to setup SSH. The only difference from those instructions is that you would upload your SSH public key to github instead of bitbucket. I would recommend that anyone who intends to use git with any regularity setup SSH.
Sorry for the delay. Iâll give it a try. BTW Iâm on a PC.
That screenshot still shows an HTTP error, so itâs not using SSH. Even after setting up SSH, if you donât update the URL of your repo itâll still use HTTP. You need to change the remote address of your repo to git@github.com:CamoSnipe200/04_BattleTank.git
Unfortunately I donât know the process in Source Tree as I do all of my git operations from the command line, but if youâre comfortable in cmd/git-bash you can go to the directory of your project and run this command: git remote set-url origin git@github.com:CamoSnipe200/04_BattleTank.git
So I did what you said and got somewhere. But now it says this:
After I click âyesâ it says this:
Once I click ready, it goes back to the first image, even though I added the key in Pageant.
Two things:
First, click the pageant icon in your system tray and select View Keys
Make sure the SSH key you created is loaded in the agent. If itâs not there, select Add Key
And load in the key.
Second, double check GitHub to make sure the SSH public key is properly uploaded to your account.
This is what may Pageant looks like:
I think that the key is private, as it wonât let me upload the public one though. Is that a problem?
How do you do that? I am not adept at GitHub, so more detail would be appreciated. BTW I am using SourceTree.
Sorry for the delay. Tis the seaonsâŚ
In your command line, type the following
cd %USERPROFILE%/.ssh
then
type id_rsa.pub
(and yes I mean type the word âtypeâ)
This should print out the value of your public key to the command line. Highlight the full value, starting with ssh-rsa
and copy it. Then go to github. Once youâre logged in, click your user icon in the top right and go to the settings page. On the left side, one of the options is SSH and GPG Keys
Select that, and in the subsequent page, cick New SSH Key
Give it whatever title you want, and paste in the value of your public key from the command line into the Key
box. Once you save that, you should be good.
how change SSH in github ?
⌠i use Sorucetree as well