Unable to git push julialang - github

I'm trying to get the latest julia master commit.
I instaled it via git clone, however, when I do
$ git push
It returns an exception:
fatal: remote error: You can't push to git://github.com/JuliaLang/julia.git
Use https://github.com/JuliaLang/julia.git
If I use the option given, git requires me a password.

It sounds like you probably don't actually want to push to the JuliaLang repository, but rather pull from it.
You git pull to fetch upstream changes and integrate them into your local repository. So, for example, to update and rebuild Julia, you would git pull && make clean && make from within julia's directory while on the master branch.
You would only git push if you were a contributor submitting changes. But even among contributors who have commit access, very few actually push directly to the master branch. Most create branches, submit those, and then open a pull request for a review. And for that workflow, you don't even need to be a contributor. You can "fork" the project on Github, and then push to your forked repository online. From there, you can open a pull request for review.

git:// doesn't allow for authentication.
ssh or https does.
In the case of https, it is asking for your GitHub username and password.
See more at "Git - the Protocols".
GitHub needs to know who you are, because only the owner (or a collaborator) has the right to push (while everybody can clone/pull from a public repo, which is why git:// works for cloning).
See "Permission levels for a user account repository".
Note: here github.com/JuliaLang is an organization, which means only the owner and members/teams can push to a repo declared in that organization.
Se more at "Permission levels for an organization repository".

Related

How can collaborators push their changes to my repo in GitHub

First I have created one project in Eclipse and committed to my GitHub using below commands:git init
git add .
git commit -m "first commit"
git remote add origin URI of my repo
git push -u origin master
Then I modified one file in Eclipse and committed to GitHub from Eclipse through creating remote and giving the remote URI of the repo.
I added my team member through add collaborator.
Then he downloaded my project and made a change in a file in Eclipse.
Now, how can he push that modified file to my GitHub repository from within Eclipse?
We have done one thing. He created a remote and gave the URI of my repo. But still we are unable to commit that file.
You need to add your colleague as a collaborator. This can be done in the desired GitHub repo via Settings > Collaborators (you need to type in your password again). Afterwards they have those permissions.
UPDATE
Sorry and good morning ;)
I overlooked that you already added your partner as a collaborator. Another possible reason for your situation could be in the Temporary interaction limits where you can, amongst others, limit the interaction with your repo to prior contributors.
If that doesn't help. Please add some more informations about your colleague's git logs.
UPDATE 2
#Rahul K regarding your comment (which you better add to your question, for faster recognition), your colleague first needs to integrate the remote changes via git pull origin master in order to be able to push his or her changes afterwards. But be aware that he or she might need to migrate any conflicts to files both of you applied changes to.
Best regards, David
I have resolved the issue by cloning the repo in my local folder, adding the project to eclipse and changing the file committed.
Before that you have to add that person as a collaborator. So that he/she can clone your repo using the command below:
git clone "Path to the repository"
This is an old question but I'll like to say this to help others that might still be facing this same issue.
I also faced this issue with a friend. I already made him a collaborator but he couldn't push. What we did to solve it was to clone the repo using the ssh url instead. Then we set up authentication in git with ssh. And we were able push successfully.
If you already cloned the repo with the usual HTTPS url, you can change the remote origin url using the git remote set-url origin <url> command but url here will be the ssh url.

Not able to checkin my code in github

This is my first day at using GITHUB and I am stuck with this issue despite lot of googling. Her are the steps which I have done so far
cloned a repository
git clone https://github.com/OfficeDev/Complete-Me-Code-Sample.git
Now since I don't want to corrupt the main branch, I created my own branch
git branch validation
Now I switched to my branch
git checkout validation
Now I made all my changes locally. After this I created the remote branch
git remote add validation https://github.com/OfficeDev/Complete-Me-Code-Sample.git
Now I try to uploaded all my code
git push complete-me-code-sample validation
it asks me for user name and password and then gives me an error
fatal: 'complete-me-code-sample' 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 isn't git open for everyone? or do I need to contact the owner of this project and ask for rights? if yes, what rights I should ask for?
At this point of time, I am finding too much information and its hard for me to proceed without doing a PHD.
Can you please tell me how I can checkin my code ... as well as point me to a resource which can teach me git without too much RTFM.
Your error is simple and it's git related, not github. Here it is:
Now I made all my changes locally. After this I created the remote branch
git remote add validation https://github.com/OfficeDev/Complete-Me-Code-Sample.git
This is not how you create a remote branch, in here you've added another origin (named validation), which basically is another clone of the same repo. You said that other repo is located at that address which is not true, as nothing exists there.
When you git push if the remote branch doesn't exist it is created by default, so if you simply skipped that step the branch would have been created fine.
The correct and optimised steps should have been:
git clone https://github.com/OfficeDev/Complete-Me-Code-Sample.git
// Creates and changed branch at the same time
git checkout -b validation
// You'll need to commit files first, just in case you missed that
git commit -am "my sample commit"
// Depending on how you set up the repo git push could be enough
git push origin validation
Try this and let me know how it went.

