Skip to main content

Basic Git Setup

Company Git Account Settings

If you have GitHub account and you are fine with using it for the work as well, add your company email address NAME@fly4future.com to your account. If you need to create a new one, use the company email for registration. Also set your global git config to use your work email by default.

git config --global user.email "NAME@fly4future.com"
note

You probably will have to set your name as well if it's the first time you use git on your machine.

git config --global user.name "Your Name"

SSH Key Configuration

You should generate an SSH Key if you don't have one yet and link it to your account.

warning

If you already have a personal SSH key at ~/.ssh/id_ed25519, skip key generation to avoid overwriting it. Check first:

ls ~/.ssh/id_ed25519.pub

If the file exists, you can reuse your existing key — or generate a new one with a different filename (e.g. id_ed25519_work) and configure SSH to use it for GitHub. See below.

ssh-keygen -t ed25519 -C "name@fly4future.com"

When it says "Enter file in which to save the key" just press Enter (or specify a custom path like ~/.ssh/id_ed25519_work if you need to keep a separate work key). When it asks for a passphrase, you can press Enter twice to leave it empty or add a password for extra security.

If you used a custom filename, add an SSH config entry so GitHub uses the right key. Either way, it is good practice to have a full GitHub entry in ~/.ssh/config:

Host github.com
HostName github.com
User git
IdentityFile ~/.ssh/id_ed25519
AddKeysToAgent yes
  • HostName — the actual address to connect to (same as the alias above)
  • User git — always git for GitHub, so you don't need to write git@github.com manually
  • IdentityFile — path to your private key; change to id_ed25519_work if you used a custom filename
  • AddKeysToAgent yes — if you set a passphrase on your key, the SSH agent will prompt you for it the first time you use the key after each boot or new session, then load it into memory. From that point on it authenticates silently, so you only ever type your passphrase once per session. If you left the passphrase empty, the key is loaded automatically with no prompt

Once that's done, copy your public key. It starts with ssh and ends with your email.

cat ~/.ssh/id_ed25519.pub

Go to you GitHub SSH Setting, click New SSH Key and paste it there. Run this to verify that GitHub recognizes you.

ssh -T git@github.com

-> Hi [Your Username]! You've successfully authenticated, but GitHub does not provide shell access.
warning

Do not place your ssh key anywhere publicly available.


Global Gitignore

Next you can setup your global gitignore in your home directory for most common items.

touch ~/.gitignore_global
git config --global core.excludesfile ~/.gitignore_global

Open the file and paste there the following items. Feel free to add/remove any.

*.swp
*.swo

__pycache__
*/.tmuxinator.yml

.cache
.vscode

compile_commands.json

Git Folder

We suggest to create a git folder for all your cloned repositories/packages from where you can link them to your existing workspaces.

$HOME/
└── git/
│── your_git_repo_1
│── your_git_repo_2
└── ...

You can then symlink your package into your workspace source folder.

cd your_ws/src

ln -sf ~/git/your_git_repo_1 .