2016-09-11 1 views
2

난 그냥 Git을 배우고있어 그래서 나와 함께 곰. 로컬에서 코드를 몇 개 작성 했으므로 원격 서버 (origin)로 푸시하고 싶습니다. 이 오류를 얻을 :Learning Git : 리모컨이 적절한 구성에도 불구하고 내 푸시를 거부합니까?

! [rejected] master -> master (fetch first)

error: failed to push some refs to 'ssh://[email protected]:2200/home/user'

Updates were rejected because the remote contains work that you do not have locally. This is usually caused by another repository pushing

리모컨은 v 2.4.1이며,이 설정 (git config --list의 출력)이 있습니다

core.repositoryformatversion=0 
core.filemode=true 
core.bare=false 
core.logallrefupdates=true 
receive.denycurrentbranch=updateInstead 

합니까 내가 인상없이 conficts을 재정의 할 수 있어야하지 마지막 평균 오류?

기본적으로 가장 간단한 설정을 찾고 있습니다. 서버에서 개발하지 않고 액세스 할 수있는 유일한 사람이기 때문에 dev 컴퓨터가 이기기 위해 무엇이든 원하는 것입니다.

this answer은 리모트 리포 지 토리 만들기에 대한 내용이 있지만 폴더의 내용은 모두 .git으로 삭제하는 것이 었습니다. 내 프로젝트의 일부가 거기에있는 파일이 있기 때문에 그것은 나를 위해 작동하지 않습니다,하지만 난 원격 저장소에 로그인하는 경우

를 이동하고 내가 볼 git status 실행하지 않는 것이

Untracked files: (use "git add ..." to include in what will be committed)

...(long list of files)

nothing added to commit but untracked files present (use "git add" to track)

부록

나는 지금 막 :

$ git push --force origin master 
stdin: is not a tty 
Counting objects: 3801, done. 
Delta compression using up to 8 threads. 
Compressing objects: 100% (3674/3674), done. 
Writing objects: 100% (3801/3801), 6.95 MiB | 37.00 KiB/s, done. 
Total 3801 (delta 2450), reused 0 (delta 0) 
error: Untracked working tree file 'cacert.pem' would be overwritten by merge. 
To ssh://[email protected]:2200/home/user 
! [remote rejected] master -> master (Could not update working tree to new HEAD) 
error: failed to push some refs to 'ssh://[email protected]:2200/home/' 

을 난 그냥 삭제할 수 있습니다 생각하고 선생 그 파일의 rver 's 사본 그리고 다시 시도? 두 파일은 (그것이 복사/붙여 넣기 작업이었다) 같은 내용이

답변

1

I don't want the local to import any change from the remote I want local files to overwrite remote files

provblem 당신이 풀을 이눔하지 않으려면, 당신이 필요로하는, 그 오류 메시지입니다 :

git push --force 

하지만 파일을 덮어 쓰지 않고 커밋을 통해 원격쪽에있는 커밋의 최근 기록을 덮어 쓰게되므로 실제로 원하는 내용인지 확인하십시오.

the remote has setting receive.denycurrentbranch=updateInstead . Doesn't that mean that my push should just update the remote master branch?

그것은 비 베어 REPO (이하 "강요에 배포"에 대한 see more here)에 강제 할 수 있지만 오류 메시지 그건 아니다.
로컬에없는 원격 쪽에서 커밋이 발생합니다.

일반적으로 pull --rebase, 업데이트 된 가져 오기 된 원격 분기 맨 위에 변경 내용을 재생할 수 있습니다. 그러면을 누르십시오.

+0

mg 처음에는 명령을 실행하기 시작했습니다. 우리가 말한대로 실행 중이며, 편집 후 편집 중이라는 것을 알게되었습니다. lol – BeetleJuice

+0

'--force'는 원래 명령보다 훨씬 바빴지만 작동하지 않았습니다. 결과로 OP를 업데이트했습니다. – BeetleJuice

+0

@BeetleJuice Novelie : 원격 repo는 여전히 reflog에 커밋의 오래된 기록이 있습니다. 아무 것도 잃어 버리지 않습니다. – VonC

관련 문제