46 KiB
Git and Patterns for Managing Source Code Branches. Merge BOTs
- Git Distributed Version-Control System
- Git Interview Questions
- Shields
- Design By Contract
- Git Cheat Sheets
- Monorepo VS Polyrepo
- Patterns for Managing Source Code Branches (Branching Models/Workflows)
- Git Commands
- BitBucket
- GitLab
- GitHub
- Gitea
- Git Tools
- Azure DevOps (formerly known as VSTS)
- Pre Commit Hooks
- Merge BOTs
Git Distributed Version-Control System
- Wikipedia: Git
- Git
- devdocs.io/git/
- tutorialzine.com: Learn git in 30 minutes 🌟
- 3 Git Commands I Use Every Day
- Git and Github in Plain English
- opensource.com: How to restore older file versions in Git
- 9 awesome git tricks
- Awesome Git 🌟
- dzone.com: intro git 🌟
- dzone.com: Top 20 git commands with examples 🌟
- dzone.com: 8 Useful But Not Well-Known Git Concepts These lesser-known Git tricks can help you solve problems that are not handled well by the GitHub and BitBucket GUIs
- dzone.com: Git Commands Tutorial - Part 1
- dzone.com: Git Commands Tutorial - Part 2
- Dzone refcard: Getting started with Git
- Oh shit, git!
- How to Get More Out of Your Git Commit Message
- 10 useful Git commands you wish existed – and their alternatives
- github.blog: How to undo (almost) anything with Git
- dev.to: Git Explained - The Basics
- medium: 7 Best Courses to Master Git and Github for Programmers These are the best courses to learn Git from scratch and also advanced concepts like branching and merging. It also includes a free course to learn git.
- medium: Top 7 Cloud Source Code Management Tools Features and Pricing Plans
- towardsdatascience.com: The 6 Git Commands Data Scientist Should Know An introduction to using Git for machine learning projects.
- dev.to: Git Concepts I Wish I Knew Years Ago 🌟
- opensource.com: 6 best practices for managing Git repos Resist the urge to add things in Git that will make it harder to manage; here's what to do instead.
- codeburst.io: Debug your code using git bisect
- github.blog: Highlights from Git 2.28
- codeburst.io: A Resource for all Things Git
- Things You Want to Do in Git and How to Do Them
- Learn Git Branching 🌟 An interactive Git visualization tool to educate and challenge!
- livecodestream.dev: Git Concepts and Workflow for Beginners
- thenextweb.com: A beginner’s guide to the most popular Git commands
- devroom.io: Git Squash your latests commits into one
- julien.danjou.info: Stop merging your pull requests manually 🌟 -> mergify 🌟
- gitlab.com: How to keep your Git history clean with interactive rebase Interactive rebase is one of Git’s most versatile tools. Here's how to use it to correct commit messages, fix mistakes, and more.
- opensource.com: 8 Git aliases that make me more efficient Use aliases to create shortcuts for your most-used or complex Git commands.
- gitkraken.com: Git Tutorials: Instructional Training Videos 🌟
- github.blog: Token authentication requirements for Git operations
- github.blog: Commits are snapshots, not diffs
- github.blog: Get up to speed with partial clone and shallow clone
- about.gitlab.com: How Git Partial Clone lets you fetch only the large file you need
- gitkraken.com: How do you rename a Git branch?
- intellipaat.com: Git Tutorial - Learn Git 🌟
- freecodecamp.org: Git Checkout Remote Branch Tutorial
- freecodecamp.org: How to Use Multiple Git Configs on One Computer 🌟
- freecodecamp.org: How to Use Branches in Git – the Ultimate Cheatsheet 🌟
- dev.to: Git for beginners
- blog.gitguardian.com: Rewriting your git history, removing files permanently - cheatsheet & guide
- smashingmagazine.com: Getting The Most Out Of Git
- thenewstack.io: Why Open Source Project Maintainers are Reluctant to use Digital Signatures, Two-Factor Authentication
- geeksforgeeks.org: How to Write Good Commit Messages in GitHub?
- freecodecamp.org: What is Git? A Beginner's Guide to Git Version Control
- dev.to: ELI5: Git Rebase vs. Merge 🌟
- c-sharpcorner.com: 0 Git Commands You Should Know
- opensource.com: 3 reasons I use the Git cherry-pick command Cherry-picking solves a lot of problems in Git repositories. Here are three ways to fix your mistakes with git cherry-pick.
- opensource.com: Find what changed in a Git commit Git offers several ways you can quickly see which files changed in a commit.
- freecodecamp.org: How to Use Git and Git Workflows – a Practical Guide
- opensource.com: A practical guide to using the git stash command Learn how to use the git stash command and when you should use it.
- stackoverflow.blog: A look under the hood: how branches work in Git Git branches allow you to keep different versions of your code cleanly separated. Here's a look at how they work and why you should know about them.
- about.gitlab.com: Why small merge requests are key to a great review 🌟
- opensource.com: 4 tips for context switching in Git Compare the pros and cons of four options to switch branches while working in Git.
- dzone: GitOps: How to Ops Your Git the Right Way 🌟 In this article we’ll look into the specifics of creating Git repositories structures — the very core of the GitOps approach.
- freecodecamp.org: Git Push to Remote Branch – How to Push a Local Branch to Origin
- honeybadger.io: Top Ten Git Tips & Tricks
- blog.balasundar.com: Automate Git Operations Using Python Automate your git operations using GitPython.
Git Interview Questions
- intellipaat.com: Top Git Interview Questions And Answers 🌟
- automationreinvented.blogspot.com: Top GIT Interview question Set-03 for SDET/Testers/Developers/DevOps?
Shields
Design By Contract
Wikipedia: Design by contract (DbC), also known as contract programming, programming by contract and design-by-contract programming, is an approach for designing software.
It prescribes that software designers should define formal, precise and verifiable interface specifications for software components, which extend the ordinary definition of abstract data types with preconditions, postconditions and invariants. These specifications are referred to as "contracts", in accordance with a conceptual metaphor with the conditions and obligations of business contracts.
Git Cheat Sheets
Monorepo VS Polyrepo
- fourtheorem.com: How to end Microservice pain and embrace the Monorepo
- medium: The Pros and Cons of Monorepos, Explained Should you keep all of your code in a single directory?
Patterns for Managing Source Code Branches (Branching Models/Workflows)
- paulhammant.com: What is Your Branching Model?: Mainline, Cascade, Trunk-Based Development, Short Lived Feature Branches, Continuous Deployment, Subversion noise on branching, etc.
- adevait.com: Creating a Branching Strategy for Small Teams
- atlassian.com: Configuring branching models 🌟
- git-scm.com: Git Branching - Branching Workflows
- git-scm.com: Distributed Git - Distributed Workflows
- Dzone refcard: Git Patterns and Anti-Patterns Scaling from Workgroup to Enterprise. Suggests patterns and anti-patterns, including Hybrid SCM, Git champions, blessed repository, per-feature topic branches, and ALM integration.
- Dzone: Basic Git Branching In this article, we walk through the basics of branching with Git to get you started with better managing your versioning during projects.
- martinfowler.com: Patterns for Managing Source Code Branches
- Release Branch Pattern: A branch that only accepts commits accepted to stabilize a version of the product ready for release.
- medium: Which Git branching model should I select for my project?
- speakerdeck.com: 10 Git Anti Patterns You Should be Aware of 🌟
- Dzone: Git Branch Naming Conventions A primer on naming branches for modern git workflows.
- gitkraken.com: Branching in Git 🌟
Git Workflows
git help workflows- atlassian.com: Comparing Workflows 🌟
- GitLab Flow
- GitHub Flow
- Git Flow
- Git DMZ Flow
- kubernetes.dev: GitHub Workflow An overview of the GitHub workflow used by the Kubernetes project. It includes some tips and suggestions on things such as keeping your local environment in sync with upstream and commit hygiene.
Trunk Based Development
- Trunk Based Development
- paulhammant.com: What is Trunk-Based Development?
- The Origins of Trunk Based Development
- quora.com: What is trunk based development?
- kean.github.io: Trunk-Based Development
- paulhammant.com: Microsoft's Trunk-Based Development
- devblogs.microsoft.com: Release Flow: How We Do Branching on the VSTS Team
Feature Branch Development (aka GitFlow)
Git Flow
- One of the main concepts of GitFlow is feature branches. The idea is that each feature should be developed in its own branch. When the feature is done, it gets merged into develop branch.
- devopszone.info: An Introduction To Git-flow Workflow
- atlassian.com: Gitflow Workflow
- gitkraken.com: GitFlow is a list of rules to keep a repo’s history organized, and is used to make the release process, bug fixes, and feature creation easier.
- git-flow.readthedocs.io
- medium.com: Gitflow — Branch Guide
- medium.com: Git Flow for Beginners
- medium.com: What is GitFlow?
- gist.github.com/JamesMGreene: A comparison of using
git flowcommands versus rawgitcommands - Git-flow cheatsheet
- aprendegit.com: git-flow: la rama develop y uso de feature branches
Trunk-based Development vs. Git Flow
- toptal.com: Trunk-based Development vs. Git Flow
- victorops.com: Source Code Control: Trunk-Based Development vs. GitFlow
- medium: GitFlow VS Trunk-Based-Development
- Dzone: Why I Prefer Trunk-Based Development Over Feature Branching and GitFlow 🌟 Check out the components of Trunk-based Development as implemented by Facebook and Google, and see how it helps resolve and prevent merge conflicts.
- team-coder.com: From Git Flow to Trunk Based Development
- stridenyc.com/podcasts: Trunk Based Development vs Gitflow
- freecodecamp.org: What is Trunk Based Development? A Different Approach to the Software Development Lifecycle
Alternative Branching Models
Feature Flags (Feature Toggles)
- featureflags.io: Flags vs Branching Branch better with feature flag driven development.
- martinfowler.com: Feature Toggles (aka Feature Flags)
- #FeatureFlags
- CloudBees Releases Another Industry First: Feature Flagging for On-Premise Use 🌟
- cioperu.pe: 5 formas de impulsar la utilización de feature flags
- cloudbees.com: Testing with Feature Flags to Improve Developer Productivity
- cloudbees.com: Goodbye Sleepless Nights: De-Risking Deployments with Feature Flags
- thenewstack.io: Wave Goodbye to Release Nights
- infoworld.com: Why aren’t you using feature flags? Software development is changing. If you’re still focused on release management rather than feature management, then you’re doing it wrong.
- cloudbees.com: How to Grow Continuous Delivery Maturity Using Feature Flags
- cloudbees.com: Feature Flag Best Practices: Change Management in Production
- cloudbees.com: Feature Flag Best Practices: Understanding the Feature Flag Lifecycle
- github.blog: How we ship code faster and safer with feature flags
- cloudbees.com: The Importance of Feature Flags in CI/CD
Keystone Interface and Keystone Flags
Git Commands
- Show commit logs:
git log --oneline --all --graph --decorate
git reset --hard HEAD^
git push origin -f
BitBucket
- bitbucket.org
- Atlassian Git Cheatsheet
- Dzone: source control using atlassian bitbucket
- Dzone: how I use bitbucket in my regular routine
GitLab
- gitlab.com
- Dzone: using gitlab API to create projects
- gitlab.com: GitLab’s guide to CI/CD for beginners CI/CD is a key part of the DevOps journey. Here’s everything you need to understand about this game-changing process.
- levelup.gitconnected.com: Automating Integration and Deployment to Remote Server GitLab CI/CD
- about.gitlab.com: Want a more effective CI/CD pipeline? Try our pro tips Here’s how to take your CI/CD pipeline to the next level with hands on advice about faster builds, better security and more.
- gitlab.com: How to do GitLab merge request reviews in VS Code
- about.gitlab.com: How we used parallel CI/CD jobs to increase our productivity GitLab uses parallel jobs to help long-running jobs run faster.
- about.gitlab.com: How to use GitLab CI to deploy to multiple environments
- about.gitlab.com: Meet Pipeline Editor, your one-stop-shop for building a CI/CD pipeline
- about.gitlab.com: A new era of Kubernetes integrations on GitLab.com The GitLab Kubernetes Agent enables secure deployments from GitLab SaaS to your Kubernetes cluster and provides deep integrations of your cluster to GitLab.
- docs.gitlab.com: Install GitLab Runner on Red Hat OpenShift
- devclass.com: Git a March on: GitLab 13.10 ramps up security, adds support for OpenShift, DORA
- about.gitlab.com: GitLab 13.11 released with Kubernetes Agent and Pipeline Compliance
- lambdatest.com: How To Use GitLab CI To Run Tests Locally? 🌟
- sdtimes: GitLab 14 aims to do away with DIY DevOps toolchains 🌟
GitHub
- githubstatus.com 🌟
- GitHub Codespaces Get the full Visual Studio Code experience without leaving GitHub.
- GitHub CLI
- githubstatus.com/uptime 🌟
- github.blog: How we launched docs.github.com
- Introducing GitHub’s OpenAPI Description
- GitHub public roadmap 🌟
- Token authentication requirements for API and Git operations
- GitHub Chaos Actions in Your CI/CD workflow
- GitHub's OpenAPI Spec Open-Sourced in Beta
- Things you didn't know you could diff in GitHub
- github.blog: Set the default branch for newly-created repositories
- grafana.com: How we use the Grafana GitHub plugin to track outstanding pull requests
- itnext.io: Build & Ship: GitHub Container Registry & Kubernetes
- grafana: How we use the Grafana GitHub plugin to track outstanding pull requests
- itnext.io: Build & Ship: GitHub Container Registry & Kubernetes
- theregister.com: Passwords begone: GitHub will ban them next year for authenticating Git operations
- github.blog: Learn about ghapi, a new third-party Python client for the GitHub API
- github.blog: Improving how we deploy GitHub
- github.blog: Deployment reliability at GitHub
- github.blog: Extending GitOps to reliability-as-code with GitHub and StackPulse
- backhub.co Reliable GitHub repository backup, set up in minutes
- GitHub public roadmap 🌟
- devops.com: Make GitHub Backups Part of Your Development Process
- github.blog: Solving the innersource discovery problem - Discoverability
- devopstips.net: Create, Host and Share Docker Images with GitHub Packages
- blog.gruntwork.io: Introducing git-xargs: an open source tool to update multiple GitHub repos
- github.blog: Security keys are now supported for SSH Git operations 🌟
- education.github.com Real-world tools, engaged students. GitHub Education helps students, teachers, and schools access the tools and events they need to shape the next generation of software development.
GitHub Actions
- github.blog: Testing cloud apps with GitHub Actions and cloud-native open source tools
- docker.com: Docker Github Actions
- laravel-news.com: Generate GitHub Actions Config for Laravel Projects with Ghygen
- blog.codecentric.de: Stop re-writing pipelines! Why GitHub Actions drive the future of CI/CD
- particule.io: CI/CD using Github Actions, AWS ECR and ECS Fargate
- proandroiddev.com: “Continuous Integration/Delivery” for Android with GitHub Actions — Part 1
- github.blog: Implementing least privilege for secrets in GitHub Actions
- github.blog: Work with GitHub Actions in your terminal with GitHub CLI
- github.blog: GitHub Actions: Control permissions for GITHUB_TOKEN 🌟
- github.blog: GitHub Actions update: Helping maintainers combat bad actors
- github.blog: How we use GitHub Actions to manage GitHub Docs
- vimeo.com: How to Create a CI/CD Pipeline with GitHub Actions and K8s Like a Boss
GitHub Actions Marketplace
- flat-data Flat Data is a GitHub action which makes it easy to fetch data and commit it to your repository as flatfiles. The action is intended to be run on a schedule, retrieving data from any supported target and creating a commit if there is any change to the fetched data.
GitHub Actions and OpenShift
- redhat.com: Red Hat and GitHub Collaborate to Expand the Developer Experience on Red Hat OpenShift with GitHub Actions 🌟 Industry’s leading enterprise Kubernetes platform now integrates with GitHub, bringing DevOps automation tools from the world’s largest developer platform into the OpenShift ecosystem
- openshift.com: Deploying to OpenShift using GitHub Actions
- github.com: RedHat Actions 🌟
- github.com: OpenShift GitHub Actions Runner 🌟
- github.com: OpenShift GitHub Actions Runner Chart 🌟
Gitea
Git Tools
Semantic-release. CI/CD semantic release workflow (semantic Versioning, commit format and releases)
- semantic-release.gitbook.io 🌟 Semantic-release automates the whole package release workflow including: determining the next version number, generating the release notes and publishing the package.
- css-tricks.com: How to Automate Project Versioning and Releases with Continuous Deployment 🌟
Azure DevOps (formerly known as VSTS)
- Wikipedia: Azure DevOps
- wikipedia: Azure DevOps Server Collaboration software for software development formerly known as Team Foundation Server and Visual Studio Team System
- wikipedia: Azure DevOps Services Cloud service for software development formerly known as Visual Studio Team Services, Visual Studio Online and Team Foundation Service Preview
- Azure DevOps Labs 🌟
- twitter.com/azuredevops
- Microsoft Visual Studio Team Services (VSTS)
- Microsoft Visual Studio Team Services (VSTS) Tutorial: The Cloud ALM Platform
- slideshare.net: Git version control and trunk based approach with VSTS
- Microsoft Replacing Visual Studio Team Services with Azure DevOps
- How We Use Git at Microsoft
Pre Commit Hooks
- pre-commit A framework for managing and maintaining multi-language pre-commit hooks.
- towardsdatascience.com: CI/CD by Example in Python A simple demonstration of CI/CD in Python with poetry and pre-commit hooks, poetry-template
Merge BOTs
- The Merge Bot is a tool to orchestrate pull requests merging into the stable branches.
- Wikipedia: Software bot
Tips
- Use bots to accomplish tasks like merging PR's that have been approved and automatically updating dependencies. Usage of one of these bots might allow us to trigger certain builds based off of specific GitHub tags, it would allow us to only selectively run certain test suites and increase the throughput of the build by only testing changes made in a branch / PR.
- Investigate options that are available and see if we can integrate them with CI.
- We should be able to configure this bot to automatically apply labels to PR's based off of what is changed in a PR. For instance, if a PR contains any documentation changes, the area/Documentation label can be applied.
Jenkins for git merges
- Git Plugin: Merge Extensions
- Validated Merge Plugin for Git in CloudBees Jenkins Enterprise 🌟
- How to configure Jenkins for git merge
- GitHub Pull Request Builder Plugin , github ref. You should probably migrate to GitHub Branch Source Plugin.
- GitHub Branch Source Plugin: Allows you to create a new project based on the repository structure from one or more GitHub users or organizations.
Bitbucket for git merges
- Automatic branch merging
- BitBucket Auto Merge Automatically create and merge pull request to keep branches in sync.
- Checks for merging pull requests
- BitBucket Bot for Microsoft Teams
- Code Dog Merge your Pull Requests sooner. Some of the Slack messages your team sends are critical for productivity. Automate them.
- Jenkins Plugin: Bitbucket Push and Pull Request
- How to Implement the Automerge feature that is missing from BitBucket cloud
- Configure bitbucket-pipelines.yml to automatically merge feature branch to master?
GitLab for git merges
- Auto-merge between release branches
- Provide merge bot functionality
- lab.texthtml.net: Gitlab Merge Bot
- DockerHub: Gitlab Merge Bot Bot assistant for code review and merge requests approval for Gitlab
- Mergecrush A email & slack reminder bot for Gitlab merge requests.
- stackoverflow.com: How can we programmatically approve merge requests in GitLab?
- Our group has a bot that creates merge requests for certain mechanical changes to our code base. We'd like these MRs to get merged in automatically if/when the CI pipeline succeeds, but our projects require an approval from a member of our group. This means that right now a human has to manually click on "approve" and "merge" for each bot-created MR. Apparently GitLab doesn't have a way to set different approval rules for some users, so I haven't found a way to make the bot's user immune to this requirement.
- My current idea is to have a separate process that approves each of the merge requests created by the bot. Is there an easy way to do this programmatically? That is, is there an API (or better yet, a command line tool) that, when given the name of the branch for a merge request, approves the merge request associated with that branch?
- I'm also open to other ways of getting these changes in with minimal human intervention. I do want them to pass the CI pipeline, though (which is currently accomplished by having them use MRs) and the MRs also help in the rare cases where the pipeline fails, so we can debug what went wrong.
Marge GitLab bot
- Marge-bot: A merge-bot for GitLab
- Example: gitlab.gnome.org/marge-merge-bot
- Example: Smarkets's Marge-bot for GitLab keeps master always green
- Example: GStreamer Merge Bot
Jenkins-X bots
- Jenkins-X UpdateBOT A simple bot for updating dependencies in source code and automatically generating Pull Requests in downstream projects.
Plastic SCM bot
- Plastic SCM
- blog.plasticscm.com: Add a mergebot to your repo!
- Plastic SCM DevOps Mergebot to implement a trunk-based development cycle
- PlasticSCM MergeBot Jenkins Plugin
- genbeta.com: Plastic SCM Mergebot: automatizando tu pipeline de desarrollo
Mergify bot
GitHub bots
- github-rebase-bot A github bot that monitors repository PRs, rebases them and merges them as they pass tests.
- Bulldozer: GitHub Pull Request Auto-Merge Bot
- github-merge-bot Automates the process of merging pull requests and keeping them up-to-date.
- github.com/squalrus/merge-bot: PR Merge Bot A GitHub action that manages pull request integrations
- Odoo Mergebot
- gmaster.io - Mergedroid: Automate merging just by analyzing your GitHub repo. A BOT that solves conflicts in pull requests without manual intervention.
- Kodiak GitHub bot for updating and merging pull requests
- Rultor A merging bot for Github pull requests
- stackoverflow.com: Bot to automatically reverse GitHub pull request merges. Maybe it's best to not allow the merges instead of reverting them:
- help.github.com: Configuring protected branches
- help.github.com: Enabling required status checks:
- Select Require status checks to pass before merging
- Choose (create) a status check, that always fails
Bors GitHub bot
- Bors Bot
- Bors - Readme
- Bors-ng: A merge bot for GitHub Pull Requests
- Example: CockroachDB's Bors Merge Bot
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>Today's @code tip: the git stash commands
— Matt Bierner (@mattbierner) June 27, 2020
Create, apply, and manage #git stashes using VS Code commands.
Stashes let you quickly save off your workspace changes and restore them when they are needed again#code2020 pic.twitter.com/VPursGdRka
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>Writing good Git commit messages matters!
— Deni Moka⚡ (@dmokafa) January 18, 2021
A thread about how to write clean commit messages:
🧵 👇
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>Here are _some_ of the most essential git operations you will need when working as a developer.
— Oliver Jumpertz (@oliverjumpertz) March 23, 2021
🧵🔽 pic.twitter.com/ZTUUObuj70