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:
name: Ubuntu Test on: [push] jobs: test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - run: echo "Running on Ubuntu VM" Push it – GitHub will run the workflow. | Error | Solution | |-------|----------| | Permission denied (publickey) | Add your SSH key to GitHub (Step 3 – Option C). | | remote: Invalid username or token | Generate a new token with correct scopes. | | detected dubious ownership in repository | Run git config --global --add safe.directory /path/to/repo | | fatal: not a git repository | You’re outside a Git repo – cd into the correct folder. | Conclusion You now have a fully functional GitHub environment on Ubuntu. From installing Git and authentication to pushing code and resolving conflicts, these commands will serve you daily. github in ubuntu
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 add README
ssh-keygen -t ed25519 -C "your-email@example.com" Display the public key and add it to GitHub (): | | remote: Invalid username or token |
echo "# My Ubuntu Project" > README.md Stage and commit: