DeveloperBreeze

Git Programming Tutorials, Guides & Best Practices

Explore 4+ expertly crafted git tutorials, components, and code examples. Stay productive and build faster with proven implementation strategies and design patterns from DeveloperBreeze.

Tutorial
bash

Mastering Advanced Git Workflows for Professional Developers

git filter-repo --path path/to/subdir

Sparse checkout allows you to clone only specific parts of a repository:

Dec 10, 2024
Read More
Tutorial
bash

How to Undo Your Last Commit Without Changing Your Working Directory

These commands will remove the last commit, and since you haven’t pushed it yet, there won’t be any issues with the remote repository.

Nov 14, 2024
Read More
Tutorial

Mastering GitHub Workflows for Continuous Integration and Deployment

Example: Slack Notification

name: Notify Slack

on: push

jobs:
  notify:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v3
    - name: Notify Slack
      uses: slackapi/slack-github-action@v1.19.0
      with:
        payload: '{"text":"A new commit has been pushed to the repository."}'
      env:
        SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

Aug 29, 2024
Read More
Cheatsheet
bash

Advanced Git Techniques Cheatsheet: Rebase, Cherry-Pick, and Interactive Staging

# Cherry-pick a single commit
git cherry-pick <commit-hash>

# Cherry-pick multiple commits
git cherry-pick <commit-hash1> <commit-hash2> ...

# Cherry-pick a range of commits
git cherry-pick <commit-hash1>^..<commit-hash2>

# Continue cherry-picking after resolving conflicts
git cherry-pick --continue

# Abort a cherry-pick operation
git cherry-pick --abort
# Switch to the main branch
git checkout main

# Cherry-pick a commit from feature-branch
git cherry-pick <commit-hash>

Aug 20, 2024
Read More