I am using JGit to clone repository, make some changes in file, commit, tag it, and then push it to remote repository.
I have written code using JGit, which will clone repository, make some change in file, then commit the change, create new tag and push the commit and tag.
Git git = Git.cloneRepository()
.setURI("https://*****@stash.dts.*****.git")
.setDirectory(outputFolder)
.call();
// Some code to update the file
git.add().addFilepattern(".").call();
git.commit().setMessage("File Commit").call();
// Creating tag
git.tag().setName(version).setForceUpdate(true).call();
// Pushing the commit and tag
git.push().call();
After push, I expect the remote repository to show my change and new tag, but change with commitId is showing in remote repoitory but tag is not visible. It's showing 'No Tags'.