搭建git服务器(本地局域网)

搭建git服务器(本地局域网)

创建仓库

(假定在/home/git目录下创建仓库)

shell 复制代码
git init --bare sample.git

克隆远程仓库到本地

shell 复制代码
git clone git@192.168.0.100:/home/git/sample.git

已有项目,绑定远程仓库

shell 复制代码
# 查看远程仓库绑定
git remote -v

# 解除远程仓库绑定
git remote -remove origin

# 绑定远程仓库
git remote -add origin git@192.168.0.100:/home/git/sample.git

推送

shell 复制代码
# 查看本地更改
git status

# 添加更改
git add -u

# 提交更改
git commit -m "提交说明"

# 推送
git push origin master

拉取

shell 复制代码
git pull origin master
相关推荐
likfishdn15 分钟前
Linux的文件与目录管理
linux·运维·服务器
渲染101专业云渲染17 分钟前
川翔云电脑优势总结
服务器·3d·电脑·blender·maya
2501_9032386526 分钟前
Git Bash:Windows下的强大命令行工具
windows·git·bash·个人开发
chian-ocean35 分钟前
Linux 文件缓冲区:高效数据访问的幕后推手
linux·运维·服务器
加油=^_^=36 分钟前
【Linux】进程优先级 | 进程调度(三)
linux·运维·服务器
橘子味的茶二1 小时前
高级系统架构师--第十章:计算机网络
服务器·计算机网络·系统架构
紫菜(Nori)1 小时前
短连接服务器压测-wrk
服务器·压力测试
元气满满的热码式1 小时前
Docker数据卷操作实战
linux·运维·docker·云原生·容器
陆沙1 小时前
deepseek-r1-centos-本地服务器配置方法
linux·服务器·centos
北京耐用通信1 小时前
航空装配自动化神器Ethercat转profient网关搭配机器人精准控制
运维·机器人·自动化