Home » Tag Archives: Git

Tag Archives: Git

Access Git repositories with Java using SSH keys

For some use-cases you might access a git repository from a Java application. JGit offers a helpful integration with builder pattern APIs. The Git client can authenticate itself using SSH keys. To open a Git repository call the cloneRepository() command. File workingDir = Files.createTempDirectory("workspace").toFile(); TransportConfigCallback transportConfigCallback = new SshTransportConfigCallback(); git = Git.cloneRepository() .setDirectory(workingDir) .setTransportConfigCallback(transportConfigCallback) .setURI("ssh://example.com/repo.git") .call(); Our own implementation of ...

Read More »

How to create new Git Repository and host it in Bitbucket

What is Git ? While working in a team which involves multiple developers,it is very much necessary to use a Version Control System. Version Control System is basically a Software using which – Multiple developers can put their code in(Check In). – Take (Check Out) the code of fellow Software developers. – See the version history of the files(Who committed ...

Read More »

Pimp my Git – Manage Different Git Identities

I usually work on different Git projects that need different Git identities. My work flow for new repositories was Clone new repository. Go to cloned repository. If it is necessary to change the Git identity, call a shell script that runs `git config user.name “Sandra Parsick”; git config user.email sparsick@web.de` I was never happy with this solution, but it works. ...

Read More »

Pimp My Git – Git Mergetool

I like to work with git on the command line. But in some cases I prefer UI support. For example, solving merge conflicts is such a case. Git has a command mergetool, which can open a graphical tool to solve merge conflicts. But before you can use this command, you had to configure it. In this blog post I’d like ...

Read More »

Authenticating with JGit

JGit is a lightweight, pure Java library implementing the Git version control system. You can do a lot of operations using Java language such as create or clone Git repos, create branches, make commits, rebase or tag, you can see this repo to learn how to use JGit and how to code the different commands. But one thing that does not ...

Read More »

Git Tutorial – The Ultimate Guide (PDF Download)

Git is, without any doubt, the most popular version control system. Ironically, there are other version control systems easier to learn and to use, but, despite that, Git is the favorite option for developers, which is quite clarifying about the powerfulness of Git. This guide will cover all the topics needed to know in order to use Git properly, from ...

Read More »

Why I Prefer Merge Over Rebase

There are many ways to work with git. The workflows vary depending on the size of the team, organization, and on the way of working – is it distributed, is it sprint-based, is it a company, or an open-source project, where a maintainer approves pull requests. You can use vanilla-git, you can use GitHub, BitBucket, GitLab, Stash. And then on ...

Read More »