커맨드로 작업하는 일이 많이 없다고 하지만, 익숙해지기 위해서 정리해서 사용하고 있다.
최신 버젼 문서 : https://github.com/hyunW3/gitgit
How to commit the git
- git init
- git config --global user.name "name"
- git config --global user.email "tour email"
- git add [something]
- git commit -m " [ recode the message ]
- git remote add origin "@hyunW3~ ... "
6-1 git remote -v local repo connect to remote repo
- git pull # in local git pull origin master # at first Or you could set it up so that your local master branch tracks github master branch as an upstream: git branch --set-upstream-to=origin/master master git pull This branch tracking is set up for you automatically when you clone a repository (for the default branch only), but if you add a remote to an existing repository you have to set up the tracking yourself. Thankfully, the advice given by git makes that pretty easy to remember how to do
- 7-2. git pull 시 error = fatal: refusing to merge unrelated histories -> git pull origin [branchname] --allow-unrelated-histories
- git push origin master # to the web
temperary not asking
1-1. git config credential.helper store -> almost perment
1-2. git config credential.helper 'cache --timeout=360' -> default min:15 --global 옵션으로 모든 git 활동에서 저장된 정보 이용
해당 기록 삭제 : git config --local --unset credential.helper
restore the git commit
- git log (to find log data)
- git reset --hard (your commit log, ex)64a0de...) 또는 git reset HEAD^ (한번 뒤로) / HEAD^^ (두번 뒤로) 사용하자
git reset 취소
- git reflog
- git reset --hard HEAD@{이동하고 싶은 번호}
links : rogerdudler.github.io/git-guide/index.ko.html
over 100MB commit cancel
커밋전에 .gitignore 설정 잘하자! rtyley.github.io/bfg-repo-cleaner
- jar file 다운받고 / java를 설치한다
- 해당 repo 에서 java -jar bfg-1.13.0.jar(버전 맞추어서) --strip-blobs-bigger-than 100M
- git repack && git gc (에러 발생시)
- git push 하면 된다.
출처: vateran.tistory.com/51 [BrainDump]
make tree project
(ex project A include subproject B,C) A /
B C
- make repo of A, then connect to github repo
- git subtree add --prefix=[name] [github url of B,C each]
- then pull & push
#Question git commit, git checkout, git merge
#Problem
- waring: CRLF will be replaced by LF in ... [unix OS user] or LF will be replaced by CRLF in .. [window user]
Solution: enable "core.autocrlf" As window user git config --global(optional) core.autocrlf true AS linux or Mac git config --global(optional) core.autocrlf true input (input은 단방향을 의미) index : blog.jaeyoon.io/2018/01/git-crlf.html
links : https://rogerdudler.github.io/git-guide/index.ko.html
'프로그래밍' 카테고리의 다른 글
[Virtualbox & MacOS] Failed to query SMC value from the host (VERR_INVALID_HANDLE). (2) | 2022.04.12 |
---|---|
[rustc] cargo run 시 error: linking with `x86_64-w64-mingw32-gcc` failed: exit code: 1 (0) | 2021.12.09 |
[OpenCV] 컴파일 에러 error while loading shared libraries: libopencv_highgui.... (0) | 2020.02.15 |
vscode input 파일이용하기 (0) | 2020.01.30 |
과제 2 ResNet.ipynb (1) | 2019.06.22 |