I use JGit to create a new git repository and everything that is already in the folder I save as a new branch.
I use
Git.init().setDirectory(workingDir).call();
(by default, the main branch is created after the above statement, so I rename it to "backupBranch"). because I clone the master from the remote master later.
The problem is that I click backup, clicking it, but not the remote tracking that I can install.
from terminal: if I use git branch -vv
, result
master 5f1994c [origin/master] commitmsg
backupbranch 7a4d671 taking backup of file already in MyTests Folder..
According to Make Existing git Tracking Branch Remote Branch? I can use git branch -u upstream/foo
from the terminal to indicate any time after clicking on backupbranch.
JGit.
,
git.branchRename().setNewName(backUpName).call();
git.add().addFilepattern(".").call();
RevCommit commit = git.commit().setMessage("taking backup of file already in MyTests Folder..").call();
.
Iterable<PushResult> pushResult = git.push().call();
, , .