Package org.eclipse.jgit.lib
Class BranchConfig
- java.lang.Object
-
- org.eclipse.jgit.lib.BranchConfig
-
public class BranchConfig extends Object
Branch section of a Git configuration file.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
BranchConfig.BranchRebaseMode
Config values for branch.[name].rebase (and pull.rebase).
-
Field Summary
Fields Modifier and Type Field Description static String
LOCAL_REPOSITORY
The value that means "local repository" forgetRemote()
: "."
-
Constructor Summary
Constructors Constructor Description BranchConfig(Config config, String branchName)
Create a new branch config, which will read configuration from config about specified branch.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getMerge()
Get the name of the upstream branch as it is called on the remoteString
getPushRemote()
Get the remote this branch is configured to push to.BranchConfig.BranchRebaseMode
getRebaseMode()
Retrieves the config value of branch.[name].rebase.String
getRemote()
Get the remote this branch is configured to fetch from/push toString
getRemoteTrackingBranch()
Get the full remote-tracking branch nameString
getTrackingBranch()
Get the full tracking branch nameboolean
isRebase()
Whether the branch is configured to be rebasedboolean
isRemoteLocal()
Whether the "remote" setting points to the local repository (with ".")
-
-
-
Field Detail
-
LOCAL_REPOSITORY
public static final String LOCAL_REPOSITORY
The value that means "local repository" forgetRemote()
: "."- Since:
- 3.5
- See Also:
- Constant Field Values
-
-
Method Detail
-
getTrackingBranch
public String getTrackingBranch()
Get the full tracking branch name- Returns:
- the full tracking branch name or
null
if it could not be determined
-
getRemoteTrackingBranch
public String getRemoteTrackingBranch()
Get the full remote-tracking branch name- Returns:
- the full remote-tracking branch name or
null
if 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:
true
if the "remote" setting points to the local repository (with "."), false otherwise- Since:
- 3.5
-
getRemote
public String 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
null
if not defined - Since:
- 3.5
-
getPushRemote
public String getPushRemote()
Get the remote this branch is configured to push to.- Returns:
- the remote this branch is configured to push to, or
null
if not defined - Since:
- 6.1
-
getMerge
public String 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
null
if not defined - Since:
- 3.5
-
isRebase
public boolean isRebase()
Whether the branch is configured to be rebased- Returns:
true
if the branch is configured to be rebased- Since:
- 3.5
-
getRebaseMode
public BranchConfig.BranchRebaseMode getRebaseMode()
Retrieves the config value of branch.[name].rebase.- Returns:
- the
BranchConfig.BranchRebaseMode
- Since:
- 4.5
-
-