2014-12-30 4 views
3

내 응용 프로그램에서 파일을 업데이트, 수정 및 제거했으며 이제 커밋 할 준비가되었습니다.<pathspec>은 무엇인가요?

C:\G\ab\WebAdminApp>git status 
On branch master 
Your branch is up-to-date with 'origin/master'. 

Changes not staged for commit: 
    (use "git add/rm <file>..." to update what will be committed) 
    (use "git checkout -- <file>..." to discard changes in working directory) 

     modified: WebAdminApp.csproj 
     modified: WebAdminApp.csproj.user 
     modified: app/admin/controllers/ContentController.ts 
     deleted: app/admin/interfaces/IEnumService.ts 
     modified: app/admin/interfaces/IHomeController.d.ts 
     modified: lib/pagedown/Markdown.Sanitizer.ts 
     deleted: lib/typings/global.ts 
     modified: package.json 
     modified: ../abilitest-admin.v12.suo 

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

     app/interfaces/IEnumService.d.ts 
     app/interfaces/IUtilityService.d.ts 
     ../npm-debug.log 

변경 확정 추가되지 내가 입력하면 (사용 "자식 추가"및/또는 "자식 -a 커밋")

:

git add . 

그것은 제공 여기 상태입니다 내게 말하고있는 메시지 :

C:\G\ab\WebAdminApp>git add . 
warning: You ran 'git add' with neither '-A (--all)' or '--ignore-removal', 
whose behaviour will change in Git 2.0 with respect to paths you removed. 
Paths like 'WebAdminApp/app/admin/interfaces/IEnumService.ts' that are 
removed from your working tree are ignored with this version of Git. 

* 'git add --ignore-removal <pathspec>', which is the current default, 
    ignores paths you removed from your working tree. 

* 'git add --all <pathspec>' will let you also record the removals. 

내 로컬 PC에서 커밋 된 모든 작업을 수행하고 싶은데 GITHUB에서 마스터를 원한다. 이것을 반영하십시오.

어떤 사람이 무엇을 의미하는지 설명 할 수 있습니까? 및 모든 변경 사항이 git commit을 통해 커밋 될 수 있도록 지금 입력해야하는 항목은 무엇입니까? 미안해. 나에게 분명하지 않아. 디렉토리입니까?

+2

메시지를 읽었습니까? – twalberg

+1

예 메시지를 읽었습니다. 그것은 "gitadd -all "의 사용을 제안합니다. 내가 묻는 곳에서 내 질문을 읽었습니까? 은 무엇입니까? 나는 그것이 git을 아는 사람에게는 매우 분명하다고 생각하지만, 새로운 사용자는 우리 모두가 이 무슨 뜻인지 알고 있다고 생각합니까? –

+2

@SamanthaJ [* "pathspec"은 와일드 카드 사용을 포함하여 Git에서 사물에 대한 경로를 지정하는 방법을 나타냅니다. 이것들은'.gitignore' 파일뿐만 아니라 커맨드 라인 ('git add * .c')에서도 사용됩니다. *] (http://git-scm.com/book/en/v2/Git-Internals -Environment-Variables # Pathspecs) – Jubobs

답변

1

삭제 한 파일이 리포지토리에서도 삭제되도록하려면 git add --all .을 수행하십시오. 저장소에서 삭제하지 않으려면 git add --ignore-removal .을 수행하십시오. Git Glossary 가입일

1

:

힘내 명령의 경로를 제한하는 데 사용되는 [A pathspec는 패턴이다]가.

Pathspec은 "git ls-files", "git ls-tree", "git add", "git grep", "git diff", "git checkout"및 기타 많은 명령의 명령 줄에서 사용됩니다 작업 범위를 트리 또는 작업 트리의 일부 하위 집합으로 제한합니다.

는 예를 들어, 명령 git add :/**.ts 재귀 인덱스 (파일을 무시하는 다양한 방법을 존중) 저장소의 루트에서 시작 .ts로 끝나는 모든 파일을 추가합니다.

+0

:/git root는 상대 경로를 사용하지 않고 파일을 체크 아웃하는 데 매우 유용합니다. TYVM – jrwren