解决方法:
1、终端输入git pull --rebase origin master 可与刚创建的线上远程仓库的默认分支master关联
2、若本地文件修改过,则会报错
error: cannot pull with rebase: You have unstaged changes.
error: please commit or stash them.
3、git status查看信息
On branch master
Your branch and 'origin/master' have diverged,
and have 2 and 2 different commits each, respectively.
(use "git pull" to merge the remote branch into yours)
4、用git stash保存本地的修改并隐藏
5、再次git pull --rebase origin master 成功与远程master关联
成功后信息:
Enter passphrase for key
...
* branch master -> FETCH_HEAD
warning: skipped previously applied commit 348a8c9
hint: use --reapply-cherry-picks to include skipped commits
hint: Disable this message with "git config advice.skippedCherryPicks false"
Successfully rebased and updated refs/heads/master.
6、关联成功后使用git stash pop将本地修改过的文件恢复
7、最后上传使用命令git push -u origin master