Notice
Recent Posts
Recent Comments
Link
250x250
«   2025/05   »
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
Tags more
Archives
Today
Total
관리 메뉴

혼자서 앱 만드는 개발자 함께하는 AI 세상

✨ 로컬 Git 서버 만드는 방법 본문

카테고리 없음

✨ 로컬 Git 서버 만드는 방법

혼앱사 2025. 4. 28. 17:01
반응형

✨ 로컬 Git 서버 만드는 방법 (아주 기본 버전)

1. 서버로 쓸 컴퓨터에 Git 설치

bash
복사편집
sudo apt install git # (Linux) brew install git # (Mac) winget install --id Git.Git # (Windows)

2. "Bare Repository" 만들기

서버는 작업파일 없이 Git 데이터만 저장해야 해서 Bare 저장소를 만듭니다.

bash
복사편집
mkdir /path/to/your/repo.git cd /path/to/your/repo.git git init --bare

(※ .git 폴더 형태로 만들어야 합니다)

3. 클라이언트(개발자 PC)에서 리모트 연결

로컬 서버가 예를 들어 192.168.0.100 이라면:

bash
복사편집
git remote add origin user@192.168.0.100:/path/to/your/repo.git git push origin main

(초기 push할 때 main 또는 master 브랜치 주의!)


🚀 빠르게 정리

단계설명
1 서버로 쓸 컴퓨터에 Git 설치
2 git init --bare로 저장소 생성
3 클라이언트에서 git remote add로 연결

추가 팁

  • 파일 공유가 편하려면 SSH 서버를 같이 돌리는 걸 추천합니다 (Linux는 보통 openssh-server 설치).
  • Windows에서는 Git BashTortoiseGit 같은 툴 써도 됩니다.
  • 포트 포워딩을 하면 외부에서도 접속 가능합니다. (예: VPN, 프록시 이용)

✨ 더 고급으로 가면

  • Gitea, GitLab CE(Community Edition) 같은 웹 UI가 있는 Git 서버를 로컬에 띄울 수도 있어요!
    • Gitea는 가볍고, GitLab은 기능이 어마어마합니다.
    • 둘 다 무료입니다.
    • Docker로 5분 안에 설치 가능해요.

🔥 요약

"로컬에 git 서버 구축" = git init --bare + SSH 접속만 있으면 금방 끝!


👉 직접 따라할 수 있게 "초간단 Git 서버 설치 스크립트"도 만들어드릴까요?
(한 줄로 설치 끝나는 버전)

필요하시면 말해주세요! ✅/❌
(또는 "Gitea나 GitLab 같은 웹서버도 추천해줘"라고 하셔도 됩니다!) 🚀

4o

나의 말:

Let's install gitea
 

ChatGPT의 말:

좋습니다! 🚀
"로컬에 Gitea 설치"
Gitea는 가볍고 쉬운 Git 서버입니다. (GitHub처럼 웹에서 관리할 수 있어요.)

아주 간단하게 로컬에 Gitea 설치하는 방법 알려드릴게요.


🛠 Gitea 설치 방법

1. Gitea 바이너리 직접 설치 (초간단 방법)

(1) 서버용 폴더 만들기

bash
복사편집
mkdir -p ~/gitea/{custom,data,log}

(2) Gitea 다운로드 (Linux 기준)

bash
복사편집
wget -O ~/gitea/gitea https://dl.gitea.io/gitea/latest/gitea-$(uname -m)-linux chmod +x ~/gitea/gitea

Windows에서는 여기서 다운로드:
👉 https://dl.gitea.io/gitea/latest/

(3) 바로 실행

bash
복사편집
cd ~/gitea ./gitea web
  • 기본적으로 localhost:3000 에서 접속할 수 있어요!

2. 설치가 완료되면

브라우저에서 열기:

arduino
복사편집
http://localhost:3000

설정 화면이 뜹니다.

  • DB 선택: Sqlite3 (간단용) / MySQL / PostgreSQL
  • Repository Root Path: ~/gitea/data/gitea-repositories
  • Admin 계정 만들기
  • 기본 포트: 3000

그냥 다음, 다음으로 진행하면 됩니다.


🖥 전체 요약

단계명령어
Gitea mkdir -p ~/gitea/{custom,data,log}
Gitea 다운로드 wget 명령어
실행하기 ./gitea web
접속 URL http://localhost:3000

🎯 참고로

  • Linux 서버라면 systemd 서비스 등록도 가능합니다.
  • Docker를 쓰면 설치가 더 쉽습니다. (원하면 Docker 방법도 알려드릴게요)
  • Windows라면 gitea.exe 다운로드 후 더블클릭하면 끝납니다.

🎯 질문

"Gitea를 Docker로 설치하는 방법도 보여줄까요?"
(Docker는 서버 관리가 더 쉽고, 포트 매핑 등도 간편합니다)

필요하면 👉 ✅ Docker 설치 버전 보여줘! 라고 답

4o

나의 말:

저는 윈도우입니다.
 

ChatGPT의 말:

좋아요! ✨
윈도우에 Gitea 설치하는 방법은 정말 쉽습니다.
(리눅스보다 더 간단해요.)

아주 정리해서 바로 알려드릴게요.


