Skip to content

Instantly share code, notes, and snippets.

@MuhammadQuran17
Last active July 31, 2025 06:04
Show Gist options
  • Save MuhammadQuran17/927827dbd731496542ab52b35ef78a1d to your computer and use it in GitHub Desktop.
Save MuhammadQuran17/927827dbd731496542ab52b35ef78a1d to your computer and use it in GitHub Desktop.
Git helper

Undo merged Merge request

  1. git log --oneline see to which commit you need to jump
  2. git reset --hard branch_hash reset can be used also to undo commits
  3. git push origin feature/DATRUECALL-180 --force force push branch to remote origin

It is better to pull from origin before doing massive changes

Git squash in CLI

  1. git rebase -i HEAD~3 squash last 3 commits
  2. if you are using VI editor then press I
  3. Here you should left only the first one on pick all remainings please change into s (which means squash)
  4. if you are using VI editor then press ESC and :wq
  5. edit commit title
  6. redo 4rd point

    Ready! Reference: https://www.datacamp.com/tutorial/git-squash-commits

Server certificate verification failed CAfile:

git config --global http.sslVerify false - turn on ssl verification

Undo all before commit

git clean -nfd to check
git clean -fd to remove
git reset -- . not force(will not delete new files)

Pull Fetch Rebase

Git pull — связка последующих команд git fetch и git merge.
Включить изменения из удаленного репозитория в локальную копию проекта путем слияния (merge)
Наложить локальные коммиты поверх обновленной удаленной ветки (rebase)
Источник

Git cherry-pick merge-requests

When to Use cherry-pick -m 1 (The Common Case)

You use $ git cherry-pick -m 1 $ when you want to apply the changes that were introduced from the feature branch that was merged.

In a standard workflow, you merge a feature branch into a primary branch (like main or develop).

  1. The first parent (-m 1) is the commit on the main branch.

  2. The second parent (-m 2) is the tip of the feature branch.

By specifying -m 1, you tell Git: "Consider the main branch as the baseline and apply the changes that came from the feature branch."

This is what developers almost always want. You're trying to grab the "work" done in the feature branch that was summarized in the merge commit.

Example: Imagine you merged feature-A into develop. Later, you realize you need that same merge on your main branch. You would find the merge commit on develop and run: $ git cherry-pick -m 1 $

When to Use cherry-pick -m 2 (The Rare Case)

You use $ git cherry-pick -m 2 $ when you want to apply the changes from the first parent relative to the second parent.

This is highly unusual and often not what you intend. It essentially means you are treating the feature branch as the mainline and want to apply the changes that happened on the primary branch (main/develop) since the two branches diverged. This scenario is rare because developers typically want the feature's changes, not the mainline's changes, ported elsewhere.

Git turn off permission track

git config core.fileMode false

error: invalid path 'filePath:Zone.Identifier' in git pull

git config core.protectNTFS false

What is github reabse

From Philomatics youtube channel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment