背景

折腾:

记录

将本地代码迁移到Github/coding上

期间出错:

E:\Ruei\RueiProj\testuser>git remote add origin git@git.dev.tencent.com:skyio/test-user-api.git
fatal: not a git repository (or any of the parent directories): .git


git push
fatal: The current branch master has no upstream branch.
To push the current branch and set the remote as upstream, use

    git push --set-upstream origin master

E:\Ruei\RueiProj\testuser>  git push --set-upstream origin master
The authenticity of host 'git.dev.tencent.com (118.25.166.124)' can't be established.
RSA key fingerprint is SHA256:jok3FH7q5LJ6qvE7iPNehBgXRw51ErE77S0Dn+Vg/Ik.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'git.dev.tencent.com,118.25.166.124' (RSA) to the list of known hosts.
To git.dev.tencent.com:skyio/test-user-api.git
 ! [rejected]        master -> master (fetch first)
error: failed to push some refs to 'git@git.dev.tencent.com:skyio/test-user-api.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.

E:\Ruei\RueiProj\testuser>git pull
warning: no common commits
remote: Enumerating objects: 4, done.
remote: Counting objects: 100% (4/4), done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 4 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (4/4), done.
From git.dev.tencent.com:skyio/test-user-api
 * [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


E:\Ruei\RueiProj\testuser>git push
fatal: The current branch master has no upstream branch.
To push the current branch and set the remote as upstream, use

    git push --set-upstream origin master

解决

From git.dev.tencent.com:skyio/test-user-api
 * branch            master     -> FETCH_HEAD
First, rewinding head to replay your work on top of it...
Applying: init
.git/rebase-apply/patch:142: trailing whitespace.

.git/rebase-apply/patch:215: trailing whitespace.

.git/rebase-apply/patch:235: trailing whitespace.
  }
.git/rebase-apply/patch:236: trailing whitespace.

warning: 4 lines add whitespace errors.
Using index info to reconstruct a base tree...
Falling back to patching base and 3-way merge...
Auto-merging .gitignore
CONFLICT (add/add): Merge conflict in .gitignore
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch' to see the failed patch
Patch failed at 0001 init

Resolve all conflicts manually, mark them as resolved with
"git add/rm <conflicted_files>", then run "git rebase --continue".
You can instead skip this commit: run "git rebase --skip".
To abort and get back to the state before "git rebase", run "git rebase --abort".


E:\Ruei\RueiProj\testuser>