🛠 Windows에 Gitea 설치하기

1. Gitea 실행 파일 다운로드

  • 공식 다운로드 페이지로 갑니다:
    👉 https://dl.gitea.io/gitea/latest/
  • gitea-xxx-windows-4.0-amd64.exe 파일을 다운로드합니다.
    (최신 버전, 64비트용)
    복사편집
    gitea-1.22.0-windows-4.0-amd64.exe
  • 예를 들면:

2. 적당한 폴더에 복사

예를 들면 C:\gitea\ 폴더를 하나 만들고,
그 안에 gitea.exe 파일을 넣습니다.

폴더 예시:

makefile
복사편집
C:\gitea\gitea.exe

3. Gitea 실행

명령어 입력할 필요도 없습니다.

  • gitea.exe 파일을 더블클릭해서 실행합니다.
  • 처음 실행하면 터미널창이 잠깐 뜨고, 서버가 켜집니다.

4. 브라우저에서 접속

열어주세요:

arduino
복사편집
http://localhost:3000

✅ Gitea 설치 마법사가 자동으로 나옵니다!

  • 데이터베이스 선택: SQLite3 (가장 간단)
  • Repository 저장 위치: 기본값 (C:\gitea\data\gitea-repositories) 사용
  • Admin 계정 만들기 (ID/PW 입력)
  • Save 눌러서 완료

✨ 전체 요약

단계설명
1 Gitea .exe 파일 다운로드
2 C:\gitea\gitea.exe 같은 폴더에 저장
3 더블클릭 실행
4 브라우저 localhost:3000 접속해서 설치 진행

추가 추천

"윈도우 서비스로 등록해서 자동실행" 도 가능합니다.

이건 서버처럼 만들고 싶을 때 설정하는 옵션입니다.
필요하면 이것도 바로 알려드릴게요!


✅ 정리

당장 시작하려면,
gitea.exe 파일만 다운받고 더블클릭 → 바로 웹으로 접속! 끝입니다.


👉 질문

"윈도우 부팅할 때 Gitea 자동 시작하게 하는 법"
"사용자 관리/접근권한 설정하는 법"
"프로젝트용 기본 템플릿 만들기"

이런 것도 궁금하세요?
필요하면 바로 이어서 도와드릴게요! 🚀

(간단하게 "자동시작 알려줘" 같이 말씀해주세요!) ✅/❌

4o

나의 말:

Can I change the port
 

ChatGPT의 말:

Yes! ✅
You can absolutely change Gitea’s port — it’s very easy.


🔥 How to change Gitea port on Windows

If you're running manually (just double-clicking gitea.exe):

1. Command line option

You can run Gitea with a custom port like this:

bash
복사편집
gitea.exe web --port 8080

➡️ This will make Gitea run on http://localhost:8080

2. Change app.ini config file

When Gitea runs for the first time, it creates a configuration file:

vbnet
복사편집
C:\gitea\custom\conf\app.ini

Open app.ini with Notepad or any text editor,
then find or add these lines:

ini
복사편집
[server] HTTP_PORT = 8080

Save it, then restart Gitea.
Now it will always start on port 8080.


📢 Where is app.ini?

Usually at:

vbnet
복사편집
C:\gitea\custom\conf\app.ini

If custom\conf\app.ini doesn’t exist yet,
you can create it manually with just:

ini
복사편집
[server] HTTP_PORT = 8080

🖥 Quick Example

OriginalAfter changing port
http://localhost:3000 http://localhost:8080

⚡ Summary

MethodDescription
Command line gitea.exe web --port 8080
Config file Edit app.ini → [server] HTTP_PORT = 8080

🎯 Bonus Tip

If you later want Gitea to also enable HTTPS,
you can set it inside the [server] section too:

ini
복사편집
[server] PROTOCOL = https HTTP_PORT = 8443 CERT_FILE = path\to\your\cert.pem KEY_FILE = path\to\your\key.pem

(But for now, just focus on HTTP/port 8080 first!)


✅ Next

Would you also like me to show you:

  • How to auto-start Gitea when Windows boots (as a service)
  • How to create repositories and invite users?

If yes, just say "Show me auto-start!" 🚀

4o

나의 말:

git config email username
 

ChatGPT의 말:

To configure your Git email and username locally or globally, follow these steps:

1. Set your email and username globally

This will apply to all repositories on your computer:

bash
복사편집
git config --global user.name "Your Name" git config --global user.email "your.email@example.com"

2. Set your email and username for a specific repository

If you want to set a different email/username for a specific repo, navigate to that repo and run:

bash
복사편집
git config user.name "Another Name" git config user.email "another.email@example.com"

This will override the global settings for this specific repository.

3. Check the current configuration

You can always check what’s currently set by running:

bash
복사편집
git config --global --list

This will show you the global configuration, including user.name and user.email.
To check the local settings within a specific repository, run:

bash
복사편집
git config --list

Summary

  • Global settings:
  • bash
    복사편집
    git config --global user.name "Your Name" git config --global user.email "your.email@example.com"
  • Repository-specific settings:
  • bash
    복사편집
    git config user.name "Another Name" git config user.email "another.email@example.com"
728x90
반응형
Comments