Git First Commit
Create a project on Github and get the repository address. For example, git address is
git@github.com:silentQQQ/cookiecutter.gitRun the following commands in the directory where you want to commit code:
git init # Create master branch locally by default
git branch -m master main # Rename master to main
git remote add origin git@github.com:silentQQQ/cookiecutter.git
# Force Git to merge the remote main branch history into your local branch
git pull origin main --allow-unrelated-histories
git add .
git commit -m "first commit"
git push -u origin mainOther Common Git Commands
# View all branches
git branch -a
# Create and switch to main branch
git checkout -b main