Package org.eclipse.jgit.lib
Class BranchConfig
java.lang.Object
org.eclipse.jgit.lib.BranchConfig
Branch section of a Git configuration file.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumConfig values for branch.[name].rebase (and pull.rebase). -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe value that means "local repository" forgetRemote(): "." -
Constructor Summary
ConstructorsConstructorDescriptionBranchConfig(Config config, String branchName) Create a new branch config, which will read configuration from config about specified branch. -
Method Summary
Modifier and TypeMethodDescriptiongetMerge()Get the name of the upstream branch as it is called on the remoteRetrieves the config value of branch.[name].rebase.Get the remote this branch is configured to fetch from/push toGet the full remote-tracking branch nameGet the full tracking branch namebooleanisRebase()Whether the branch is configured to be rebasedbooleanWhether the "remote" setting points to the local repository (with ".")
-
Field Details
-
LOCAL_REPOSITORY
The value that means "local repository" forgetRemote(): "."- Since:
- 3.5
- See Also:
-
-
Constructor Details
-
BranchConfig
Create a new branch config, which will read configuration from config about specified branch.- Parameters:
config- the config to read frombranchName- the short branch name of the section to read
-
-
Method Details
-
getTrackingBranch
Get the full tracking branch name- Returns:
- the full tracking branch name or
nullif it could not be determined
-
getRemoteTrackingBranch
Get the full remote-tracking branch name- Returns:
- the full remote-tracking branch name or
nullif it could not be determined. If you also want local tracked branches usegetTrackingBranch()instead.
-
isRemoteLocal
public boolean isRemoteLocal()Whether the "remote" setting points to the local repository (with ".")- Returns:
trueif the "remote" setting points to the local repository (with "."), false otherwise- Since:
- 3.5
-
getRemote
Get the remote this branch is configured to fetch from/push to- Returns:
- the remote this branch is configured to fetch from/push to, or
nullif not defined - Since:
- 3.5
-
getMerge
Get the name of the upstream branch as it is called on the remote- Returns:
- the name of the upstream branch as it is called on the remote, or
nullif not defined - Since:
- 3.5
-
isRebase
public boolean isRebase()Whether the branch is configured to be rebased- Returns:
trueif the branch is configured to be rebased- Since:
- 3.5
-
getRebaseMode
Retrieves the config value of branch.[name].rebase.- Returns:
- the
BranchConfig.BranchRebaseMode - Since:
- 4.5
-