git --version # Example output: git version 2.34.1 Link Git to your GitHub account locally:
git config --global user.name "Your GitHub Username" git config --global user.email "your-email@example.com" Use the same email attached to your GitHub account. Check your configuration: github in ubuntu
git add README.md git commit -m "Add README" git push origin main If you use a token or SSH, the push will succeed immediately. Step 5: Keep Your Local Repository Updated Pull the latest changes from GitHub: git --version # Example output: git version 2
ssh-keygen -t ed25519 -C "your-email@example.com" Display the public key and add it to GitHub (): Cache your password/token for a few hours: git
sudo apt install gitk git-gui Run gitk to see history or git gui to stage changes. Cache your password/token for a few hours:
git pull origin main For a full sync (fetch + merge):
ssh -T git@github.com # You should see: "Hi username! You've successfully authenticated..." Clone a Repository git clone https://github.com/username/repository.git cd repository Make Your First Commit Create or edit a file: