웹마짱구의 블로그

git 서버 만들기

Git2020. 3. 24. 18:21
728x90

참고1:https://git-scm.com/book/ko/v2/Git-%EC%84%9C%EB%B2%84-%EC%84%9C%EB%B2%84-%EC%84%A4%EC%A0%95%ED%95%98%EA%B8%B0

참고2: https://www.youtube.com/watch?v=sAeXpcGCQfI

 

[서버]

$ mkdir git_test

$ cd git_test

$ git init --bare remote

$ cd remote

 

[hooks/post-receive]

#!/bin/bash
TARGET="/home/web/deploy"
GIT_DIR="/home/web/remote"
BRANCH="master"

while read oldrev newrev ref
do
# only checking out the master (or whatever branch you would like to deploy)
if [ "$ref" = "refs/heads/$BRANCH" ];
then
echo "Ref $ref received. Deploying ${BRANCH} branch to production..."
git --work-tree=$TARGET --git-dir=$GIT_DIR checkout -f $BRANCH
else
echo "Ref $ref received. Doing nothing: only the ${BRANCH} branch may be deployed on this server."
fi
done

 

[클라이언트]

$ git init local

$ cd local

$ vi f1.txt

$ git add f1.txt

$ git commit -m 1

$ git remote add origin ssh://jjangu@192.168.1.20/home/jjangu/git_test/remote/

$ git remote -v

origin  ssh://jjangu@192.168.1.20/home/jjangu/git_test/remote/ (fetch)
origin  ssh://jjangu@192.168.1.20/home/jjangu/git_test/remote/ (push)

$ git push --set-upstream origin master

 

728x90

https://stackoverflow.com/questions/27129904/pageant-refuses-to-load-ssh-2-key-generated-with-gitbash

 

Pageant refuses to load SSH-2 key generated with GitBash

The implementation of key handling with (Tortoise)Git for Windows confuses me. As far as I understood, you can implement with either ssh.exe (gits own ssh program), where you can then choose an ssh...

stackoverflow.com

 

Pageant는 PuTTY 형식 ( .ppk)으로 만 키를로드 할 수 있습니다 .

PuTTY 도구에서 여전히 인식하는 다른 형식으로 키를로드하려고하면 언급 된 오류 메시지가 표시됩니다.

이 키를로드 할 수 없습니다 (OpenSSH-SSH-2 개인 키)

 를 OpenSSH 형식에서 PuTTY 형식으로 변환하려면 PuTTYgen  사용해야 합니다. Pageant가 파일 형식을 인식하면 PuTTYgen이 파일 형식을 변환 할 수 있습니다.

  • PuTTYgen을 실행하십시오.
  • 개인 키를 OpenSSH 형식으로로드하려면 로드  누르십시오 .
  • 개인 키 저장을 눌러 개인 키를 .ppk형식으로 저장하십시오 .
  • 이제 개인 키 .ppk를 Pageant 형식으로 로드 할 수 있습니다 .

원격 저장소 만들기

Git2018. 12. 7. 12:11
728x90

$ git init --bare git_folder