두통없이 빠르고 안전하게 일하십시오. 당신이 당신의 평생을 놓친 git 인터페이스가 마침내 도착했습니다.
GIT는 최근 10 주년을 기념했지만 대부분의 엔지니어들은 여전히 복잡성으로 혼란스러워합니다 (Stack Overflow에서 모든 시간의 상위 5 개 질문 중 3 개는 GIT 관련입니다). GIT는 간단한 행동을 신비한 명령으로 바꾸므로 ( "Git Add"와 무대에 대하여 "Git Reset Head"를 무시하지 않도록 하는가?), 사용자가 시간을 낭비하고 좌절하고 나머지 팀을 도움을주기 위해 산만하게하는 것은 놀라운 일이 아닙니다. 그들의 repo를 망쳐 놓으십시오!
Gitup은 모든 레벨의 엔지니어가 두통없이 빠르고 안전하게 작동 할 수있는 새로운 GIT 상호 작용 모델을 발명하는 것에 대해 내기입니다. 다른 GIT 클라이언트와는 달리 건축 된 방식 (디스크의 GIT 데이터베이스와 직접 상호 작용 함)에서 작동 방식 (커밋을 조작하는 대신 저장소 그래프를 조작)까지.
Gitup을 사용하면 Mac에 대한 진정으로 효율적인 GIT 클라이언트를 얻을 수 있습니다.
Gitup은 2014 년 말 @swisspol에 의해 개발자가 GIT와 상호 작용하는 방식을 재창조하기위한 베팅으로 만들었습니다. 몇 달 동안 작업 한 후 2015 년 초반에 출시 될 예정이며 Product Hunt 및 Daring Fireball의 주요 기능과 함께 Hacker News의 최고에 도달했습니다. 30,000 줄의 코드 후, Gitup은 2015 년 8 월 중순 1.0에 도달했으며 개발자 커뮤니티에 선물로 오픈 소스로 출시되었습니다.
brew install homebrew/cask/gitup
(Note: There is already a formula called gitup, so the full name must be specified!)문서를 읽고 지원 및 피드백을 위해 GitHub 문제를 사용하십시오.
릴리스 노트는 https://github.com/git-up/gitup/releases에서 제공됩니다. Builds tagged with a v
(eg v1.2.3
) are released on the "Stable" channel, while builds tagged with a b
(eg b1234
) are only released on the "Continuous" channel. 앱 환경 설정에서 Gitup에서 사용하는 업데이트 채널을 변경할 수 있습니다.
To build GitUp yourself, simply run the command git clone --recursive https://github.com/git-up/GitUp.git
in Terminal, then open the GitUp/GitUp.xcodeproj
Xcode project and hit Run.
IMPORTANT: If you do not have an Apple ID with a developer account for code signing Mac apps, the build will fail with a code signing error. 문제를 해결하기 위해 "응용 프로그램"대상의 "코드 서명 아이덴티티"빌드 설정을 삭제하기 만하면됩니다.
Alternatively , if you do have a developer account, you can create the file "Xcode-Configurations/DEVELOPMENT_TEAM.xcconfig" with the following build setting as its content:
development_team = [당신의 teamID]
이에 대한 자세한 설명을 보려면 "xcode-configurations/base.xcconfig"파일 끝의 주석을 살펴볼 수 있습니다.
Gitup은 "Gitupkit"이라는 재사용 가능한 일반 Git 툴킷 위에 얇은 층으로 제작되었습니다. 이것은 동일한 Gitupkit 프레임 워크를 사용하여 자신의 Git UI를 구축 할 수 있음을 의미합니다!
Gitupkit은 ObjectiveGit과는 매우 다른 목표를 가지고 있습니다. Gitupkit은 Libgit2에 광범위한 원시 바인딩을 제공하는 대신 Libgit2의 최소 하위 집합을 사용하고 그 위에 다른 모든 것을 상환합니다 (예 : 자체 "Rebase 엔진"이 있습니다). 이를 통해 매우 단단하고 일관된 API를 노출시켜 OBJ-C 컨벤션을 완전히 따르고 libgit2 복잡성과 때로는 불일치를 숨 깁니다. Gitupkit은 스냅 샷과 같은 실행 취소/레디 및 타임 머신에서 전체 드롭 인 UI 구성 요소에 이르기까지 여러 독점적이고 강력한 기능을 추가합니다.
Gitupkit 소스 코드는 공개 API의 사용을 통해서만 통신하는 2 개의 독립 계층으로 구성됩니다.
기본 계층 (기초에만 의존하며 OS X 및 iOS와 호환됩니다)
Core/
: wrapper around the required minimal functionality of libgit2, on top of which is then implemented all the Git functionality required by GitUp (note that GitUp uses a slightly customized fork of libgit2)Extensions/
: categories on the Core
classes to add convenience features implemented only using the public APIsUI 레이어 (AppKit에 따라 다르며 OS X 와만 호환됩니다)
Interface/
: low-level view classes eg GIGraphView
to render the GitUp Map viewUtilities/
: interface utility classes eg the base view controller class GIViewController
Components/
: reusable single-view view controllers eg GIDiffContentsViewController
to render a diffViews/
: high-level reusable multi-views view controllers eg GIAdvancedCommitViewController
to implement the entire GitUp Advanced Commit view IMPORTANT : If the preprocessor constant DEBUG
is defined to a non-zero value when building GitUpKit (this is the default when building in "Debug" configuration), a number of extra consistency checks are enabled at run time as well as extra logging. 이 오버 헤드는 성능에 크게 영향을 줄 수 있습니다.
Gitupkit API를 사용하는 것은 기능 (예 : 리포지토리, 분기, 커밋, 인터페이스 구성 요소 등)에 의해 구성되므로 매우 간단해야하며 기능을 명확하게 지정하기 위해 최선의 노력을 기울였습니다.
"Core"API와 관련하여이를 배우는 가장 좋은 방법은 관련 단위 테스트를 숙독하는 것입니다. 예를 들어 Branch API의 분기 테스트를 참조하십시오.
다음은 시작할 수있는 샘플 코드입니다 (오류 처리는 독자에게 연습으로 남겨 둡니다) :
저장소 열기 및 탐색 :
// Open repo
GCRepository* repo = [[GCRepository alloc ] initWithExistingLocalRepository: <PATH> error: NULL ];
// Make sure repo is clean
assert ([repo checkClean: kGCCleanCheckOption_IgnoreUntrackedFiles error: NULL ]);
// List all branches
NSArray * branches = [repo listAllBranches: NULL ];
NSLog ( @" %@ " , branches);
// Lookup HEAD
GCLocalBranch* headBranch; // This would be nil if the HEAD is detached
GCCommit* headCommit;
[repo lookupHEADCurrentCommit: &headCommit branch: &headBranch error: NULL ];
NSLog ( @" %@ = %@ " , headBranch, headCommit);
// Load the *entire* repo history in memory for fast access, including all commits, branches and tags
GCHistory* history = [repo loadHistoryUsingSorting: kGCHistorySorting_ReverseChronological error: NULL ];
assert (history);
NSLog ( @" %lu commits total " , history.allCommits.count);
NSLog ( @" %@ n %@ " , history.rootCommits, history.leafCommits);
저장소 수정 :
// Take a snapshot of the repo
GCSnapshot* snapshot = [repo takeSnapshot: NULL ];
// Create a new branch and check it out
GCLocalBranch* newBranch = [repo createLocalBranchFromCommit: headCommit withName: @" temp " force: NO error: NULL ];
NSLog ( @" %@ " , newBranch);
assert ([repo checkoutLocalBranch: newBranch options: 0 error: NULL ]);
// Add a file to the index
[[ NSData data ] writeToFile: [repo.workingDirectoryPath stringByAppendingPathComponent: @" empty.data " ] atomically: YES ];
assert ([repo addFileToIndex: @" empty.data " error: NULL ]);
// Check index status
GCDiff* diff = [repo diffRepositoryIndexWithHEAD: nil options: 0 maxInterHunkLines: 0 maxContextLines: 0 error: NULL ];
assert (diff.deltas.count == 1 );
NSLog ( @" %@ " , diff);
// Create a commit
GCCommit* newCommit = [repo createCommitFromHEADWithMessage: @" Added file " error: NULL ];
assert (newCommit);
NSLog ( @" %@ " , newCommit);
// Restore repo to saved snapshot before topic branch and commit were created
BOOL success = [repo restoreSnapshot: snapshot withOptions: kGCSnapshotOption_IncludeAll reflogMessage: @" Rolled back " didUpdateReferences: NULL error: NULL ];
assert (success);
// Make sure topic branch is gone
assert ([repo findLocalBranchWithName: @" temp " error: NULL ] == nil );
// Update workdir and index to match HEAD
assert ([repo resetToHEAD: kGCResetMode_Hard error: NULL ]);
GitDown is a very basic app that prompts the user for a repo and displays an interactive and live-updating list of its stashes (all with ~20 lines of code in -[AppDelegate applicationDidFinishLaunching:]
):
Gitupkit을 통해이 기본 앱은 무료 무제한 실행 취소/Redo, Unified 및 Sweing Side Diff, 텍스트 선택 및 복사, 키보드 바로 가기 등을 제공합니다.
이 소스 코드는 또한 다른 Gitupkit View 컨트롤러를 사용하고 맞춤형 컨트롤러를 구축하는 방법을 보여줍니다.
GitDiff demonstrates how to create a view controller that displays a live updating diff between HEAD
and the workdir à la git diff HEAD
:
Gity는 Gitupkit을 사용하여 제작되었으며 200 줄 미만의 코드입니다.
Igit은 Gitupkit을 사용하여 Github Repo를 복제하고 커밋을 수행하는 테스트 iOS 앱입니다.
Contributing.md를 참조하십시오.
또한 Gitup이 존재하지 않았던 훌륭한 libgit2 기고자들에게도 큰 감사를드립니다!
Gitup은 Copyright 2015-2018 Pierre-Olivier Latour이며 GPL V3 라이센스에 따라 제공됩니다. 자세한 내용은 프로젝트의 라이센스 파일을 참조하십시오.
IMPORTANT: GitUp includes some other open-source projects and such projects remain under their own license.