git log --oneline
see to which commit you need to jumpgit reset --hard branch_hash
reset can be used also to undo commitsgit push origin feature/DATRUECALL-180 --force
force push branch to remote origin
git rebase -i HEAD~3
squash last 3 commits- if you are using VI editor then press I
- Here you should left only the first one on pick all remainings please change into s (which means squash)
- if you are using VI editor then press ESC and :wq
- edit commit title
- redo 4rd point
Ready! Reference: https://www.datacamp.com/tutorial/git-squash-commits
git config --global http.sslVerify false
- turn on ssl verification
git clean -nfd
to check
git clean -fd
to remove
git reset -- .
not force(will not delete new files)
Git pull — связка последующих команд git fetch и git merge.
Включить изменения из удаленного репозитория в локальную копию проекта путем слияния (merge)
Наложить локальные коммиты поверх обновленной удаленной ветки (rebase)
Источник
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).
-
The first parent (-m 1) is the commit on the main branch.
-
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 $
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 config core.fileMode false
git config core.protectNTFS false