git-svn — 让git和svn协同工作 【工具版】

background

My company is using SVN to be code management tool. I have no rights to commit, and I must export the different files to my leader to commit. For my local work conveniently , I need a local repository. So I research git and svn, and find they can cooperate.

Environments prepare

• Download and Install Git
https://git-scm.com/
• Download and Install SmartGit
http://www.syntevo.com/smartgit/
• Download and Install TortoiseGit
https://tortoisegit.org/

Clone project

  1. Open SmartGit , click the navigation : Repository -> Clone…

    这里写图片描述
    这里写图片描述
    这里写图片描述
    Noted, there are two patterns. The first is to clone all versions, and the second is to clone from the specified version. The second spends less time, which applies for cloning branch temporally, such as for bug fix.

Local develop using git

  1. Pull the latest code
    Click the repository, and click Pull button.
    这里写图片描述
    2.Save local change
    Select the changed files, and click Commit button
    这里写图片描述
    Input some message to mark
    这里写图片描述
    There are no changed files any more. If you want to look the detail, click the button Log.
    这里写图片描述
    There are some other useful functions besides mentioned, and you can try to use it.

Export the changed files

As SmartGit has no export function, I exported the changed files by TortoiseGit.
1.In project root directory, right click TortoiseGit -> Show log
• If you want to export in one commit, please select the commit in the log, and execute like below.
这里写图片描述
• If you want to export many commits, you need to combine these commits first like below, and then export like export one commit.
这里写图片描述

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
git-svn 是一个桥接工具,用于在 Git 和 Subversion (SVN) 之间进行转换和交互。下面是 git-svn 的安装配置过程。 安装 Git: 1. 在官网 (https://git-scm.com/downloads) 上下载适合你操作系统的 Git 安装程序。 2. 打开安装程序并按照指示进行安装。 3. 验证安装是否成功,在命令提示符或终端上运行 "git --version" 命令,如果出现 Git本号信息,则说明安装成功。 配置 Git: 1. 打开命令提示符或终端,并运行以下命令来配置你的 Git 用户名和邮箱: ``` git config --global user.name "你的用户名" git config --global user.email "你的邮箱地址" ``` 安装 Git-svn 桥接工具: 1. 在命令提示符或终端上运行以下命令安装 Git-svn: - 在 Ubuntu 上使用 apt-get: ``` sudo apt-get install git-svn ``` - 在 macOS 上使用 Homebrew: ``` brew install git-svn ``` - 在 Windows 上使用 Scoop: ``` scoop install git-svn ``` 配置 Git-svn: 1. 在命令提示符或终端上运行以下命令配置 Git-svn: ``` git svn init [SVN 仓库 URL] -s ``` 2. 这将为你的 Git 仓库创建一个指向 SVN 仓库的远程“refs/remotes/origin/trunk”引用。 3. 运行以下命令来下载远程 SVN 仓库的历史记录: ``` git svn fetch ``` 4. 这将下载远程 SVN 仓库的历史记录到你的本地 Git 仓库。 5. 当你想要提交更改时,使用 Git 的命令,例如 "git add"、"git commit"等来管理更改,并使用以下命令将更改推送到 SVN 仓库: ``` git svn dcommit ``` 以上是 git-svn 的安装配置过程。-git提供了更快速、灵活、分布式的本控制系统,而git-svn桥接工具则使得想要在 git 和 Subversion (SVN)之间进行转换和交互的用户能够灵活使用两种工具

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值