git push rejected

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
D:workspaceCLionC> git push --set-upstream origin master
fatal: HttpRequestException encountered.
发送请求时出错。
Username for 'https://github.com':
Password for '':
To https://github.com/C.git
! [rejected] master -> master (fetch first)
error: failed to push some refs to 'https://github.com/C.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

D:workspaceCLionC>git pull
warning: no common commits
remote: Counting objects: 3, done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (3/3), done.
From https://github.com/C
* [new branch] master -> origin/master
There is no tracking information for the current branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.

git pull <remote> <branch>

If you wish to set tracking information for this branch you can do so with:

git branch --set-upstream-to=origin/<branch> master


D:workspaceCLionC>git branch --set-upstream-to=origin/master master
Branch 'master' set up to track remote branch 'master' from 'origin'.

D:workspaceCLionC>git push
fatal: HttpRequestException encountered.
发送请求时出错。
Username for 'https://github.com':
Password for '':
To https://github.com/C.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'https://github.com/C.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.

D:workspaceCLionC>git push -u origin master -f
fatal: HttpRequestException encountered.
发送请求时出错。
Username for 'https://github.com':
Password for '':
Counting objects: 13, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (10/10), done.
Writing objects: 100% (13/13), 1.48 KiB | 505.00 KiB/s, done.
Total 13 (delta 0), reused 0 (delta 0)
To https://github.com/C.git
+ 0b30ec0...5ca759a master -> master (forced update)
Branch 'master' set up to track remote branch 'master' from 'origin'.