Useful Commands work with Github SCM

37 Likes Comment
Install git on Macbook via Homebrew:
brew install git

Verify the installation:

git --version

Connect to the github account. By using github username and personal access tokens

git config --global user.name "your_github_username"
git config --global user.email "[email protected]"

To create the personal access tokens as github password : From github.com page, hit your github account avatar , then select Settings -> Developer Settings -> Personal Access Tokens -> Generate new token -> Configure the permission and copy the key.

Working with github from your local computer

echo "# mylabtest" >> README.md
git init
git add README.md
git commit -m "first commit"
git branch -M main
git remote add origin https://github.com/nguyenkhaclong/mylabtest.git
git push -u origin main

push an existing repository from the command line

git remote add origin https://github.com/nguyenkhaclong/mylabtest.git
git branch -M main
git push -u origin main

You might like

About the Author: Toc Xoan

This guy likes taking photos, hunting cheap tours, exploring the unique culture of every cities of Vietnam. Contact: [email protected] I've created a dogecoin wallet to receive blog funding: DE6F5FisSCy7yz5rpHY1ChMSGYnDMpFZ1Q

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.