2、新建项目,如下图:
3、创建完成后,简单使用说明,如下图:
4、在客户端上执行如下命令,将生产的公钥信息粘贴到github SSH key中,并测试能否连接成功。如下图:
[root@PXC01 ~] ssh-keygen -t rsa -C "442102293@qq.com" [root@PXC01 ~] cat /root/.ssh/id_rsa.pub [root@PXC01 ~] ssh -T git@github.com The authenticity of host 'github.com (13.229.188.59)' can't be established. RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added 'github.com,13.229.188.59' (RSA) to the list of known hosts. Hi net881004! You've successfully authenticated, but GitHub does not provide shell access.
5、git使用步骤
[root@PXC01 ~]# git config --global user.name "gxm" [root@PXC01 ~]# git config --global user.email "gxm@test.com" [root@PXC01 ~]# mkdir gxmscript [root@PXC01 ~]# cd gxmscript [root@PXC01 gxmscript]# echo "# sailikung" >> README.md [root@PXC01 gxmscript]# git init [root@PXC01 gxmscript]# git add README.md [root@PXC01 gxmscript]# git commit -m "first commit" [root@PXC01 gxmscript]# git remote add origin git@github.com:net881004/sailikung.git [root@PXC01 gxmscript]# git push -u origin master Warning: Permanently added the RSA host key for IP address '52.74.223.119' to the list of known hosts. Counting objects: 3, done. Writing objects: 100% (3/3), 213 bytes, done. Total 3 (delta 0), reused 0 (delta 0) To git@github.com:net881004/sailikung.git * [new branch] master -> master Branch master set up to track remote branch master from origin. [root@PXC01 gxmscript]# git pull origin master [root@PXC01 gxmscript]# git pull origin master From github.com:net881004/sailikung * branch master -> FETCH_HEAD Already up-to-date. [root@PXC01 gxmscript]# 新建文件(我rz上传了我之前写的一些脚本) [root@PXC01 gxmscript]# git status # On branch master # Untracked files: # (use "git add <file>..." to include in what will be committed) # # bak_log.sh # check_os.sh # check_pid_autostart.sh # dspam_install.sh # fail2b_install.sh # for-inbox_to-other.sh # heartbeat_drbd_monitor.sh # imapmail.sh # mysql_manage.sh # mysqlclear_dirtydata.sh # restoremail.sh # samba_install.sh # search_restore_maildata.sh # service_montir.sh # win_to_lin_maildata.sh nothing added to commit but untracked files present (use "git add" to track) [root@PXC01 gxmscript]# git add * [root@PXC01 gxmscript]# git status # On branch master # Changes to be committed: # (use "git reset HEAD <file>..." to unstage) # # new file: bak_log.sh # new file: check_os.sh # new file: check_pid_autostart.sh # new file: dspam_install.sh # new file: fail2b_install.sh # new file: for-inbox_to-other.sh # new file: heartbeat_drbd_monitor.sh # new file: imapmail.sh # new file: mysql_manage.sh # new file: mysqlclear_dirtydata.sh # new file: restoremail.sh # new file: samba_install.sh # new file: search_restore_maildata.sh # new file: service_montir.sh # new file: win_to_lin_maildata.sh # [root@PXC01 gxmscript]# git commit -m "upload sh" [master f68abfd] upload sh 15 files changed, 1784 insertions(+), 0 deletions(-) create mode 100644 bak_log.sh create mode 100644 check_os.sh create mode 100644 check_pid_autostart.sh create mode 100644 dspam_install.sh create mode 100644 fail2b_install.sh create mode 100644 for-inbox_to-other.sh create mode 100644 heartbeat_drbd_monitor.sh create mode 100644 imapmail.sh create mode 100644 mysql_manage.sh create mode 100644 mysqlclear_dirtydata.sh create mode 100644 restoremail.sh create mode 100644 samba_install.sh create mode 100644 search_restore_maildata.sh create mode 100644 service_montir.sh create mode 100644 win_to_lin_maildata.sh [root@PXC01 gxmscript]# git status # On branch master # Your branch is ahead of 'origin/master' by 1 commit. # nothing to commit (working directory clean) [root@PXC01 gxmscript]# git log commit f68abfdaec8b6130380f15c2ed82eb36866dde24 Author: gxm <gxm@test.com> Date: Sun May 20 22:49:26 2018 +0800 upload sh commit 80757952c28478f575f89551ff6208d3cbd9741b Author: gxm <gxm@test.com> Date: Sun May 20 22:40:54 2018 +0800 first commit [root@PXC01 gxmscript]# git push origin master Counting objects: 18, done. Compressing objects: 100% (17/17), done. Writing objects: 100% (17/17), 15.68 KiB, done. Total 17 (delta 1), reused 0 (delta 0) remote: Resolving deltas: 100% (1/1), done. To git@github.com:net881004/sailikung.git 8075795..f68abfd master -> master
原文地址:http://blog.51cto.com/net881004/2121817