Github to launchpad sync

I am working on a open source project which uses bazaar for versioning and launchpad for repo. The project also has github repo but launchpad repo is primary. I am behind college proxy so i can't access ssh required to connect to launchpad to merge/push changes. Is there a way, that i commit, push all changes on my github account, and they get reflected on my launchpad account too. Can I send merge requests too?
This will give you overall idea , how to do that
create your project test in github and will be owned by organization name Acc.
then just push the master branch to test
Now fork the project and clone
Push all your local branches to your GitHub fork git push -a origin
And checkout that branch using git checkout <branch_name>. And then push to origin of that branch.
Launchpad is a project-centric environment, so you will most likely have a GitHub organization that owns the ‘main’ repository and encourage all members and newcomers to fork from that.
within fork developer can able to work on that, usually when about to issue a pull request – GitHub’s version of a merge proposal, pull down changes from the upstream organization master into their master. Since this will happen relatively often it is easiest to add an additional ‘remote’ target for it:
git remote add acc `http://github.com/acc/test.git`

How to submit a pull request from a cloned repo?

How to submit a pull request from an existing locally-cloned repo?
Often, I want to look at some libraries source code from github, so I clone it. Later, I discover some issue with the code and raise it on a mailing list, often in passing. The library author says "nice find, can you send a pull request?".
And the answer is "not that easily". I haven't forked the repo yet, Ive cloned it. And there doesn't seem a way I can find to submit a pull request from a cloned repo?
If this limit is true, it feels like the sensible reaction is to fork anything and everything you ever look at, just so that if you ever might want to contribute, you can. And that fills up your github account with many inactive forks.
Doesn't seem a lot of talk about this issue - am I the only person whom this problem affects?
Fork the repo on GitHub, then add your fork repo as a remote to your local cloned copy:
git remote add myfork https://github.com/<myGitHubAccountName>/<repoName>.git
Then you can push to your fork:
git push myfork master
If you're doing more than just this one pull request, you can remove the origin remote and name your fork as origin:
git remote rm origin
git remote add origin https://github.com/<myGitHubAccountName>/<repoName>.git
This is typically what I do. Sometimes I add the original origin as upstream so I still have a reference to it.
If you're ok with installing another binary in your path, github has released a nice little tool called hub.
If you've cloned someone else's repo:
$ hub fork # This creates a fork and adds your repo as a remote
$ git push YOUR_USER feature # push the changes to your new remote
$ hub pull-request # will open your browser
I always clone instead of fork as well and the following steps work for me:
Create a new branch on your cloned repo and make the new change.
Push the change to your branch as the following:
git push origin insert_your_working_branch_name
Now you should be able to find your working branch in pull request from github master.

How to push changes from a forked project to the original project?

I’m supposed to work on my client's project on GitHub, where the changes would be on his repository. I tried to follow the fork example, but could only get the changes to go to my account repository?
In the example on GitHub, to fork a repo, they create a remote called upstream to point to the original project. I can get the changes from it by
get fetch upstream
git merge upstream/master
I was able to upload the changes into my repo by
git push –u origin
which copied my changes to my account.
I tried
git push –u upstream
To push my changes on the original account. I got the following error
You can’t push to git://github.com.octocat/SpoonKnife.git
use git#github.comoctocat/Spoon0-Knife.git
Basically, in order to collaborate with your client, you've got two main options:
Send your client a pull request (more info on this in this GitHub help item). This allows your client to review, discuss and/or request some changes to your proposal before merging it.
Request from your client to be added as a committer to their project. This would allow you to directly push your commits to their repository, without the need for a fork/cloned repository on your side.
As a side note, Spoon-Knife.git is one of GitHub's read-only repository (used for demonstration purpose) and you will not be able to commit to that (unless your client is GitHub). Thus, your client's upstream git remote should point to a different repository
Here are the steps (to be followed after you forked and cloned the repository to your local disk):
Remove the upstream reference: git remote rm upstream
Add in your client's info - git remote add upstream git#xxxxxx
Push your changes - git push -u upstream master . git push -u will set the HEAD of the remote repository.
Same if you want to pull - git pull upstream master
If you prefer the name origin replace upstream with origin, but still follow step 1 to remove the reference to Spoon-Knife.git. Then in step 2 - git remote add origin git#xxxx.
git://github.com.octocat/SpoonKnife.git is a read-only URL. As GitHub suggests, the corresponding write-able URL is git#github.comoctocat/Spoon0-Knife.git.
If you want to be able to push on the upstream repository, you will have to ask (to the upstream team, i.e., your customer) to be added as a committer.