Walkthrough: Working in multiple locations (HPC and Laptop) with Git. #110
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
NBIS/Training-Tech-shorts#110
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
git remote)Would this cover a case of triangular workflow, for instance when there is a "dubious ownership" issue but some local changes must still be pushed?
Hi. I don't understand what's meant by dubious ownership. Do you mean you have two different Github/git users?
The idea was to cover data organization in a project based way, using git to track code but not data, and demonstrating how to leverage git plus a command runner to transfer data between HPC and laptop.
Can you clarify what you mean in your example? User1 makes changes at laptop and then ?
Sorry for having been unclear. I have faced this ownership issue when having to edit a git repository owned by a virtual user of our automation system. This repository was cloned by the virtual user on our HPC system. If I (as camcl user) would change the code in the HPC-local repository and commit the changes, then I would get an error message of "dubious ownership" upon attempting pushing my changes. Eventually, I had to clone again somewhere else on the HPC system the HPC-local clone. The second clone was owned by my myself, I added the github repo as a remote and could push my changes from the HPC-local clone nr. 2 to the gihub remote repo. So I ended up with a triangular system: HPC-local 1 --> HPC-local 2 --> github --> HPC-local 1. This setup is still somewhat unclear to me and I would be happy to get a walkthrough about a similar setup with someone who has more experience of this.
I've never encountered this, but I can look into it.
So I had a look into this.
Creating a separate clone is apparently the safe and recommended way of dealing with your scenario. When another user checks out a repo, it's owned by them, and doesn't allow (generally) for other users to commit to another users repo because it's a security risk. The
.gitfolder also contains configuration, and potentially executable code that could run when you commit into that repo, so git doesn't allow the commit by another user by default ( for example, if a user gets compromised ). If you're happy to trust the repo, in your config you can do:but be aware if there are pre-commit hooks or other things that can execute on your user info.
There's also a more complex way with user groups and
git config core.sharedRepository groupstuff (https://serverfault.com/questions/26954/how-do-i-share-a-git-repository-with-multiple-users-on-a-machine).