빡코

(수정요) git 본문

Nonclassified

(수정요) git

chris.djang 2019. 12. 18. 15:26

최근  commit으로 가기 

 

 

cd \업로드 하고자 하는 디렉토리로 이동
git init
git remote add origin [repostory 주소]
git remote -v  //주소확인
git remote remove origin

 

처음 프로젝트를 push할 경우에는 히스토리를 합쳐줘야 한다. 이렇게 

refusing to merge unrelated histories
git pull origin 브런치명 --allow-unrelated-histories

**--allow-unrelated-histories   이 명령 옵션은 이미 존재하는 두 프로젝트의 기록(history)을 저장하는 드문 상황에 사용된다고 한다. 즉, git에서는 서로 관련 기록이 없는 이질적인 두 프로젝트를 병합할 때 기본적으로 거부하는데, 이것을 허용해 주는 것이다.

 

그런 다음 

git add * 하면 모든 파일이 올라고 
git commit  -m "커밋 메세지"
git push -u origin master  //pushrk 완료된다. 

 

 :q! // 커밋 수정창 빠져나오기 

 

특정 버전으로 돌아가기

참조: mytory.net/archives/10078

 

git update 

git 업데이트 명령어 : git update-git-for-windows

 

 

장영섭@DESKTOP-O0Q4OIL MINGW64 /c/tutorial/2023-Spring-Basic- (master)
$ git status
On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean

** https://git-scm.com/book/ko/v2/Git%EC%9D%98-%EA%B8%B0%EC%B4%88-%EC%88%98%EC%A0%95%ED%95%98%EA%B3%A0-%EC%A0%80%EC%9E%A5%EC%86%8C%EC%97%90-%EC%A0%80%EC%9E%A5%ED%95%98%EA%B8%B0

 

 

신규브런치에서 push 하기

//Branch 신규생성 
chris @DESKTOP/c/tutorial/jpabook (master)
$ git checkout -b developer1

//git add .
//git commit -m "커밋 메세지"

//git branch 확인 
chris @DESKTOP /c/tutorial/jpabook (developer1)
$ git branch
* develope1 --> 현재 Branch 

//branch 변경 
chris @DESKTOP  /c/tutorial/jpabook (master)
$ git checkout developer1
Switched to branch 'developer1'


chris @DESKTOP  /c/tutorial/jpabook (developer1)
$ git push
fatal: The current branch developer1 has no upstream branch.
To push the current branch and set the remote as upstream, use

    git push --set-upstream origin developer1

To have this happen automatically for branches without a tracking
upstream, see 'push.autoSetupRemote' in 'git help config'.


chris @DESKTOP  /c/tutorial/jpabook (developer1)
$ git push --set-upstream orign developer1
fatal: 'orign' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

chris @DESKTOP  /c/tutorial/jpabook (developer1)
$ git push --set-upstream origin developer1
git Enumerating objects: 110, done.
Counting objects: 100% (110/110), done.
Delta compression using up to 4 threads
Compressing objects: 100% (89/89), done.
Writing objects: 100% (94/94), 478.55 KiB | 3.37 MiB/s, done.
Total 94 (delta 24), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (24/24), completed with 5 local objects.
remote:
remote: Create a pull request for 'developer1' on GitHub by visiting:
remote:      https://깃허브 주소
remote:
To https:///깃허브주소
 * [new branch]      developer1 -> developer1
branch 'developer1' set up to track 'origin/developer1'.

 

참고 하여 정리할 블로그 

https://wonit.tistory.com/368

https://heytech.tistory.com/289