Skip to content

DamengRandom/git-recalls

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 

Repository files navigation

This is git recalls repository (for concepts understanding)

1. cherry-pick

Explanations:

We have 3 commits in cherry-A branch

We have 1 commit in cherry-B branch

Now, we want put cherry-A's 3rd commit into cherry-B branch

command:

# 1st step: go to cherry-B branch
# 2nd step type command below: 
git cherry-pick `3rd-commit-hash-value`
# or we can use `-n`: which means cherry-pick the commit contents but NOT create a commit immediately (keep the file in the staged status) 
git cherry-pick `3rd-commit-hash-value` -n
# Done

Reference here

2. submodules related commands

git submodules: allows developer to keep a git repository as subdirectory of another git repository (Its a snapshot of another repository)

Common command:

# Example: In your current project, you can create submodule of another project
git submodule add https://github.com/DamengRandom/git-recalls.git

Why we need git submodules: Assuming that when you have a project in git which depends on a particular versions of other projects

About

Recall essential Git concepts

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published