Home » Git

Tag Archives: Git

The Linear Git History

A lot of teams follow these rules. The question is why!? The rules are: Use GitHub flow – i.e. master is the stable trunkEverything else should be a feature branchFeature branches are merged to master with pull requestsNo matter how many commits are made to achieve the last HEAD of a feature branch, they should all be squashed into a ...

Read More »

Jenkins: Automating your delivery pipeline

In this post, we are going to create a Jenkins pipeline for a Java Spring project using Maven and Git: Accessing Jenkins dashboard and configuring Maven in Jenkins: Click on “Manage Jenkins” and then in “Global Tool Configuration” Add a Maven installation and provide a name for it. Click on Save. Creation of our first build job in Jenkins for ...

Read More »

Top Git Commands With Examples

A quick guide to how to use git commands and what are the top command that used by every developer in their daily life. 1. Introduction In this tutorial, You’ll learn what are the git commands that can be used in everyday life. You’ll see the top git commands with examples. You can not imagine a developer’s life without using ...

Read More »

Git switch and restore

If you’ve been using Git for a while you’re probably used to the ubiquitous git checkout command, which is somewhat overloaded in what it’s doing. You can use checkout to switch branches, create branches, update the working tree to a past commit, wiping working tree changes, and a few more things. Put simply, this command has too many responsibilities, and ...

Read More »

What The Commit!?

Committing in Git is The Future Whatever you write in your git commit history is what you’ll be going back to at some point in the future to understand how the source code got to where it’s at now. There are a couple of things that seem to work well when managing commits in git: Don’t have more commits than ...

Read More »

Create Git patches from command line

Git patches are an easy way to apply changes to a project if you don’t want to go through the regular commit-pull-request flow. Patches are files that contain an equivalent diff of a Git commit. You can create a patch of your modified working state using git diff. The diff output is in the correct patch format. $> git status ...

Read More »

Global gitignore

A widely used Git feature is to use local .gitignore files which list which names and patterns of files and directories will be ignored within the Git repository. There is also the possibility to create a system-wide gitignore file which lists patterns that should always be ignored, in all of the user’s Git repositories. You can point to the file ...

Read More »