GitCode 是 CSDN 为开发者提供的开源项目创新服务平台,秉承“创新、开放、协作、共享”的开源价值观,致力于为大规模开源开放协同创新助力赋能,打造创新成果孵化和新时代开发者培养的开源创新生态!支持公有云使用、私有化部署以及软硬一体化私有部署。
yum -y install git
[root@compute-node1 gitcode]# git config --global user.name "wangming"
[root@compute-node1 gitcode]# git config --global user.email "123456@qq.com"
[root@compute-node1 gitcode]# git config --global color.ui true
[root@compute-node1 gitcode]#
[root@compute-node1 gitcode]# cat ~/.gitconfig
[user]
name = wangming
email = 123456@qq.com
[color]
ui = true
[root@compute-node1 gitcode]# git init .
Initialized empty Git repository in /git/gitcode/.git/
[root@compute-node1 gitcode]# ls -a
. .. found_file.sh .git
[root@compute-node1 gitcode]#
[root@compute-node1 gitcode]# git add .
[root@compute-node1 gitcode]# git commit -m "1.0 master-wangming create item for test scripts "
[master (root-commit) f1491e2] 1.0 master-wangming create item for test scripts
1 file changed, 21 insertions(+)
create mode 100755 found_file.sh
[root@compute-node1 gitcode]# git log --oneline
f1491e2 1.0 master-wangming create item for test scripts
[root@compute-node1 gitcode]# git remote add origin https://gitcode.net/jks212454/it-items.git
[root@compute-node1 gitcode]#
[root@compute-node1 gitcode]# git remote -v
origin https://gitcode.net/jks212454/it-items.git (fetch)
origin https://gitcode.net/jks212454/it-items.git (push)
[root@compute-node1 gitcode]# cat ~/.ssh/id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDjmRSBowMRzqDO4JFwveGTYZ/CtaOWKEu/G5GZ5HwYDDa/+Hps03DzXnOffkZARkPPmNNFVzE1/mCVA3LpMMDCeV3JfgrLLYSmwY4cNTgVMQ4NLs0uk4UkmBGwb/nP1IYX9Z+qpmGe/caUOFXGdvsGPRtjXC9llUGJCn1U4tkyhjX1hiwuPPlFl4XHw5w0EyCRwTtzzTn1Ma66DN5Ovc644GIbECnhVyOcXbzroZeiN3Ms+XfhVA/m9gCj9gXo+AUFC1wgHvwoBOLkx+PjKhOMz/nz4lSVEd/yURBGlcM6+wKYbTzeSdWGh0TG8mIMIBPd+vRIbNfW6R96NR/SLTMl root@localhost.localdomain
[root@compute-node1 gitcode]# git push git@gitcode.net:jks212454/it-items.git
warning: push.default is unset; its implicit value is changing in
Git 2.0 from 'matching' to 'simple'. To squelch this message
and maintain the current behavior after the default changes, use:
git config --global push.default matching
To squelch this message and adopt the new behavior now, use:
git config --global push.default simple
See 'git help config' and search for 'push.default' for further information.
(the 'simple' mode was introduced in Git 1.7.11. Use the similar mode
'current' instead of 'simple' if you sometimes use older versions of Git)
Counting objects: 6, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (5/5), 842 bytes | 0 bytes/s, done.
Total 5 (delta 0), reused 0 (delta 0)
To git@gitcode.net:jks212454/it-items.git
56dcb17..24c29d9 master -> master
[root@compute-node1 gitcode]#