Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/centic9/jgit-cookbook
/ types & classes
Types & classes
83 in github.com/centic9/jgit-cookbook
⨍
Functions
139
◇
Types & classes
83
Class
AddAndListNoteOfCommit
Simple snippet which shows how to load Notes in a Git repository @author dominik.stadler at gmx.at
src/main/java/org/dstadler/jgit/porcelain/AddAndListNoteOfCommit.java:39
Class
AddFile
Simple snippet which shows how to add a file to the index @author dominik.stadler at gmx.at
src/main/java/org/dstadler/jgit/porcelain/AddFile.java:35
Class
ApiTest
src/test/java/org/dstadler/jgit/api/ApiTest.java:17
Class
AssumeChangedCommand
src/main/java/org/dstadler/jgit/unfinished/UpdateIndex.java:69
Class
BlameFile
src/main/java/org/dstadler/jgit/porcelain/BlameFile.java:18
Class
BrowseTree
Simple snippet which shows how to use RevWalk to iterate over items in a file-tree @author dominik.stadler at gmx.at
src/main/java/org/dstadler/jgit/unfinished/BrowseTree.java:34
Class
CheckMergeStatusOfCommit
Snippet which shows how to check if commits are merged into a given branch. See also http://stackoverflow.com/questions/26644919/how-to-determine-wit
src/main/java/org/dstadler/jgit/api/CheckMergeStatusOfCommit.java:33
Class
CheckoutGitHubPullRequest
Simple snippet which shows how to clone a repository from GitHub and then checkout a PR @author dominik.stadler at gmx.at
src/main/java/org/dstadler/jgit/porcelain/CheckoutGitHubPullRequest.java:37
Class
CleanUntrackedFiles
Simple snippet which shows how to list all Tags @author dominik.stadler at gmx.at
src/main/java/org/dstadler/jgit/porcelain/CleanUntrackedFiles.java:36
Class
CloneRemoteRepository
Simple snippet which shows how to clone a repository from a remote source @author dominik.stadler at gmx.at
src/main/java/org/dstadler/jgit/porcelain/CloneRemoteRepository.java:33
Class
CloneRemoteRepositoryIntoMemoryAndReadFile
Copyright 2019 Vasyl Khrystiuk https://github.com/msangel <p> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this fil
src/main/java/org/dstadler/jgit/porcelain/CloneRemoteRepositoryIntoMemoryAndReadFile.java:34
Class
CloneRemoteRepositoryWithApacheSSHD
Simple snippet which shows how to clone a repository from a remote source using the SSH protocol via the Apache SSHD libraries
src/main/java/org/dstadler/jgit/porcelain/CloneRemoteRepositoryWithApacheSSHD.java:36
Class
CloneRemoteRepositoryWithAuthentication
Simple snippet which shows how to clone a repository from a remote source via ssh protocol and username/password authentication. @author dominik.stad
src/main/java/org/dstadler/jgit/porcelain/CloneRemoteRepositoryWithAuthentication.java:38
Class
CollectGarbage
Simple snippet which shows how to execute the "gc" command to remove unused objects from the .git directory. @author dominik.stadler at gmx.at
src/main/java/org/dstadler/jgit/porcelain/CollectGarbage.java:37
Class
CommitAll
Simple snippet which shows how to commit all files @author dominik.stadler@gmx.at
src/main/java/org/dstadler/jgit/porcelain/CommitAll.java:20
Class
CommitFile
Simple snippet which shows how to commit a file @author dominik.stadler at gmx.at
src/main/java/org/dstadler/jgit/porcelain/CommitFile.java:35
Class
CookbookHelper
src/main/java/org/dstadler/jgit/helper/CookbookHelper.java:27
Class
CreateAndDeleteBranch
Simple snippet which shows how to create and delete branches @author dominik.stadler at gmx.at
src/main/java/org/dstadler/jgit/porcelain/CreateAndDeleteBranch.java:35
Class
CreateAndDeleteTag
Simple snippet which shows how to create a tag @author dominik.stadler at gmx.at
src/main/java/org/dstadler/jgit/porcelain/CreateAndDeleteTag.java:38
Class
CreateArchive
Simple snippet which shows how to package the contents of a branch into an archive file using a format provided by the org.eclipse.jgit.archive jar.
src/main/java/org/dstadler/jgit/porcelain/CreateArchive.java:39
Class
CreateCustomFormatArchive
Simple snippet which shows how to package the contents of a branch into an archive file using a custom compression format. @author dominik.stadler at
src/main/java/org/dstadler/jgit/porcelain/CreateCustomFormatArchive.java:47
Class
CreateListApplyAndDropStash
Simple snippet which shows how to use commands for stashing changes. @author dominik.stadler at gmx.at
src/main/java/org/dstadler/jgit/porcelain/CreateListApplyAndDropStash.java:38
Class
CreateNewRepository
Simple snippet which shows how to create a new repository @author dominik.stadler at gmx.at
src/main/java/org/dstadler/jgit/CreateNewRepository.java:31
Class
DiffFilesInCommit
Simple snippet which shows how to retrieve the diffs between two commits
src/main/java/org/dstadler/jgit/porcelain/DiffFilesInCommit.java:38
Class
DiffIndexChanges
Simple snippet which shows how to diff HEAD with the current "index". You may need to perform some local changes and add them to the index in order t
src/main/java/org/dstadler/jgit/porcelain/DiffIndexChanges.java:42
Class
DiffLocalChanges
Simple snippet which shows how to diff HEAD with the current working directory You may need to perform some local changes in order to make this snipp
src/main/java/org/dstadler/jgit/porcelain/DiffLocalChanges.java:42
Class
DiffRenamedFile
src/main/java/org/dstadler/jgit/porcelain/DiffRenamedFile.java:25
Class
FetchRemoteCommits
Simple snippet which shows how to fetch commits from a remote Git repository @author dominik.stadler at gmx.at
src/main/java/org/dstadler/jgit/porcelain/FetchRemoteCommits.java:34
Class
FetchRemoteCommitsWithPrune
Simple snippet which shows how to fetch commits from a remote Git repository @author dominik.stadler at gmx.at
src/main/java/org/dstadler/jgit/porcelain/FetchRemoteCommitsWithPrune.java:38
Class
FetchRemoteCommitsWithSshAuth
Simple snippet which shows how to fetch commits from a remote Git repository via ssh protocol authentication. You need to provide proper values for t
src/main/java/org/dstadler/jgit/porcelain/FetchRemoteCommitsWithSshAuth.java:26
Class
GetCommitMessage
Simple snippet which shows how to retrieve the commit-message based on object id.
src/main/java/org/dstadler/jgit/api/GetCommitMessage.java:30
Class
GetFileAttributes
Snippet which shows how to use RevWalk and TreeWalk to read the file attributes like execution-bit and type of file/directory/... @author dominik.sta
src/main/java/org/dstadler/jgit/api/GetFileAttributes.java:35
Class
GetRefFromName
Simple snippet which shows how to retrieve a Ref for some reference string.
src/main/java/org/dstadler/jgit/api/GetRefFromName.java:27
Class
GetRevCommitFromObjectId
Simple snippet which shows how to use RevWalk to iterate over objects
src/main/java/org/dstadler/jgit/api/GetRevCommitFromObjectId.java:31
Class
GetRevTreeFromObjectId
Simple snippet which shows how to use RevWalk to iterate over objects
src/main/java/org/dstadler/jgit/api/GetRevTreeFromObjectId.java:31
Class
InitRepository
Simple snippet which shows how to initialize a new repository @author dominik.stadler at gmx.at
src/main/java/org/dstadler/jgit/porcelain/InitRepository.java:35
Class
JGitBugTest
Tests which show issues with JGit that we reported upstream.
src/test/java/org/dstadler/jgit/JGitBugTest.java:18
Class
ListBranches
Simple snippet which shows how to list all Branches in a Git repository @author dominik.stadler at gmx.at
src/main/java/org/dstadler/jgit/porcelain/ListBranches.java:34
Class
ListChildrenOfCommit
Note: This snippet is not done and likely does not show anything useful yet Snippet which shows how to use PlotWalk to read from a specific commit.
src/main/java/org/dstadler/jgit/unfinished/ListChildrenOfCommit.java:36
Class
ListCommitsForFilePattern
Simple snippet which shows how to find all commits that touch files matching a file pattern such as " .md".
src/main/java/org/dstadler/jgit/porcelain/ListCommitsForFilePattern.java:42
Class
ListFilesOfCommitAndTag
Simple snippet which shows how to get a list of files/directories based on a specific commit or a tag.
src/main/java/org/dstadler/jgit/api/ListFilesOfCommitAndTag.java:37
Class
ListIndex
Snippet which shows how to work with the Index @author dominik.stadler at gmx.at
src/main/java/org/dstadler/jgit/unfinished/ListIndex.java:31
Class
ListNotes
Simple snippet which shows how to load Notes in a Git repository @author dominik.stadler at gmx.at
src/main/java/org/dstadler/jgit/porcelain/ListNotes.java:36
Class
ListRefLog
Note: This snippet is not done and likely does not show anything useful yet @author dominik.stadler at gmx.at
src/main/java/org/dstadler/jgit/unfinished/ListRefLog.java:37
Class
ListRemoteRepository
Simple snippet which shows how to list heads/tags of remote repositories without a local repository @author dominik.stadler at gmx.at
src/main/java/org/dstadler/jgit/porcelain/ListRemoteRepository.java:33
Class
ListRemotes
Snippet which shows how to iterate remotes, i.e. "git ls-remote" @author dominik.stadler at gmx.at
src/main/java/org/dstadler/jgit/porcelain/ListRemotes.java:33
Class
ListTags
Simple snippet which shows how to list all Tags @author dominik.stadler at gmx.at
src/main/java/org/dstadler/jgit/porcelain/ListTags.java:35
Class
ListTagsOnBranch
A snippet which fetches all the tags of the repository and then walks commits on a given branch and prints out whenever a tag is found for a commit.
src/main/java/org/dstadler/jgit/porcelain/ListTagsOnBranch.java:41
Class
ListUncommittedChanges
Simple snippet which shows how to list various types of uncommitted changes of a Git repository @author dominik.stadler at gmx.at
src/main/java/org/dstadler/jgit/porcelain/ListUncommittedChanges.java:38
Class
Main
A very simple Git Server which allows to clone a Git repository. Currently it will return the same repository for any name that is requested, there is
httpserver/src/main/java/org/dstadler/jgit/server/Main.java:34
Class
MergeChanges
Snippet which shows how to merge changes from another branch.
src/main/java/org/dstadler/jgit/porcelain/MergeChanges.java:38
Class
OpenRepository
Simple snippet which shows how to open an existing repository @author dominik.stadler at gmx.at
src/main/java/org/dstadler/jgit/OpenRepository.java:35
Class
PorcelainTest
src/test/java/org/dstadler/jgit/porcelain/PorcelainTest.java:7
Class
PrintRemotes
Simple snippet which shows how to retrieve the list of remotes from the configuration
src/main/java/org/dstadler/jgit/api/PrintRemotes.java:29
Class
PullFromRemoteRepository
Note: This snippet is not done and likely does not show anything useful yet @author dominik.stadler at gmx.at
src/main/java/org/dstadler/jgit/unfinished/PullFromRemoteRepository.java:33
Class
PullRemoteRepository
Note: This snippet is not done and likely does not show anything useful yet Simple snippet which shows how to pull from a remote repository from a re
src/main/java/org/dstadler/jgit/unfinished/PullRemoteRepository.java:38
Class
PushToRemoteRepository
Note: This snippet is not done and likely does not show anything useful yet @author dominik.stadler at gmx.at
src/main/java/org/dstadler/jgit/porcelain/PushToRemoteRepository.java:38
Class
ReadBlobContents
Simple snippet which shows how to retrieve a Ref for some reference string.
src/main/java/org/dstadler/jgit/api/ReadBlobContents.java:32
Class
ReadFileFromCommit
Snippet which shows how to use RevWalk and TreeWalk to read the contents of a specific file from a specific commit. @author dominik.stadler at gmx.at
src/main/java/org/dstadler/jgit/api/ReadFileFromCommit.java:38
Class
ReadTagFromName
Simple snippet which shows how to use RevWalk to read tags
src/main/java/org/dstadler/jgit/api/ReadTagFromName.java:31
Class
ReadUserConfig
Simple snippet which shows how to retrieve the user name and email that is configured in Git.
src/main/java/org/dstadler/jgit/api/ReadUserConfig.java:28
Class
RebaseToOriginMaster
Snippet which shows how to rebase local changes onto a remote branch. See also http://stackoverflow.com/questions/22945257/jgit-how-to-squash-commits
src/main/java/org/dstadler/jgit/porcelain/RebaseToOriginMaster.java:41
Class
ResolveRef
Simple snippet which shows how to retrieve an ObjectId for some name.
src/main/java/org/dstadler/jgit/api/ResolveRef.java:30
Class
RevertChanges
Simple snippet which shows how to set a modified tracked file back to its state in the most recent commit. This does not make a new commit that revert
src/main/java/org/dstadler/jgit/porcelain/RevertChanges.java:25
Class
RevertCommit
Simple snippet which shows how to revert a previous commit @author JordanMartinez
src/main/java/org/dstadler/jgit/porcelain/RevertCommit.java:19
Class
ShowBlame
Simple snippet which shows how to get a diff showing who changed which line in a file. It uses HEAD~~ to select the version of README.md two commits
src/main/java/org/dstadler/jgit/porcelain/ShowBlame.java:52
Class
ShowBranchDiff
Simple snippet which shows how to show diffs between branches @author dominik.stadler at gmx.at
src/main/java/org/dstadler/jgit/porcelain/ShowBranchDiff.java:42
Class
ShowBranchTrackingStatus
Snippet which shows how to use BranchTrackingStatus to print how many commits away the local git repository is from the remote branches. @author domi
src/main/java/org/dstadler/jgit/api/ShowBranchTrackingStatus.java:37
Class
ShowChangedFilesBetweenCommits
Snippet which shows how to show diffs between two commits. @author dominik.stadler at gmx.at
src/main/java/org/dstadler/jgit/porcelain/ShowChangedFilesBetweenCommits.java:38
Class
ShowFileDiff
Simple snippet which shows how to show diffs between branches @author dominik.stadler at gmx.at
src/main/java/org/dstadler/jgit/porcelain/ShowFileDiff.java:43
Class
ShowLog
Simple snippet which shows how to get the commit-ids for a file to provide log information. @author dominik.stadler at gmx.at
src/main/java/org/dstadler/jgit/porcelain/ShowLog.java:40
Class
ShowStatus
Simple snippet which prints the Status of a git repository, i.e. modified/added/ removed/ignored files, similar to "git status" @author dominik.stadl
src/main/java/org/dstadler/jgit/porcelain/ShowStatus.java:35
Class
SimpleProgressMonitor
src/main/java/org/dstadler/jgit/helper/SimpleProgressMonitor.java:5
Class
TestSubmodules
Note: This snippet is not done and likely does not show anything useful yet @author dominik.stadler at gmx.at
src/main/java/org/dstadler/jgit/unfinished/TestSubmodules.java:35
Class
TrackMaster
Note: This snippet is not done and likely does not show anything useful yet @author dominik.stadler at gmx.at
src/main/java/org/dstadler/jgit/porcelain/TrackMaster.java:35
Class
UpdateIndex
Note: This snippet is not done and likely does not show anything useful yet Snippet which shows how to mark files as assumed-unchanged (git update-in
src/main/java/org/dstadler/jgit/unfinished/UpdateIndex.java:41
Class
WalkAllCommits
Simple snippet which shows how to use RevWalk to iterate over all commits across all branches/tags/remotes in the given repository See the original d
src/main/java/org/dstadler/jgit/api/WalkAllCommits.java:35
Class
WalkAllCommits
Simple snippet which shows how to use RevWalk to quickly iterate over all available commits, not just the ones on the current branch
src/main/java/org/dstadler/jgit/porcelain/WalkAllCommits.java:31
Class
WalkFromToRev
Simple snippet which shows how to use RevWalk to iterate over objects
src/main/java/org/dstadler/jgit/api/WalkFromToRev.java:30
Class
WalkRev
Simple snippet which shows how to use RevWalk to iterate over objects
src/main/java/org/dstadler/jgit/api/WalkRev.java:32
Class
WalkTreeNonRecursive
Simple snippet which shows how to use RevWalk to iterate over items in a file-tree See {@link WalkTreeNonRecursive} for a different usage of the {@li
src/main/java/org/dstadler/jgit/api/WalkTreeNonRecursive.java:37
Class
WalkTreeRecursive
Simple snippet which shows how to use RevWalk to iterate over items in a file-tree. See {@link WalkTreeNonRecursive} for a different usage of the {@l
src/main/java/org/dstadler/jgit/api/WalkTreeRecursive.java:36
Class
ZipArchiveFormat
A simple custom format for Zip-files via ZipOutputStream, JGit only has one via commons-compress
src/main/java/org/dstadler/jgit/porcelain/CreateCustomFormatArchive.java:53