difference btw local account and github account? - github

What is the difference between the local account that I set in git bash with git config --global user.name and my actual github account login. I have a test repo, in there I have added a few collaborators. When I push to the repo, the history will show my local name and not my github account username. How come ?

GitHub is not git. GitHub is a remote repository management application. It has its own authentication and account system. You can push git repositories to it so that they can be shared and controlled.
The "local" variables that you set through git config are ways to make it faster to set the author of a commit.
There is nothing stopping you from pushing commits authored by someone who is "not you" to a GitHub remote that you control. I believe they will be associatively "linked" if the emails match, but it's not enforced or required.

Related

Pushing files from one account to other in github

Iam trying to push some changes to other account from another account but it is giving me permission error.I checked the github settings but everything there seems to be right.Can anybody help me with this?
EDIT:
I tried changing my user name and email too still it is giving same error
Some info about the transfer process which might help you
When a repository is transferred between two user accounts, issue assignments are left intact. When you transfer a repository from a user account to an organization, issues assigned to members in the organization remain intact, and all other issue assignees are cleared. Only owners in the organization are allowed to create new issue assignments. When you transfer a repository from an organization to a user account, only issues assigned to the repository's owner are kept, and all other issue assignees are removed.
If the transferred repository contains a GitHub Pages site, then links to the Git repository on the Web and through Git activity are redirected. However, we don't redirect GitHub Pages associated with the repository.
All links to the previous repository location are automatically redirected to the new location. When you use git clone, git fetch, or git push on a transferred repository, these commands will redirect to the new repository location or URL. However, to avoid confusion, I strongly recommend updating any existing local clones to point to the new repository URL. You can do this by using git remote on the command line:
$ git remote set-url origin new_url
Add the collaborator from the initial account (the git account having the repo) and the second account can accept the invitation to be a collaborator
This allows you to change and push the code from different Id also.

Unable to git push julialang

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".

github: push project from eclipse to remote repository for first time and no credentials asked

I have a project in eclipse in my local workspace.
I created a github public account, created a remote repository, copied the HTTPS clone URL.
Then cloned the Git repository to create my local repository, and shared the project with the local repository, configured Git for merge and fetch, and committed my changes to local repository, and then successfully pushed the committed changes to the remote repository. I can see the changes in remote repository.
There was username and password fields when I tried to clone the git repository, but I left as blank, and did not give my github account details.
Question: I am so surprised that nowhere I was prompted for a username and password. Does this mean, anybody can push changes to my remote repository? If not, How was I recognized?
then successfully pushed the committed changes to the remote repository
That means you must have logged in to GitHub at one point: even without any repo, you can put your GitHub credentials in the GitHub for Windows/Mac (assuming you are using that GUI)
Once logged in, any repo you are adding can be push to if the GUI detects that your initial credentials match the owner of that repo.
And as Paul Betts would insist, said credentials are cached.

Sourcetree and github

When I push commits to github repo from windows github client, I can see my github username and link to my profile in history, like this:
initial commit [username]
But when I push changes from SourceTree, in commits history it looks like:
initial commit [mac_username]
I want my history on github.com looks like the first example (with github username and link to the profile) What settings I should enable in SourceTree to get it?
Check the config in those repos:
git config user.name
git config user.email
Make sure the repo on Mac has the same settings than the one on Windows.
This thread details how to change those settings in SourceTree, but check if "Allow SourceTree to modify your global Git configuration file" is set: that means it would apply to all your local git repo (Github or not).
The "Full name" is a bit misleading, in that you should use your GitHub login name (and GitHub account email), in order to generate the right commit author history on GitHub.
Go to preferences and on General tab you can see two text fields, one for Full Name and other for email, set the name whatever you want to appear

Github shows name instead of a linked username in commits

I just helped a friend to set up a Github account to collaborate on my project. His commits come through, but for some reason on the "Source" page of my repository next to his commit is only his name and not his username (with a link).
It seems strange, since Github obviously recognizes him (I added him to the list of collaborators etc.
Seems like a stupid question, but Google couldn't help.
Thanks!
Does your friend have the e-mail address he is using for his commits correctly set up as an alias in GitHub? Otherwise, how is GitHub to know who he is? Git itself only records the full name and the e-mail address and obviously not the GitHub username, since you can use Git perfectly fine without GitHub.
Run this in Terminal:
git config --global user.name "your-github-username"
git config --global user.email "your-github-email"
Add the email used in the git commits to github via Account Settings: Email Settings
Just ask your friend to add email that he use in local git commits to his GitHub account emails list as stated in GitHub Help
you can check the GitHub article:
$ git config --global user.name "example"
$ git config --global user.email "email#example.com"