Git is a distributed version control system (VCS).
It is used for source control management (SCM).
Git is part of the official Debian repository:
apt install git
mkdir /srv/git/${PROJECT}.git
cd /srv/git/${PROJECT}.git
git init --bare --shared
Create a group and change the group of the project directory:
addgroup ${GROUP}
chgrp -cR ${GROUP} /srv/git/${PROJECT}.git
Add users to the group:
usermod -a -G ${GROUP} ${USER}
Set your name and your email address for all projects:
git config --global user.name "John Doe"
git config --global user.email johndoe@example.net
Clone a repository via SSH:
cd src
git clone ${USER}@git.example.net:/srv/git/${PROJECT}.git
cd ${PROJECT}
Edit some files:
${EDITOR} README.md
Review modifications in files:
git diff
Prepare a commit by adding modified files:
git add README.md
Review the set of changes by listing changed files:
git status
Commit the changes with a short message:
git commit -m "Improve description about the project"
Push the commits to the remote server:
git push
Especially, when working in a team of developers,
you will make your thoughts on how to efficiently work together.
Many workflows and branching strategies already exist.
Here are a few popular workflows: