본문 바로가기
프로그래밍/github써보자

우분투 서버 깃(GIT) 세팅(깃허브 소스 내려받고, 수정해서, 올리기)

by 0pen3r 2025. 1. 17.
반응형

우분투 서버 만들고, GIT에서 파일 내려받고, 소스 업데이트 해서, GIT에 올리는 방법


1. 우분투 서버 git 설치

apt update
apt install git

 

2. git 환경 설정 저장(깃허브 아이디 및 메일)

git config --global user.name "Your Name"
git config --global user.email "your-email@example.com"

 

3-1. 깃허브에서 소스 다운로드

git clone https://github.com/blabla~~.git

 

3-2. 깃허브에서 소스 다운로드(3-1)된 이후, 최신 소스 다운로드 명령어

git pull origin main
// master면 master로

 

4. 소스 업데이트를 위해 테스트 파일 만들어봄

echo "test" > test.txt

 

5. 변경된 소스코드 깃에 업로드

add => commit => push 순서를 기억하자.

git add .
git commit -m "Commit message"
git push origin main
//main or master or others

 

- username = 깃허브 아이디

- password = 깃허브 Personal access tokens

 

 

 

 

Personal access tokens발급방법은 아래

https://0pen3r.tistory.com/459

 

깃허브 push 로그인 에러 해결(fatal: Authentication failed for 에러 해결), New personal access token 발급 방법

깃허브 push 할 때 계정 정보 입력하해서, 입력했더니 패스워드 틀렸다고 나오는 이슈이유 : 깃허브 정책이 바뀜(변경된 내용) 비밀번호 대신 토큰 인증 필요(해결 방법) 개인 인증 토큰 사용 설정

0pen3r.tistory.com

 

 

끝이다.

 

728x90
반응형