Linux与Windows间使用git
Linux与Windows间使用git
Linux上架设git服务器,windows可以使用git从Linux上拉取/上传数据
windows使用工具:Git for Windows
Linux上的用户:test(测试git使用)/git(为git项目管理创建)
Linux上创建git仓库
Linux上创建新的仓库(这里使用root用户)
git init --bare example.git
修改所有者/权限(root)
chown git:git -R example.git
chmod -R 775 example.git
clone项目(test)
git clone /home/git/repository/example.git
创建初始化文件(test)
touch README
git add README
git commit -m 'first commit' README
git push origin master
Windows下clone仓库
使用git生成SSH公密钥
本地仓库存放点生成SSH公密钥

上传公钥到Linux服务器

Windows上clone项目开始开发
git clone git@192.168.100.198:/home/git/repository/example.git
常用命令
work 本地分支
master 远程分支
git checkout -b work 创建分支work并跳转到该分支
git status 查看git跟踪状态
git add -A 添加所有文件
git status
git commit -m "add first version pack to server" -a 为加入追踪的文件添加注释(本地仓库)
git fetch origin master:master 从远程master拉取数据到本地master
git fetch git@192.168.100.198:/home/git/repository/example.git
git rebase master 将master修改更新到所在分支
git checkout master 跳转到master分支
git merge work 将work分支修改更新到所在分支
git push origin 将本地master推送到远程master
git checkout work 跳转到work分支
参考资料
[2].Git远程操作详解
[3].Ubuntu上搭建git服务器
Linux与Windows间使用git的更多相关文章
- WLS中Linux与Windows间的环境共享
Reference 更多cmd.exe帮助参考 (cmd_helps)[https://ss64.com/nt/cmd.html] (WSL备份,windows Docker安装)[https://w ...
- 通过Samba实现Linux与Windows间的文件共享
Samba Samba,是用来让Linux系列的操作系统与Windows操作系统的SMB/CIFS(Server Message Block/Common Internet File System)网 ...
- 【问题】如何在Linux与Windows间共享文件
实验环境 Linux LSB Version: :core-4.1-amd64:core-4.1-noarch Distributor ID: CentOS Description: CentOS L ...
- Linux连接Windows服务器以及文件传输方法
Ubantu系统上连接Windows服务器,操作步骤 安装rdesktop sudo apt-get install rdesktop 连接命令 rdesktop -f IP -r disk:mydi ...
- linux tr命令实现windows文本格式与linux文本格式间的转换
tr 命令 转换和删除字符 选项: -d --delete:删除字符 -s --squeeze-repeats:把连续重复的字符以一个字符表示,即去重 -c –C --complement:取字符集的 ...
- LCOW —— 单一Docker引擎下可同时运行Linux和Windows容器啦!
https://blog.csdn.net/m2l0zgssvc7r69efdtj/article/details/79251059 就在上周,Docker官方的master分支上新增了LCOW(Li ...
- 在Linux和Windows平台上操作MemoryMappedFile(简称MMF)
操作系统很早就开始使用内存映射文件(Memory Mapped File)来作为进程间的共享存储区,这是一种非常高效的进程通讯手段..NET 4.0新增加了一个System.IO. MemoryMap ...
- 在Linux和Windows的Docker容器中运行ASP.NET Core
(此文章同时发表在本人微信公众号"dotNET每日精华文章",欢迎右边二维码来关注.) 译者序:其实过去这周我都在研究这方面的内容,结果周末有事没有来得及总结为文章,Scott H ...
- 【转】linux和windows下安装python集成开发环境及其python包
本系列分为两篇: 1.[转]windows和linux中搭建python集成开发环境IDE 2.[转]linux和windows下安装python集成开发环境及其python包 3.windows和l ...
随机推荐
- 下载新浪android SDK
下载新浪android SDK 必须去官网 开放平台下载 http://open.weibo.com/ 下载SDK 点击进入之后,看到的界面例如以下: 然后下载android SDK就可以.假设基于别 ...
- Linux网络编程--字节序
1 .谈到字节序,那么会有朋友问什么是字节序 非常easy:[比如一个16位的整数.由2个字节组成,8位为一字节,有的系统会将高字节放在内存低的地址上,有的则将低字节放在内存高的地址上,所以存在字节序 ...
- HDOJ 5357 Easy Sequence DP
a[i] 表示以i字符开头的合法序列有多少个 b[i] 表示以i字符结尾的合法序列有多少个 up表示上一层的'('的相应位置 mt[i] i匹配的相应位置 c[i] 包括i字符的合法序列个数 c[i ...
- 基本3D变换之World Transform, View Transform and Projection Transform
作者:i_dovelemon 来源:CSDN 日期:2014 / 9 / 28 主题:World Transform, View Transform , Projection Transform 引言 ...
- SDUT--Pots(二维BFS)
Pots Time Limit: 1000ms Memory limit: 65536K 有疑问?点这里^_^ 题目描写叙述 You are given two pots, having the ...
- 没有killall命令的解决方法
没有killall命令的解决方法 -bash: killall: command not found https://www.byte128.com/archives/231.html 执行killa ...
- 删除D盘空目录 、检索大于10M的文件
删除D盘空目录 @echo off for %%i in (d:\xx) do ( if exist %%i:\ ( for /f "delims=" %%a in ('dir / ...
- 【单词】常见单词含义的辨异(emulator/simulator、hardware/firmware)
1. emulator 与 simulator The Simulator tries to duplicate the behavior of the device.(仿真的是行为): The Em ...
- 69.fprintf fscanf
fprintf //从读文件中提取字符串到info1.user和info1.password中 fscanf(pfr, "%s%s", info1.user, info1.pass ...
- javafx image button
public class EffectTest extends Application { public static void main(String[] args) { launch(args); ...