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.

Mastering Advanced Git Workflows for Professional Developers

Tutorial December 10, 2024
bash

  git submodule update --remote

Subtrees are an alternative to submodules, offering a simpler workflow for managing nested repositories.

How to Undo Your Last Commit Without Changing Your Working Directory

Tutorial November 14, 2024
bash

git reset --hard HEAD~1

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.

Mastering GitHub Workflows for Continuous Integration and Deployment

Tutorial August 29, 2024

Explanation:

  • name: CI: The name of the workflow.
  • on: [push, pull_request]: Specifies the events that trigger the workflow. In this case, it runs on every push and pull request.
  • jobs: Defines the jobs within the workflow.
  • runs-on: ubuntu-latest: Specifies the environment where the job will run. Here, it's the latest version of Ubuntu.
  • steps: The individual commands and actions executed during the job. For example, it checks out the code, sets up Node.js, installs dependencies, and runs tests.

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

Cheatsheet August 20, 2024
bash

# 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>