问题
I am currently pushing my project to a local folder that is accessed by Dropbox. That's my backup and safety strategy. I am wondering if I can add another layer of security so that if someone gets a hold of my Dropbox folder, they would have to enter a password to pull the project. That would happen by specifying a password when I am adding a new remote, such as
~/project $ git remote <some string password> add origin ~/Dropbox/git/project.git
Is this possible, or am I overthinking it?
回答1:
First, try a put git bundle (one file: a compressed version of your Git repo, one you can clone) in a Dropbox folder.
Putting a full Git repo into Dropbox remains risky, as I mentioned here.
Plus, adding one file means you can easily encrypt it and add a password.
You can write a script which will:
- create the bundle,
- encrypt it (password-protected)
- push it to the DropBox folder.
来源:https://stackoverflow.com/questions/55821326/push-git-project-to-local-directory-with-a-password