Applying stashed changes

Helloo all…!!!

I have stashed changes in the directory “~/Hilltop/frappe-bench/apps/erpnext”

But i want to apply those changes into “~/Hilltop/frappe-bench/apps/hilltop_custom” directory.

Anyone please help me to achieve this.

Hi @Kiranmai,

Please check it.

# Navigate to the original directory
cd ~/Hilltop/frappe-bench/apps/erpnext

# List stashes and identify the one to apply
git stash list

# Apply the desired stash
git stash apply stash@{n}

# Check the changes
git diff

# Copy or move changes to the new directory
cp -r ~/Hilltop/frappe-bench/apps/erpnext/* ~/Hilltop/frappe-bench/apps/hilltop_custom/

# Navigate to the new directory
cd ~/Hilltop/frappe-bench/apps/hilltop_custom

# (Optional) Commit changes in the new directory
git add .
git commit -m "Apply stashed changes from erpnext"

Replace n with the index of the stash you want to apply. Adjust paths based on your specific file structure.

Thank You!

1 Like

@NCP
By this process,instead of getting single doctype i.e., where i made changes in core module , iam getting whole module i.e, erpnext into my github.

When someone having same core modules will pull, git will merge and it will corrupt the whole instance.

Therefore i need to add one single doctype only.

Thank you for your time and support ::))

Mostly you can’t use any git-fu with these changes. If you want to still try:

  1. Save git stash as patch - git stash show -p > stashed.patch
  2. Copy it and apply using git apply stashed.patch

A simpler solution would be to just copy the folder and manually re-apply changes in another folder. :grimacing:

1 Like

@ankush I tried…Still no use

Thank you ::))