Skip to content

Latest commit

 

History

History
29 lines (24 loc) · 1.32 KB

ADD_TO_EXISTING_PACKAGE.md

File metadata and controls

29 lines (24 loc) · 1.32 KB

Add your existing code to directory generated by the NLeSC Python template

The following steps requires that your existing code is in a GitHub repository.

  1. Follow the instructions to create a new package with the Python template, while answering the questions like you would for the existing package.

  2. Create a Git structure for the new directory: (replace <NEW_DIRECTORY> with directory name you used during cookiecutter questionnaire)

$ cd <NEW_DIRECTORY>
$ git init
$ git add --all
$ git commit -m "Added code generated by cookiecutter"
$ git branch -M main
  1. Import the existing repository from GitHub (Replace <ORGANIZATION> with your GitHub organization name , <REPOSITORY> with your GitHub repository name and <BRANCH> with your default branch for example main or master):
$ git remote add -f existing_code https://github.com/<ORGANIZATION>/<REPOSITORY>
$ git fetch existing_code
$ git merge existing_code/<BRANCH> --allow-unrelated-histories
  1. The previous step will likely result in several merge conflicts. Solve the conflicts by editing the files.
  2. Once all conflicts have been resolved then add all the files to GitHub:
$ git add --all
$ git commit -m "Merged existing code with code generated by cookiecutter"
$ git push