Web Development & WordPress

Macbook air m1: connect to github using terminal

The whole procedure i took help of Claude AI.

First, create a new Personal Access Token:

  • Go to GitHub.com and login
  • Click your profile picture → Settings
  • Scroll down to “Developer settings” (bottom of left sidebar)
  • Click “Personal access tokens” → “Fine-grained tokens”
  • Click “Generate new token”
  • Set a token name: “MacBook Git Token”
  • Set expiration: 90 days (or as you prefer)
  • Under “Repository access”, select “All repositories”
  • Under “Permissions”, expand “Repository permissions” and select:
    • “Contents” → “Read and write”
  • Click “Generate token”
  • COPY THE NEW TOKEN AND SAVE IT SOMEWHERE SAFE

Open Your Terminal In Mac

And go to the plugins folder in your WordPress setup like me from terminal 

Cd  /Applications/XAMPP/xamppfiles/htdocs/wordpress/wp-content/plugins/mydata

git add .

git commit -m “Initial commit”

git remote add origin https://<YOUR USER NAME OF GIT>:<YOUR-NEW-TOKEN>@github.com/<YOUR USER NAME OF GIT>/<YOUR REPOSITORY NAME>.git

git push -u origin main

And your file will be uploaded to your git repository

Leave a comment