문제
CVS 지점에서 확인 된 파일을 제거했습니다.
cvs remove -f file.txt
cvs commit
파일을 어떻게 복원합니까?
해결책
나는 그것을 믿는다 :
cvs add file.txt
cvs commit file.txt
... 다락방에서 그것을 부활시킬 것입니다.
다른 팁
나는 당신이 사용할 수 없다는 것을 알았습니다 cvs add
a cvs remove
이미 통합 된 작업. 그래서 이것은 작동합니다 :
$ cvs remove -f file.txt
$ cvs add file.txt
그러나 이것은 작동하지 않습니다.
$ cvs remove -f file.txt
$ cvs commit
$ cvs add file.txt
내가 지금까지 찾은 가장 간단한 방법은 실행하는 것입니다. cvs status file.txt
개정 번호를 찾기 위해. 그런 다음 개정 내용을 잡고 다시 추가하십시오.
$ cvs update -p -r rev file.txt > file.txt
$ cvs add file.txt
$ cvs commit
그만큼 cvs add
서버의 CVS 버전이 매우 오래 되었기 때문에 나에게 효과가 없었습니다. CVS 버전 1.11.22에서 잘 작동한다는 것을 확인했습니다.
노력하다:
cvs add file.txt
cvs update file.txt
cvs commit file.txt
Harry의 성공 부족을 감안할 때, 여기에 위의 답변이 작동한다는 것을 보여주기 위해 내가 한 일에 대한 사본이 있습니다 (길이에 대한 사전 사과) :
C:\foo>dir
Volume in drive C is Local Disk
Volume Serial Number is 344F-1517
Directory of C:\foo
28/09/2008 05:12 PM <DIR> .
28/09/2008 05:12 PM <DIR> ..
28/09/2008 05:12 PM <DIR> CVS
28/09/2008 05:11 PM 19 file.txt
1 File(s) 19 bytes
3 Dir(s) 22,686,416,896 bytes free
C:\foo>cvs status file.txt
===================================================================
File: file.txt Status: Up-to-date
Working revision: 1.2 Sun Sep 28 07:11:58 2008
Repository revision: 1.2 C:\jason\CVSROOT/foo/file.txt,v
Sticky Tag: (none)
Sticky Date: (none)
Sticky Options: (none)
C:\foo>cvs rm -f file.txt
cvs remove: scheduling `file.txt' for removal
cvs remove: use 'cvs commit' to remove this file permanently
C:\foo>cvs commit -m "" file.txt
Removing file.txt;
C:\jason\CVSROOT/foo/file.txt,v <-- file.txt
new revision: delete; previous revision: 1.2
done
C:\foo>cvs status file.txt
===================================================================
File: no file file.txt Status: Up-to-date
Working revision: No entry for file.txt
Repository revision: 1.3 C:\jason\CVSROOT/foo/Attic/file.txt,v
C:\foo>more file.txt
Cannot access file C:\foo\file.txt
C:\foo>dir
Volume in drive C is Local Disk
Volume Serial Number is 344F-1517
Directory of C:\foo
28/09/2008 05:12 PM <DIR> .
28/09/2008 05:12 PM <DIR> ..
28/09/2008 05:12 PM <DIR> CVS
0 File(s) 0 bytes
3 Dir(s) 22,686,400,512 bytes free
C:\foo>cvs add file.txt
cvs add: Resurrecting file `file.txt' from revision 1.2.
U file.txt
cvs add: Re-adding file `file.txt' (in place of dead revision 1.3).
cvs add: use 'cvs commit' to add this file permanently
C:\foo>cvs commit -m "" file.txt
Checking in file.txt;
C:\jason\CVSROOT/foo/file.txt,v <-- file.txt
new revision: 1.4; previous revision: 1.3
done
C:\foo>more file.txt
This is a test...
C:\jason\work\dev1\nrta\foo>dir
Volume in drive C is Local Disk
Volume Serial Number is 344F-1517
Directory of C:\jason\foo
28/09/2008 05:15 PM <DIR> .
28/09/2008 05:15 PM <DIR> ..
28/09/2008 05:13 PM <DIR> CVS
28/09/2008 05:13 PM 19 file.txt
1 File(s) 19 bytes
3 Dir(s) 22,686,375,936 bytes free
분명히 그는 옳은 일을하고 있지만 그가 관찰하는 행동은 다릅니다. CVS 버전으로 인해 차이가있을 수 있습니다 (Windows에서 1.11.22를 사용하고 있습니다).
CD에 $ CVSROOT 디렉토리와 관련 모듈 디렉토리에 CD를 넣은 다음 다락방으로, 파일을 편집하고 v를 편집하고 죽은 줄을 변경합니다. Exp; 그런 다음 파일 파일을 위의 디렉토리로 이동하십시오.
확인 된 모듈의 업데이트가 이제 파일을 복원합니다.
가장 간단하지만이를 수행하는 가장 우아한 방법은 제거 된 파일과 동일한 위치의 CVS 디렉토리에 'CD'를 'CD'하는 것입니다.
그런 다음 "entries"라는 파일을 편집하십시오.
제거 된 파일을 나타내는 줄을 찾으십시오. / 후에 '-'가 있습니다.
'-'를 제거하고 파일과 voila를 저장하십시오!
yuck, 그러나 그것은 작동합니다.
여기 내가하는 일이 있습니다. 나는 단지 같은 이름의 빈 파일을 만든 다음 추가하고 커밋 한 다음 이전 버전을 검색하고 다시 커밋합니다.