IT박스

힘내 어 봉사 : 나는 그것을 간단하게하고 싶습니다

itboxs 2020. 6. 24. 07:49
반응형

힘내 어 봉사 : 나는 그것을 간단하게하고 싶습니다


Mercurial 의 hg 서브 와 같이 http = 단순히 게시하는 방법을 알고 싶습니다 ! Windows / 작업 상자에서 다음을 수행하십시오.

git serve 

그런 다음 Linux 상자에서 간단하게 이동하십시오.

git clone http://project project 

끝마친.


다음 스위치로 프로젝트를 탐색하고 git-daemon을 시작하십시오.

cd project
git daemon --reuseaddr --base-path=. --export-all --verbose

이것은 git-daemon에게 현재 디렉토리 (.git / 폴더를 포함하는 프로젝트 디렉토리라고 가정) 내의 모든 프로젝트를 제공하도록 지시합니다. 또한 종료하고 너무 빨리 백업하면 동일한 주소를 다시 사용하도록 지시합니다.

이것을 "gitserve"와 같이 기억하기 쉬운 이름으로 배치 스크립트에 넣을 수 있으므로 다시 입력 할 필요가 없습니다. 일부 의견에서 제안한 것처럼 최신 버전의 Git 에서는 Git 구성에 별칭을 추가 할 수 있습니다 .

[alias]
    serve = !git daemon --reuseaddr --verbose --base-path=. --export-all ./.git

서버 (Windows 상자)에서 완료되면 다음을 수행 할 수 있습니다.

git serve

git-daemon은 전송을 위해 git : // 프로토콜을 사용하므로 클라이언트 (Linux 상자)에서 다음을 수행해야합니다.

git clone git://123.456.789.111/ project

자체 배치 스크립트를 작성하는 대신 gitjour를 사용 하십시오 . git 데몬을 올바르게 시작하는 방법을 알고 있으며 mDNS를 통해 복제 URL을 브로드 캐스트 gitjour show하여 Linux 상자에서 복사하여 붙여 넣을 수 있습니다.

또한 gitjour에 대한 개요와 Nic 박사의 여러 유사한 도구, * jour는 무엇이고 왜 RailsCamp08의 킬러 앱인지에 대한 좋은 기사 입니다.


현재 서브와 허브라는 두 개의 별칭을 사용하고 있습니다. 읽기 전용 공유 및 읽기 / 쓰기 공유 허브 제공 :

[alias]
  serve = !git daemon --base-path=. --export-all --reuseaddr --informative-errors --verbose
  hub = !git daemon --base-path=. --export-all --enable=receive-pack --reuseaddr --informative-errors --verbose

또한, 공유에 대한 자세한 튜토리얼이를 통해 자식 데몬 : http://l.rw.rw/git-daemon .


웹 브라우저로 리포지토리를 노출하려는 경우

git-instaweb

$ git instaweb -d apache2 --start
$ lynx localhost:1234

다른 방법이 있습니다. 파이썬이 설치되어 있어야합니다.

  • 운영 git update-server-info
  • .git디렉토리 로 이동
  • 운영 python -mSimpleHTTPServer

(gitconfig에서 별명을 만드십시오)

이제 리포지토리를 git pull http://HOST_NAME:8000/

추신 : git 데몬 솔루션을 사용할 --base-path=.git때 URL이되도록 설정할 수 있습니다git://HOST/


git-webui는 웹 기반 사용자 인터페이스와 다른 컴퓨터에서 복제 / 풀링하는 기능을 제공하는 git 확장입니다.

https://github.com/alberthier/git-webui

$ cd my_git_repo
$ git webui

다른 사람들은

$ git clone http://<ip-of-your-computer>:8000/ repoclone

또는

$ git pull http://<ip-of-your-computer>:8000/

.git / config에 다음 줄 추가

[instaweb]
               local = true
               httpd = webrick
               port = 4231

그런 다음 실행

git instaweb

Git 2.21 (2019 년 2 월)을 사용하면 파이썬과 git instaweb다음 을 결합 할 수 있습니다 .

See commit 2eb14bb (28 Jan 2019) by Arti Zirk (artizirk).
(Merged by Junio C Hamano -- gitster -- in commit abf39e3, 05 Feb 2019)

git-instaweb: add Python builtin http.server support

With this patch it is possible to launch git-instaweb by using Python http.server CGI handler via -d python option.

git-instaweb generates a small wrapper around the http.server (in GIT_DIR/gitweb/) that address a limitation of the CGI handler where CGI scripts have to be in a cgi-bin subdirectory and directory index can't be easily changed. To keep the implementation small, gitweb is running on url /cgi-bin/gitweb.cgi and an automatic redirection is done when opening /.

The generated wrapper is compatible with both Python 2 and 3.

Python is by default installed on most modern Linux distributions which enables running git instaweb -d python without needing anything else.

참고URL : https://stackoverflow.com/questions/377213/git-serve-i-would-like-it-that-simple

반응형