2017-05-11 3 views
0

안녕 얘들 아 나는 git의 초보자이지만 사무실에서 대규모 웹 프로젝트의 변경 사항을 추적하는 데 사용하려고합니다.GitHub - 공유 네트워크 드라이브 Repo

공유 네트워크 드라이브에 설정된 대규모 사이트 용 웹 사이트 파일이 있습니다. 여기에 현재 진행중인 프로세스와 내가 직면 한 문제가 있습니다.

저는 Windows 10에서 git 명령 줄 인터페이스를 사용하고 있습니다.

I의 우리의 공유 드라이브에이 웹 사이트의 디렉토리에 CD와 다음을 수행 : 나는 완벽

$ cd /c/Users/Account/Desktop/ 
$ git clone /x/Clients/ClientA/Website/ 

이 클론 :

$ cd /x/Clients/ClientA/Website/ 
$ git init 
$ git status 
$ git add --all 
$ git commit -m "Initial Commit" 

그때 내 바탕 화면에 cd 및 로컬 버전을 복제 이제 내 데스크탑/웹 사이트/폴더 내에서 Atom을 사용하여 파일을 변경하고 저장하십시오.

나는 그 변경 사항을 커밋 내 공유 드라이브에 다시 밀어하려고 :

$ git status 
On branch master 
Your branch is up-to-date with 'origin/master'. 
Changes not staged for commit: 
    (use "git add <file>..." to update what will be committed) 
    (use "git checkout -- <file>..." to discard changes in working directory) 

     modified: index.html 

no changes added to commit (use "git add" and/or "git commit -a") 

$ git add --all 

$ git commit -m "Edited file" 
[master 76782c6] Edited file 
1 file changed, 3 insertions(+) 

$ git push 
Counting objects: 11, done. 
Delta compression using up to 4 threads. 
Compressing objects: 100% (10/10), done. 
Writing objects: 100% (11/11), 922 bytes | 0 bytes/s, done. 
Total 11 (delta 6), reused 0 (delta 0) 
remote: Checking connectivity: 11, done. 
remote: error: refusing to update checked out branch: refs/heads/master 
remote: error: By default, updating the current branch in a non-bare repository 
remote: is denied, because it will make the index and work tree inconsistent 
remote: with what you pushed, and will require 'git reset --hard' to match 
remote: the work tree to HEAD. 
remote: 
remote: You can set the 'receive.denyCurrentBranch' configuration variable 
remote: to 'ignore' or 'warn' in the remote repository to allow pushing into 
remote: its current branch; however, this is not recommended unless you 
remote: arranged to update its work tree to match what you pushed in some 
remote: other way. 
remote: 
remote: To squelch this message and still keep the default behaviour, set 
remote: 'receive.denyCurrentBranch' configuration variable to 'refuse'. 
To X:/Clients/ClientA/Website/ 
! [remote rejected] master -> master (branch is currently checked out) 
error: failed to push some refs to 'X:/Clients/ClientA/Website/' 

사람이 내가 사무실에서 그래서 여러 사람을 설정 얻을 수있는 방법에 대한 올바른 방향으로 날 지점 수 복제하고 네트워크 드라이브의 해당 위치로 밀어 넣을 수 있습니까?

감사합니다.

+1

과제물 읽기 : [4.1 서버 서버 - 프로토콜] (https://git-scm.com/book/en/v2/Git-on-the-Server-The-Protocols) – crashmstr

+0

감사합니다. 링크 나는 그것을 확실히 읽어 줄 것입니다! – KiwisTasteGood

답변

5

베어 메이드 저장소가 아닌 의 일반적인 사례는 아니며 오류 메시지에서 알 수 있듯이 기본적으로 사용하도록 설정되어 있지 않습니다. 작업 트리가없는 베어 리포지토리를 대신 사용하는 것이 좋습니다.

은이 같은 기존 /x/Clients/ClientA/Website/에서 베어 저장소를 만들 수 있습니다

git clone /x/Clients/ClientA/Website --bare /x/Clients/ClientA/Website.git 

이 후에는 /x/Clients/ClientA/Website.git에서 복제 할 수 있습니다 당신은 여기에 푸시 할 수 있습니다. 하지만 작업 트리를 가질 수는 없습니다.

예를 들어, 당신은 항상 master와 최신 작업 트리를 갖고 싶어, 경우

는 당신은 /x/Clients/ClientA/Website.git에서 해당위한 전용 복제본을 만들 수 있습니다, 당신은 설정 A의 git pull을 트리거 /x/Clients/ClientA/Website.git에 훅을 포스트 커밋 수 전용 클론.

+1

사실 이것은 사실입니다. 비 베어 레포로 푸시 할 수 있으며 올바른 구성으로 체크 아웃 된 지점으로 푸시 할 수도 있습니다. 기본 리모컨 *은 * 자주 묻는 repo –

+0

@ MarkAdelsberger만큼 적절하다는 점은 맞습니다. 나는 그 부분을 다시 언급했습니다. – janos

+0

설명을 주셔서 감사합니다. 그렇다면 작동하는 나무를 가지고 있지 않다는 것에 대한 몰락은 무엇입니까?모든 사람들이 변경 작업을 수행 할 때 추적해야하는 파일에 변경 사항 만 필요하므로 분기가 필요하지 않습니다. – KiwisTasteGood

1

"작업 트리"가있는 리모컨을 밀어 넣으려고하면 바로 그 저장소에서 체크 아웃 된 분기가 밀어 넣으려는 지점입니다. 다른 방법으로 생각해보십시오. 여러분은 지점 X에서 일하고 있고 다른 누군가는 지점 X로 밀어 넣으려고합니다. git이 당신의 발 아래에서 깔개를 당기는 것과 같을 것이므로 제한하고 싶습니다. 글쎄, 그게 다야.

관련 문제