Skip to content

Commit

Permalink
fix remain issue with git workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
xmnlab committed Dec 3, 2023
1 parent 2ca416a commit 80ea4c4
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions src/scicookie/hooks/post_gen_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,27 +313,18 @@ def prepare_git() -> None:
subprocess.call(["git", "fetch", "--all"])

# prepare the first commit
subprocess.call(["git", "add", "."])
subprocess.call([
"git",
"commit",
"--allow-empty",
"-m",
"Empty commit from SciCookie",
"A temporary from SciCookie",
"--no-verify"
])
subprocess.call([
"git", "stash", "-u"
])

subprocess.call(["git", "checkout", f"origin/{git_main_branch}"])
subprocess.call(["git", "checkout", "-b", git_new_branch])
# note: https://stackoverflow.com/q/16606203files
subprocess.call(
"git stash show -p | git apply && git stash drop".split("|"),
shell=True,
stdout=subprocess.PIPE,
)
subprocess.call(["git", "stash", "pop"])
subprocess.call(["git", "checkout", git_stash_branch, "--", "."])
subprocess.call(["git", "add", "."])
subprocess.call([
"git", "commit", "-m", "Initial commit from SciCookie", "--no-verify"
Expand Down

0 comments on commit 80ea4c4

Please sign in to comment.