我有蚂蚁脚本,适用于clearcase。谁能帮我将其转换为GIT [英] I have ant script which works for clearcase. Can any one help me to convert it to GIT

查看:131
本文介绍了我有蚂蚁脚本,适用于clearcase。谁能帮我将其转换为GIT的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将一个应用程序从明确的案例迁移到GIT。编写构建脚本以增加构建号,并根据明文情况编写。现在,我必须使其适用于GIT。任何人都请我修改以下代码以使其适用于GIT。
我已将可执行路径更改为GIT.exe。因此,我只是帮助将清晰的命令转换为GIT。

I am migrating one application from clear case to GIT. A build script is written to increment build number and it is written with respect to clear case. And now I have to make it work for GIT. Anyone kindly help me to modify below code to make it work for GIT. I have changed the executable path to GIT.exe. So I just help to convert clear case commands to GIT.

<target name="decBuildNo">
    <trycatch property="exception">
        <try>
            <exec dir="${basedir}\calcBuild" executable="${cleartool}" failonerror="true">
                <arg value="update"/>
                <arg value="setenvs.bat"/>
            </exec>
            <!-- update the build number in setenvs.bat and check in-->
            <exec dir="${basedir}\calcBuild" executable="${cleartool}" failonerror="true">
                <arg value="co"/>
                <arg value="-c"/>
                <arg value="&quot;bump version number&quot;"/>
                <arg value="setenvs.bat"/>
            </exec>
            <decrbuild buildNumberKey="CALCMGR_BUILD_NO" fileName="${basedir}\calcBuild\setenvs.bat"/>
            <exec dir="${basedir}\calcBuild" executable="${cleartool}" failonerror="true">
                <arg value="ci"/>
                <arg value="-c"/>
                <arg value="&quot;bump version number&quot;"/>
                <arg value="setenvs.bat"/>
            </exec>
        </try>
        <catch>
            <echo>Increment build number failed: ${exception}</echo>
            <antcall target="buildfailed"/>
            <fail>${exception}</fail>
        </catch>
    </trycatch>
</target>


推荐答案

等效于:

如果您只想更新一个文件 setenvs.bat ,则需要:

If you really want to update only one file setenvs.bat, you would need:

git fetch
git checkout HEAD -- setenvs.bat

git checkout not cleartool checkout(co):它将更新文件内容,而不是创建可写副本。

请参阅 保留结帐和未保留结帐有什么区别?,我将其与Git。

git checkout is not cleartool checkout (co): it updates the file content, it does not "creates a writable copy".
See "What is the difference between a reserved checkout and an unreserved checkout?", where I do compare it with Git.

cleartool ci :您需要添加,提交和推送

cleartool ci: you would need to add, commit and push

即:

git add setenvs.bat
git commit -m "bump version number"
git push

  • "What are the basic ClearCase concepts every developer should know?" (March 2009)
  • "ClearCase advantages/disadvantages"

这篇关于我有蚂蚁脚本,适用于clearcase。谁能帮我将其转换为GIT的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