본문 바로가기
조회 수 1388 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

+ - Up Down Comment Print Files
?

단축키

Prev이전 문서

Next다음 문서

+ - Up Down Comment Print Files

1. Sign up for a new github account


2. Create a new repository in github

https://github.com/new
01.png
02.png

Note: Keep the following commands
touch README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/hojungyun/random-key-generator.git

git push -u origin master 



3. From local machine, configure global settings


git config --global user.name "Hojung Yun"
git config --global user.email hojung_yun@yahoo.co.kr

$ git config --list
user.name=Hojung Yun
user.email=hojung_yun@yahoo.co.kr

$ cat ~/.gitconfig 
[user]
name = Hojung Yun
email = hojung_yun@yahoo.co.kr   

Note: type of git configs
System config: /etc/gitconfig
User config: ~/.gitconfig
Local config: repository's .git/config

4. (option) create new ssh key with comment if not exist

ssh-keygen -t rsa -C "hojung_yun@yahoo.co.kr"

5. copy the key and add to Github account

cat ~/.ssh/id_rsa.pub <------ copy the output of the key
Go to https://github.com/settings/ssh
03.png

6. SSH connection test

# ssh -T git@github.com
Hi hojungyun! You've successfully authenticated, but GitHub does not provide shell access.    


7. Git initiation for individual project


cd my_project
git init .

vi README.md
------------------8<--------------------
Random Key Generator
==
Generating random key with upper lower numbers and symbols.
------------------8<--------------------
Note: .md file uses github flavored markdown syntax (https://help.github.com/articles/github-flavored-markdown)

vi .gitignore
------------------8<--------------------
# Ignore all rubymine project configuration files
.idea
------------------8<--------------------

git add -A
git commit -m "first commit"
git status

8. Add GitHub as a remote repository


git remote add origin https://github.com/hojungyun/random-key-generator.git
git push -u origin master
<------- you need to enter username and password for the first time

Note: The -u option sets up Git so you can use git push in the future without explicitly specifying GitHub as the destination.

9. Verify from github

https://github.com/hojungyun/random-key-generator.git
04.png

10. change code and commit

vi README.md
git add -A
git commit -m "update README"
git push origin master
<------- or just run 'git push'


11. go back to the latest commit after add


touch test.txt
git status <---------- Untracked files: test.txt
git add -A
git status <---------- Changes to be committed: new file:   test.txt

git reset --hard HEAD
ls text.txt <--------- 파일 발견 안됨
git status <---------- nothing to commit, working directory clean (미지막 commit으로 돌아감. 모든 변경사항이 없어짐)


Title
List of Articles
번호 제목 글쓴이 날짜 조회 수
31 Different Ways to Set Attributes in ActiveRecord (attribute, create, update, validation) Hojung 2015.05.24 1631
30 Ruby Style Guide Hojung 2015.02.05 2011
29 Refresh content automatically after some period time on Rails Hojung 2015.01.22 2563
28 Install ruby-filemagic on Mac (brew, libmagic) Hojung 2014.12.03 1807
27 Byte manipulation in Ruby Hojung 2014.12.03 1719
» How to use Github for your project file Hojung 2014.09.24 1388
25 Ruby map, each, collect, inject, reject, select quick reference Hojung 2014.06.10 2068
24 Difference between collect, select, map and each in ruby Hojung 2014.06.10 1556
23 remove nil from array (compact, compact!) Hojung 2014.06.10 1860
22 remove child association model when parent removed (rails-dependent-destroy) Hojung 2014.06.03 1943
21 deploying cron jobs with whenever gem Hojung 2014.06.01 1974
20 Get list of a class' instance methods Hojung 2014.06.01 1650
19 Optional method parameters in Ruby Hojung 2014.05.29 1757
18 Best Ruby On Rails Content Management Systems (CMS) Hojung 2014.04.26 2943
17 The simple way to print exceptions in Ruby Hojung 2014.04.07 1766
16 Ruby Symbols Hojung 2014.04.05 6546
15 What is the difference between a Symbol and String? Hojung 2014.04.05 1735
14 install Rbenv, ruby and rails Hojung 2014.03.22 1953
13 HTTP Posts in Ruby Hojung 2014.03.14 1954
12 optparse: mandatory and optional arguments example Hojung 2014.03.14 2656
Board Pagination ‹ Prev 1 2 Next ›
/ 2

Designed by sketchbooks.co.kr / sketchbook5 board skin

나눔글꼴 설치 안내


이 PC에는 나눔글꼴이 설치되어 있지 않습니다.

이 사이트를 나눔글꼴로 보기 위해서는
나눔글꼴을 설치해야 합니다.

설치 취소

Sketchbook5, 스케치북5

Sketchbook5, 스케치북5

Sketchbook5, 스케치북5

Sketchbook5, 스케치북5