2017-03-12 19 views
0

모든 종류의 문제가 있기 때문에 Git을 재설정하려고합니다. 그것은 내가 여러 개의 큰 파일을 내 리모컨으로 보낼 수 없으며 커밋에서 삭제하는 방법을 모른다. 나는 심지어 파일을 저지른 것을 기억하지 않는다.GIT 로컬에서 원격 버전으로 재설정

내 원격입니다

[email protected] MINGW64 /c/wamp64/www/postmyproject (master)<br> 
$ git push pmp_staging master<br> 
Enter passphrase for key '/c/Users/kjlin/.ssh/id_rsa':<br> 
Counting objects: 7215, done.<br> 
Delta compression using up to 4 threads.<br> 
Compressing objects: 100% (7006/7006), done.<br> 
Writing objects: 100% (7215/7215), 44.69 MiB | 1.01 MiB/s, done.<br> 
Total 7215 (delta 1112), reused 0 (delta 0)<br> 
remote: Resolving deltas: 100% (1112/1112), done.<br> 
remote: git.wpengine.com: validating<br> 
remote: - info: detected push to staging application ...<br> 
remote: - info: validating files in 9f1931e ...<br> 
remote: - info: found application servers ...<br> 
remote: failed...<br> 
remote: system/large file types detected:<br> 
remote: ------------------------------------------------------------------<br> 
<br> 
remote: wp-content/mu-plugins/wpengine-common/preamble.php<br> 
remote: wp-content/mu-plugins/wpengine-common/redis-object-cache.php<br> 
remote: wp-content/mu-plugins/wpengine-common/s3-uploads.php<br> 
remote: wp-content/mu-plugins/wpengine-common/util.php<br> 
remote: wp-content/mu-plugins/wpengine-common/views/admin-footer.php<br> 
remote: wp-content/mu-plugins/wpengine-common/views/admin/advanced.php<br> 
remote: wp-content/mu-plugins/wpengine-common/views/admin/debug-db.php<br> 
remote: wp-content/mu-plugins/wpengine-common/views/admin/notice-sticky.php<br> 
remote: wp-content/mu-plugins/wpengine-common/views/admin/notice.php<br> 
remote: wp-content/mu-plugins/wpengine-common/views/general/powered-by.php<br> 
remote: wp-content/mu-plugins/wpengine-common/views/modal.php<br> 
remote: wp-content/mu-plugins/wpengine-common/views/staging-modal.php<br> 
remote: wp-content/mu-plugins/wpengine-common/views/wpe-migration-preview-<br>template.php 
remote: wp-content/mu-plugins/wpengine-common/wpe_wpdb.php<br> 
remote: ------------------------------------------------------------------ 
remote: please remove these files from your source, re-commit, and push... 
To git.wpengine.com:staging/postmyproject2.git 
! [remote rejected] master -> master (pre-receive hook declined) 
error: failed to push some refs to'[email protected]:staging/postmyproject2.git'<br> 

pmp_staging 내가 커밋 원래에서 이러한 파일을 제거하는 방법을 알아낼 수 없었다. 나는 머리를 원점으로 되돌려 보려고했지만 그것들을 없애지는 못했다. 대신, 나는 신선한 시작하고 싶습니다. 나는 단지 나의 Git 리모트가 나의 지역과 어울리기를 원한다. 그래서 나는 푸쉬 연습과 커밋을 시작할 수있다. 스택 오버플로에서 찾은 모든 것이 제대로 작동하지 않는 것 같습니다.

[email protected] MINGW64 /c/wamp64/www/postmyproject (master)<br> 
$ git fetch pmp_staging<br> 
Enter passphrase for key '/c/Users/kjlin/.ssh/id_rsa':<br> 
<br> 
[email protected] MINGW64 /c/wamp64/www/postmyproject (master) 
$ git reset --hard master/master<br> 
fatal: ambiguous argument 'master/master': unknown revision or path not in the working tree.<br> 
Use '--' to separate paths from revisions, like this: 
'git <command> [<revision>...] -- [<file>...]'<br> 
<br> 
[email protected] MINGW64 /c/wamp64/www/postmyproject (master)<br> 
$ git reset --hard pmp_staging/master<br> 
fatal: ambiguous argument 'pmp_staging/master': unknown revision or path not in the working tree.<br> 
Use '--' to separate paths from revisions, like this: 
'git <command> [<revision>...] -- [<file>...]' 



감사합니다!

+0

다시 복제 하시겠습니까? –

+0

이전의 HEAD 위치를 보려면 "git reflog"를 시도해보고 그 위치에 reset --hard를 사용할 수 있습니다 –

답변

0

나는 전체 자식 저장소를 삭제하기 위해 rm -rf .git을 사용했습니다.

는 내가 설정을 처음 Git Hub's 도움을 사용하여 WPengine.com에 대한 SSH를했다 WPengine's GIT Page

의 방향을 다시 시작했고 따랐다. 이것은 내 SSH 키를 가져 와서 WPengine.com에 설치하도록 허용했다.

그 후 나는 지시를주의 깊게 따라야 만했다. 압축 파일을 다운로드하고 내 로컬 WAMP 폴더에 붙여 넣었습니다. GIT Bash에 로그인하고 my/c/wamp64/www/my_install/폴더 아래에 SSH를 설정합니다.

우리는 실제로 객체 지향 프로그래밍을 위해 일부 파일을 편집했기 때문에 Wordpress 핵심 변경 사항을 허용하는 .gitignore 파일을 다운로드하고 설정해야했습니다. 내가 intially '를 추가하는 것을 잊었다 있어야합니다

$ cd ~/wordpress/my_wp_install_name 
$ git init . 
$ git add . --all 
$ git commit -m "initial commit..." 

:

나는 단순히 WPengine의 프로토콜을 따랐다. --모든'.

설정 내 준비에 원격으로 설치의 나 :

$ cd /c/wamp64/www/my_install 
$ git remote add staging [email protected]:staging/my_install.git 

그때 내 원격 배포 : 나는 다음 시간을 망칠 때까지

$ git push staging master 

지금까지 GIT가 노력하고 있습니다.

0

git reset --hard pmp_staging/master은 pmp_staging에 이상한 master 브랜치가 없다면 작동 할 것이라고 말하고 있습니다.

git branch -a을 실행하여 pmp_staging/master이 중복되는지 확인하십시오.