'_'

how to use GitHub 본문

자료용

how to use GitHub

YISUP 2018. 1. 11. 22:56

Basically, GitHub is sort of system creating repository at GitHub and copy&clone it to our local computer. By this way, it works like google drive. But it needs to be set up using terminal with command line, and steps are like this :

1. Create repository from GitHub

2. Copy&Clone it to local machine my terminal

3. work in that folder and commit > push to GitHub



cd ~/Documents/GitHub > to my GitHub directory

cd ../ > going upper level folder

ls > list

ls -a > list even hidden file

git clone + URL of repo

git log > check commit is there

q > to exit

git remote -v > shows remotes(which is not on my local com like google drive)

git pull > pull down from other's repository (like git.desktop sink thing)

git push -u origin master > only at the first time

git push origin master > opposite from above


*also if you accidentally created useless branch, and merged or deleted via GitHub desktop, anyway likely to get error when you try to push or type git pull, staying  fatal: refusing to merge unrelated histories

https://stackoverflow.com/questions/37937984/git-refusing-to-merge-unrelated-histories

as link above suggests, 

git pull origin master --allow-unrelated-histories

will solve the problem though I could not figure out how to exit from the state. Anyway after typing that push enter and in my case I just quited terminal since I dont know how to navigate, then open termainal and go to GitHub repo again and commited and merging problem solved.


to upload changes to GitHub-

1) git status > check the status

2) git add . /git add + file name (git add new.html) > update commit to git hub

3) git commit -m "write a messege here"

4) git push origin master > to push commits to github repo un-to-date (repo is differ from my local com)

also be careful about branch. In my case master / lyric_styling are seperated.







'자료용' 카테고리의 다른 글

RISD_SPRING18_DIGITAL + MEDIA THEORY_Tiven  (0) 2018.01.19
HTML/CSS_BGrepeat_content  (0) 2018.01.14
redaction  (0) 2017.12.07
watering basil!  (0) 2017.12.06
MAXMSP-Basic  (0) 2017.11.27