Debian multiuser under GitHub git push configuration, no account password required.

Source: Internet
Author: User
Tags diff ssh

Because Debian has a variety of users, root and normal user

So I took user as a private git repository user. The root Super Administrator as a github user.

This can only be gitconfig by configuring two separate shared uses.

The first is the configuration under root, in the/root/.gitconfig

[User]
    name = Rainysia
    email = rainysia@gmail.com
[alias]
    CO = checkout
    br = Branch
    ci = commit
    st = Stat US Last
    = log-1 head
    CF = Config
    md = commit--amend
    dt = difftool
    mt = Mergetool Line
    = log- -oneline
    latest = for-each-ref--sort=-committerdate--format= '% (committerdate:short)% (refname:short) [% ( Committername)] '
    ls = log--pretty=format:\ '%c (yellow)%h%c (blue)%ad%c (red)%d%c (reset)%s (green) [%cn]\]- Decorate--date=short
    hist = log--pretty=format:\%c (yellow)%h%c (red)%d%c (reset)%s%c (green) [%an]%c (blue)%ad\ "--topo-order--graph--date=short
    type = cat-file-t
    dump = cat-file-p
[color]
    diff = auto
    st atus = auto
    branch = Auto
[http]
	sslverify = True
[HTTPS]
	sslverify = True


The second one is/home/tom/.gitconfig.

[User]
	name = Tom Xia
	email = tomx@***.com
[alias]
	CO = checkout
	br = Branch
	ci = commit
	st = Status
	Last = log-1 head
    CF = Config
    md = commit--amend
    dt = difftool
    mt = Mergetool Line
    = Log--onelin E
    latest = for-each-ref--sort=-committerdate--format= '% (committerdate:short)% (refname:short) [% ( Committername)] '
    ls = log--pretty=format:\ '%c (yellow)%h%c (blue)%ad%c (red)%d%c (reset)%s (green) [%cn]\]- Decorate--date=short
    hist = log--pretty=format:\%c (yellow)%h%c (red)%d%c (reset)%s%c (green) [%an]%c (blue)%ad\ "--topo-order--graph--date=short
    type = cat-file-t
    dump = cat-file-p
[color]
	diff = auto
	st atus = auto
	branch = auto


Here only the GitHub under the root.

#cd ~/.ssh
#ssh-keygen-t rsa-c "Username@yourhost"

Always enter OK, you can also change their own place to save, username is your github username, Yourhost is your registered mailbox. Like my rainysia@gmail.com.

#cat ~/.ssh/id_rsa.pub  | ssh username@yourhost ' cat >> ssh/authorized_keys '     ssh username@yourhost

Landing GitHub System. Click Account Settings in the upper right corner--->ssh public keys---> add another public keys

Copy your locally generated key to the inside (Key text box), click Add Key and OK
Then open git and test the connection for success

#ssh-T git@github.com
If prompted: Hi xxxx! You have ' ve successfully authenticated, but GitHub does not provide shell access. It means your connection was successful.

Next git clones your own code.

When you finish cloning, you will be prompted to enter your username and password when you push. We suspend this operation

In the project directory to modify, the following username replaced by your, PROJECT_NAME is your github project name

#git remote Set-url Origin Git@github.com:username/project_name

or directly modify the project under. Git/config [remote "origin"] url is url = git@github.com:username/project_name

So you can just git push it.



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.