git - Distributed Version Control System

Put folder under Git Version Control / git symlinks
Introduction
[edit]Put folder under Git Version Control
[edit]Operating System Software and Updates
sudo apt update
Install git.
sudo apt install --no-install-recommends git
Unless you want to use git for pushing changes to remotes which you probably won't in a testing VM you can use the following git config without using any real names or pseudonyms. (These are the git suggested defaults. [1])
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
Initialize git in current folder or cd to any folder you want to put under git version control. Can even be done for /home/user folder which is very useful.
git init
Add all files to be added for next commit.
git add -A
Actually commit to git.
git commit -a -m .
Check git status of that folder.
git status
No changes registered yet to the folder since just now committed all to git.
On branch master nothing to commit, working tree clean
Create a test file or do some activity such as starting a browser or e-mail client.
touch test-file
Check again git status of that folder.
git status
Now git will show what changed.
On branch master Untracked files: (use "git add <file>..." to include in what will be committed) test-file nothing added to commit but untracked files present (use "git add" to track)
git symlinks
[edit]git configuration file ~/.gitconfig :
[core] symlinks = false
symlinks = false is more secure:
Use:
- Developers: Are more likely to use
symlinks = falsein~/.gitconfig. - Users that build from source code: Are more likely to not use any
~/.gitconfigfile, therefore using git's defaultsymlinks = true.
When not using symlinks = false:
find "." -type l -not -iwholename '*.git*'will not detect these files as symlinks.- These are detected as file without newline at the of file. Example:
- file qubes/qubes-template-whonix/whonix-workstation
qubes/qubes-template-whonix/whonix-workstation: ASCII text, with no line terminators
When using symlinks = false:
find "." -type l -not -iwholename '*.git*'will detect these files as symlinks.- These are detected as symlink. Example:
- file qubes/qubes-template-whonix/whonix-workstation
qubes/qubes-template-whonix/whonix-workstation: symbolic link to whonix-gateway
Potential issues:
- A text file versus a symbolic link can cause different build results depending on git settings, leading to bugs and/or package reproducibility issues.
- Git will translate symlink replacement text files back into symlinks when committing and pushing, meaning if you attempt to change a symlink to a real file, people who pull the repo will get a dangling symlink pointing to a very strange filename rather than getting a normal file with contents.
Footnotes
[edit]- ↑
git commit -a -m . *** Please tell me who you are. Run git config --global user.email "you@example.com" git config --global user.name "Your Name" to set your account's default identity. Omit --global to set the identity only in this repository. fatal: empty ident name (for <(null)>) not allowed
We believe security software like Kicksecure needs to remain Open Source and independent. Would you help sustain and grow the project? Learn more about our 13 year success story and maybe DONATE!