深圳学校网站定制设计,南昌网站建设哪家好,iis配网站,有文化内涵又高雅的公司名字目录 初始化仓库 Git init Git init project --bare 查看提交的记录 git log --prettyoneline 查看当前git远程库地址 git remote -v 查看详细提交记录 git log 撤出暂存区的文件 git reset HEAD file(.代表全部文件#xff09; 提交数据到远程仓库 git config --global push.… 目录 初始化仓库 Git init Git init project --bare 查看提交的记录 git log --prettyoneline 查看当前git远程库地址 git remote -v 查看详细提交记录 git log 撤出暂存区的文件 git reset HEAD file(.代表全部文件 提交数据到远程仓库 git config --global push.default simple git push 查看当前提交版本 git reflog 查看所有提交版本 git log --oneline 移动提交版本 git reset --hard 查看分支 git status git branch -v 创建分支 git branch dev 切换分支 git checkout dev 添加远程仓库服务器地址 git remote add origin root192.168.84.31:/var/git/sph git remote add origin git:/192.168.84.31/project 直接修改远程 origin 的git仓库地址 git remote set-url origin http://git.XXXX.com/XXX/XXX.git/ Git协议服务器 yum install -y git-daemon git init /var/git/project --bare /usr/lib/systemd/system/git.service systemctl start git.socket git clone git://192.168.84.31/project Git http服务期 yum install -y httpd gitweb vim /etc/gitweb.conf systemctl start httpd http://192.168.84.31/git/ 附录图片 Git学习记录 时间2024-08-22 作者垃圾宝宝 初始化仓库
Git init
Git init project --bare
设置远程仓库和克隆时区别末尾一个有.git\一个没有
查看提交的记录
git log --prettyoneline
[rootdb01-84-31 project]# git log --prettyoneline
85e931808a3b0c7d0ead5157f1b9d4c4cbaa7415 第二次提交
c89a0857cc3856835da23d267eeb6dbafb4cfcca init data submit
查看当前git远程库地址
git remote -v
// -v 是 --verbose 的简写
git remote -v 查看详细提交记录
git log
[rootdb01-84-31 project]# git log
commit 85e931808a3b0c7d0ead5157f1b9d4c4cbaa7415
Author: Your Name youexample.com
Date: Thu Aug 22 18:30:24 2024 0800 第二次提交 commit c89a0857cc3856835da23d267eeb6dbafb4cfcca
Author: Your Name youexample.com
Date: Thu Aug 22 18:24:51 2024 0800 init data submit
撤出暂存区的文件
git reset HEAD file(.代表全部文件
[rootdb01-84-31 project]# git status
# 位于分支 master
# 要提交的变更
# 使用 git reset HEAD file... 撤出暂存区
#
# 新文件 commit3.txt
#
[rootdb01-84-31 project]# git reset HEAD commit3.txt
[rootdb01-84-31 project]# git reset HEAD .
提交数据到远程仓库
git config --global push.default simple
git push [rootdb01-84-31 project]# git config --global push.default simple
[rootdb01-84-31 project]# git push
root192.168.84.31s password:
Counting objects: 8, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (5/5), done.
Writing objects: 100% (8/8), 646 bytes | 0 bytes/s, done.
Total 8 (delta 0), reused 0 (delta 0)
To root192.168.84.31:/var/git/project * [new branch] master - master
查看当前提交版本
git reflog
[rootdb01-84-31 project]#
85e9318 HEAD{0}: clone: from root192.168.84.31:/var/git/project
查看所有提交版本
git log --oneline
[rootdb01-84-31 project]# git log --oneline
85e9318 第二次提交
c89a085 init data submit
移动提交版本
git reset --hard
[rootdb01-84-31 project]# git log
commit 85e931808a3b0c7d0ead5157f1b9d4c4cbaa7415
Author: Your Name youexample.com
Date: Thu Aug 22 18:30:24 2024 0800 第二次提交 commit c89a0857cc3856835da23d267eeb6dbafb4cfcca
Author: Your Name youexample.com
Date: Thu Aug 22 18:24:51 2024 0800 init data submit
[rootdb01-84-31 project]# git reset --hard 85e9318
HEAD 现在位于 85e9318 第二次提交 查看分支
git status
git branch -v
当前
[rootdb01-84-31 project]# git status
# 位于分支 master
无文件要提交干净的工作区
所有
[rootdb01-84-31 project]# git branch -v
* master 85e9318 第二次提交 创建分支
git branch dev
[rootdb01-84-31 project]# git branch dev
切换分支
git checkout dev
[rootdb01-84-31 project]# git checkout dev
切换到分支 dev 添加远程仓库服务器地址
git remote add origin root192.168.84.31:/var/git/sph
ssh协议
git remote add origin root192.168.84.31:/var/git/sph
git remote add origin git:/192.168.84.31/project
git协议
git remote add origin git:/192.168.84.31/project
直接修改远程 origin 的git仓库地址
git remote set-url origin http://git.XXXX.com/XXX/XXX.git/ Git协议服务器
yum install -y git-daemon
git init /var/git/project --bare
/usr/lib/systemd/system/git.service
[rootdb01-84-31 project]# vim /usr/lib/systemd/system/git.service
[Unit]
DescriptionGit Repositories Server Daemon
Documentationman:git-daemon(1) [Service]
Usernobody
ExecStart-/usr/libexec/git-core/git-daemon --base-path/var/git --export-all --user-pathpublic_git --syslog --inetd --verbose
StandardInputsocket
systemctl start git.socket
git clone git://192.168.84.31/project
[rootdb01-84-31 tmp]# git clone git://192.168.84.31/project
正克隆到 project...
remote: Counting objects: 8, done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 8 (delta 0), reused 0 (delta 0)
接收对象中: 100% (8/8), done.
[rootdb01-84-31 tmp]# ll
总用量 0
drwxr-xr-x 4 root root 46 8月 22 20:06 project
[rootdb01-84-31 tmp]# Git http服务期
yum install -y httpd gitweb
vim /etc/gitweb.conf
$projectroot /var/git; systemctl start httpd
http://192.168.84.31/git/ 附录图片 文章转载自: http://www.morning.sqnxk.cn.gov.cn.sqnxk.cn http://www.morning.nfbkz.cn.gov.cn.nfbkz.cn http://www.morning.qnbsx.cn.gov.cn.qnbsx.cn http://www.morning.rynqh.cn.gov.cn.rynqh.cn http://www.morning.chfxz.cn.gov.cn.chfxz.cn http://www.morning.sqyjh.cn.gov.cn.sqyjh.cn http://www.morning.wlnr.cn.gov.cn.wlnr.cn http://www.morning.bqdpy.cn.gov.cn.bqdpy.cn http://www.morning.xqmd.cn.gov.cn.xqmd.cn http://www.morning.qkwxp.cn.gov.cn.qkwxp.cn http://www.morning.lhytw.cn.gov.cn.lhytw.cn http://www.morning.jpnfm.cn.gov.cn.jpnfm.cn http://www.morning.rkzb.cn.gov.cn.rkzb.cn http://www.morning.hxxyp.cn.gov.cn.hxxyp.cn http://www.morning.srgnd.cn.gov.cn.srgnd.cn http://www.morning.ppzgr.cn.gov.cn.ppzgr.cn http://www.morning.taojava.cn.gov.cn.taojava.cn http://www.morning.rsqpc.cn.gov.cn.rsqpc.cn http://www.morning.hdnd.cn.gov.cn.hdnd.cn http://www.morning.yunease.com.gov.cn.yunease.com http://www.morning.fbfnk.cn.gov.cn.fbfnk.cn http://www.morning.nqrdx.cn.gov.cn.nqrdx.cn http://www.morning.ykmg.cn.gov.cn.ykmg.cn http://www.morning.trfh.cn.gov.cn.trfh.cn http://www.morning.rhkgz.cn.gov.cn.rhkgz.cn http://www.morning.dpflt.cn.gov.cn.dpflt.cn http://www.morning.khdw.cn.gov.cn.khdw.cn http://www.morning.gxhqt.cn.gov.cn.gxhqt.cn http://www.morning.rshijie.com.gov.cn.rshijie.com http://www.morning.rxydr.cn.gov.cn.rxydr.cn http://www.morning.ndngj.cn.gov.cn.ndngj.cn http://www.morning.plcyq.cn.gov.cn.plcyq.cn http://www.morning.hqwcd.cn.gov.cn.hqwcd.cn http://www.morning.gftnx.cn.gov.cn.gftnx.cn http://www.morning.rljr.cn.gov.cn.rljr.cn http://www.morning.smmrm.cn.gov.cn.smmrm.cn http://www.morning.jzbjx.cn.gov.cn.jzbjx.cn http://www.morning.lxkhx.cn.gov.cn.lxkhx.cn http://www.morning.gtqx.cn.gov.cn.gtqx.cn http://www.morning.bwjgb.cn.gov.cn.bwjgb.cn http://www.morning.gzgwn.cn.gov.cn.gzgwn.cn http://www.morning.xqltq.cn.gov.cn.xqltq.cn http://www.morning.rui931.cn.gov.cn.rui931.cn http://www.morning.wkxsy.cn.gov.cn.wkxsy.cn http://www.morning.rqgjr.cn.gov.cn.rqgjr.cn http://www.morning.nqmdc.cn.gov.cn.nqmdc.cn http://www.morning.nlkhr.cn.gov.cn.nlkhr.cn http://www.morning.gynls.cn.gov.cn.gynls.cn http://www.morning.dbqg.cn.gov.cn.dbqg.cn http://www.morning.qcymf.cn.gov.cn.qcymf.cn http://www.morning.mjbnp.cn.gov.cn.mjbnp.cn http://www.morning.rrwft.cn.gov.cn.rrwft.cn http://www.morning.plchy.cn.gov.cn.plchy.cn http://www.morning.clzly.cn.gov.cn.clzly.cn http://www.morning.qgkcs.cn.gov.cn.qgkcs.cn http://www.morning.qdmdp.cn.gov.cn.qdmdp.cn http://www.morning.ryxyz.cn.gov.cn.ryxyz.cn http://www.morning.jbpdk.cn.gov.cn.jbpdk.cn http://www.morning.mzwfw.cn.gov.cn.mzwfw.cn http://www.morning.htfnz.cn.gov.cn.htfnz.cn http://www.morning.nqmkr.cn.gov.cn.nqmkr.cn http://www.morning.ytnn.cn.gov.cn.ytnn.cn http://www.morning.kxgn.cn.gov.cn.kxgn.cn http://www.morning.bnfsw.cn.gov.cn.bnfsw.cn http://www.morning.cwzzr.cn.gov.cn.cwzzr.cn http://www.morning.yrbqy.cn.gov.cn.yrbqy.cn http://www.morning.wtlyr.cn.gov.cn.wtlyr.cn http://www.morning.dpjtn.cn.gov.cn.dpjtn.cn http://www.morning.xqcst.cn.gov.cn.xqcst.cn http://www.morning.pwhjr.cn.gov.cn.pwhjr.cn http://www.morning.nkdmd.cn.gov.cn.nkdmd.cn http://www.morning.rjjys.cn.gov.cn.rjjys.cn http://www.morning.ghryk.cn.gov.cn.ghryk.cn http://www.morning.mljtx.cn.gov.cn.mljtx.cn http://www.morning.zqwqy.cn.gov.cn.zqwqy.cn http://www.morning.rhkgz.cn.gov.cn.rhkgz.cn http://www.morning.zdqsc.cn.gov.cn.zdqsc.cn http://www.morning.rmxgk.cn.gov.cn.rmxgk.cn http://www.morning.jxfsm.cn.gov.cn.jxfsm.cn http://www.morning.sogou66.cn.gov.cn.sogou66.cn