"Git config"의 두 판 사이의 차이

4번째 줄: 4번째 줄:
==실습==
==실습==
<source lang='cli'>
<source lang='cli'>
root@zetawiki:~# mkdir -p workspace/hello
root@zetawiki:~# git config -l
root@zetawiki:~# cd workspace/hello/
root@zetawiki:~# git config --global user.name 'gituser1'
root@zetawiki:~/workspace/hello# git init
root@zetawiki:~# git config --global user.email gituser1@zetawiki.com
Initialized empty Git repository in /root/workspace/hello/.git/
root@zetawiki:~# git config -l
user.name=gituser1
user.email=gituser1@zetawiki.com
</source>
</source>
<source lang='cli'>
<source lang='cli'>
root@zetawiki:~/workspace/hello# echo 'hello world' > greet.txt
root@zetawiki:~# cat ~/.gitconfig  
root@zetawiki:~/workspace/hello# git add greet.txt
root@zetawiki:~/workspace/hello# git commit -m 'hello world!'
[master (root-commit) f4af7c0] hello world!
Committer: root <root@zetawiki.example.com>
Your name and email address were configured automatically based
on your username and hostname. Please check that they are accurate.
You can suppress this message by setting them explicitly:
 
    git config --global user.name "Your Name"
    git config --global user.email you@example.com
 
After doing this, you may fix the identity used for this commit with:
 
    git commit --amend --reset-author
 
1 file changed, 1 insertion(+)
create mode 100644 greet.txt
</source>
:→ git 사용자의 이름과 이메일이 설정되지 않음
<source lang='cli'>
root@zetawiki:~/workspace/hello# git config --global user.name "gituser1"
root@zetawiki:~/workspace/hello# git config --global user.email gituser1@zetawiki.com
root@zetawiki:~/workspace/hello# cat ~/.gitconfig
[user]
[user]
name = gituser1
name = gituser1
email = gituser1@zetawiki.com
email = gituser1@zetawiki.com
</source>
<source lang='cli'>
root@zetawiki:~/workspace/hello# echo 'good morning' >> greet.txt
root@zetawiki:~/workspace/hello# git add greet.txt
root@zetawiki:~/workspace/hello# git commit -m 'good morning!'
[master 7eca13f] good morning!
1 file changed, 1 insertion(+)
</source>
</source>



2016년 3월 1일 (화) 23:29 판

1 개요

git config

2 실습

root@zetawiki:~# git config -l
root@zetawiki:~# git config --global user.name 'gituser1'
root@zetawiki:~# git config --global user.email gituser1@zetawiki.com
root@zetawiki:~# git config -l
user.name=gituser1
user.email=gituser1@zetawiki.com
root@zetawiki:~# cat ~/.gitconfig 
[user]
	name = gituser1
	email = gituser1@zetawiki.com

3 같이 보기

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}