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.