Connect to the remote repository
- initialize git:
git init git add .git statusgit commit -m "Initial commit"git remote add origin https://github.com/your-username/your-repository.gitgit push -u origin master
Error: Please tell me who you are
Solution:
git config --global user.email "your email"git config --global user.name "your name"
Branches
- Create and delete a branch: docs.github.com/zh/pull-req…
- Merge two branches:
git branch -a: check all the branchesgit checkout main: change branch
Say you want to merge based onmain, thengit merge master
if there is no error, then:git push origin main
if there are any conflict, you may need to handle it according to the situation and thencommit.