alan-turing-institute / tric-dt

Open Project Pages for the TRIC-DT
Other
5 stars 0 forks source link

Import `ways-of-working-hub.md` as `ways-of-working.md` #21

Open cassgvp opened 11 months ago

cassgvp commented 11 months ago

Summary Sentence

A ways of working document has been developed in the private tric-dt-hub repo. This is ready to be ported into the public repo for further development.

What needs to be done?

Who can help?

all (@cassgvp to move initially)


Update after the issue was opened

[Add details]

kallewesterling commented 11 months ago

Shall we establish a timeline for finishing this issue? It seems that the review part is the most cumbersome, right? The document isn't really ready for publication? But maybe this issue is really about moving the markdown file over to this repo?

aranas commented 11 months ago

agreed, we can just move over the markdown file. However, I would appreciate if we could open a new issue with a specific target for this document. Even if it is a living document, we should be able to 'complete' it temporarily for a certain use-case. I think we have identified the following use cases:

Each of these imo would require us to focus on different sections.

aranas commented 11 months ago

Also, I'd like to know what you see is the purpose of section "2 Research Community Infrastructure" in the document.
To me this could almost serve as a sepcification of our Hub objective 3 " Scaffold a multi-disciplinary community of practice focused on addressing common challenges in the trustworthy and responsible development of digital twins (e.g. reproducibility and interoperability"

So maybe then another use case of the WoW doc would be "setting targets to facilitate roadmapping of plan towards objective 3

kallewesterling commented 11 months ago

Related issue: #27.

kallewesterling commented 11 months ago

How to move a file from a private repository to a public repository

It's easy to move files between public repositories as we don't care what's exposed in the move, but in our case it's different: we don't want to expose the entire hub working repo + all the git commits in that repo, but will need to follow a different way.

This comes from Ayushya Jaiswal's "Move files from one repository to another, preserving git history"

Getting files ready

Step 1: Make a copy of repository A as the following steps make major changes to this copy which you should not push!

mkdir cloneA
cd cloneA
git clone --branch <branch> --origin origin --progress \
  -v <git repository A url>
# eg. git clone --branch main --origin origin --progress \
#   -v https://github.com/username/myproject.git
# (assuming myprojects is the repository you want to copy from)

Step 2: Go to that directory.

cd <git repository A directory>
#  eg. cd myproject
# Folder Path is ~/cloneA/myproject

Step 3: To avoid accidentally making any remote changes (eg. by pushing), delete the link to the original repository.

git remote rm origin

Step 4: Go through your history and files, removing anything that is not in FOLDER_TO_KEEP. The result is the contents of FOLDER_TO_KEEP spewed out into the base of repository A.

git filter-branch --subdirectory-filter <directory> -- --all
# eg. git filter-branch --subdirectory-filter subfolder1/subfolder2/FOLDER_TO_KEEP -- --all

Step 5: Clean the unwanted data.

git reset --hard
git gc --aggressive 
git prune
git clean -fd

Step 6: Move all the files and directories to a NEW_FOLDER which you want to push to repository B.

mkdir <base directory>
#eg mkdir NEW_FOLDER
mv * <base directory>
#eg mv * NEW_FOLDER

Alternatively, you can drag all the files and directory to the NEW_FOLDER using GUI.

Step 7: Add the changes and commit them.

git add .
git commit

Merge files

Step 1: Make a copy of repository B if you don’t have one already.

mkdir cloneB
cd cloneB
git clone <git repository B url>
# eg. git clone https://github.com/ayushya/logan.git

Step 2: Go to that directory.

cd <git repository B directory>
#  eg. cd newproject
# Folder Path is ~/cloneB/newproject

Step 3: Create a remote connection to repository A as a branch in repository B.

git remote add repo-A <git repository A directory>
# (repo-A can be anything - it's just a random name)

# eg. git remote add repo-A ~/cloneA/myproject

Step 4: Pull files and history from this branch (containing only the directory you want to move) into repository B.

git pull repo-A main --allow-unrelated-histories
# This merges main from repository A into repository B

Step 5: Remove the remote connection to repository A.

git remote rm repo-A

Step 6: Finally, push the changes

git push
chrisdburr commented 11 months ago

I'd like to propose that we consider how to import this document in chunks, and added to the Jupyter Book that we intend to add to this repository. Rather than having a single document, we could have a chapter about ways of working in and with the TRIC-DT.