如何标记(基本标记)具有先前提交和标记的git存储库(完整存储库)?

时间:2017-08-09 09:23:31

标签: java git jgit

我正在尝试使用以下代码为我的项目(即存储库)添加一个基本标记,其中包含许多以前的提交和标记:

Git git = Git.open(new File("local path"));
TagCommand tagcmd = git.tag().setName(tagName).setMessage(message)
Ref ref = tagcmd.call();
SshSessionFactory.setInstance(new JschConfigSessionFactory() {

    @Override
    protected void configure(Host host, Session session) {
        session.setPassword(remotePassword);
    }
});

PushCommand cmd = git.push().add(ref);
cmd.call();

当上面的代码运行时,标记被添加到最后一次提交,并不会反映在所有文件中。我希望此标记位于存储库中的所有文件中。

如何标记(基本标记)我现有的具有先前提交和标记的仓库?

0 个答案:

没有答案