-
git config --global user.email “you@example.com”
git config --global user.name “Your Name” -
git init
-
git status
-
git add .
-
git status
-
git commit -am “first commit”
-
git remote add origin git@github.com:williamdsy/mmall_learning.git
-
git branch
-
git pull
报错:git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
解决方法:ssh-keygen失效,重新设置ssh-keygen
- ssh-keygen -t rsa -C “you@example.com”
三次enter,编辑器打开 C:\Users\williamdsy/.ssh/id_rsa.pub
复制全部,粘贴到github.com中
- git pull
- git push -u origin master
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'git@github.com:williamdsy/mmall_learning.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
原因是当前推送的分子落后了,强制推送:git push -u -f origin master
- git branch
- git branch -r
- 分支开发,主干发布
- git checkout -b v1.0 origin/master 创建分支
- git branch 检查当前分支
- git push origin HEAD -u -f 把分支推送到远程,到github.com 上查看,推送成功
来源:CSDN
作者:williamdsy
链接:https://blog.csdn.net/weixin_41899098/article/details/104060822