[Github]push上傳

  • 57
  • 0

Github push上傳

Github push
# 初始指令 init command
echo "# test" >> README.md
git init
git add README.md
git commit -m "first commit"
git branch -M main
# 之後上傳 after push
git remote add origin https://github.com/Neil/test.git
git push -u origin main

# error->remote: Repository not found.
git remote rm origin
git remote add origin https://Neil@github.com/Neil/test.git

# error->remote: Support for password authentication was removed on August 13, 2021.
# so need use personal access token
Setting>Developer settings>Personal access tokens>Generate new token>Select scopes check reop>Generate token

# in 30 days will use this token, save token in your note.
git push -u origin main
# enter your token will push it.

# others command
# status
git status
# when you update and next push
git add -A
git commit -m "sec commit"