[42Seoul] 윈도우10 wsl2에서 42 과제 편하게 하기

seomoon·2021년 1월 8일
4

42Seoul

목록 보기
4/9

1. norminette 설치하기

  • Ruby & norminette 설치하기
sudo apt-get install ruby ruby-bundler ruby-dev build-essential
git clone https://github.com/hivehelsinki/norminette-client.git ~/.norminette/
cd ~/.norminette/
bundle

  • alias 생성하기
echo 'alias norminette="~/.norminette/norminette.rb"' >> ~/.zshrc
source ~/.zshrc

  • 다음과 같은 WARNING이 뜰 경우 :
Warning: the running version of Bundler (2.1.2) is 
older than the version that created the lockfile (2.1.4). 
We suggest you to upgrade to the version 
that created the lockfile by running 
'gem install bundler:2.1.4'.

=> 해결 :

sudo gem install bundler:2.1.4



2. 42header 자동 생성하기

1) vim-plug 설치

 curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
 https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim

2) vim 설정 파일에 42header 플러그인 추가

  • vim 설정 파일 열기 :
vim ~/.vimrc
  • 42header 플러그인 추가하기 :
 call plug#begin('~/.vim/plugged')
     Plug 'pbondoer/vim-42header'
 call plug#end()
 
 let g:hdr42user = '인트라아이디'
 let g:hdr42mail = '인트라아이디@student.42seoul.kr'
  • 플러그인 설치하기
    다시 vim을 열고 아래 명령어를 입력하면 플러그인이 설치된다.
:PlugInstall

3. git 설정하기

  • 로컬에서는 42의 과제 제출용 깃 레포지토리에 접근할 수 없다.
  • 열심히 작성한 코드를 날리지 않으려면
    개인 깃허브에 private repository를 만들어놓고 코드를 백업해가면서 작업하는 게 좋다.

1) Git 터미널에서 push할 때 패스워드 입력 과정 생략하기

  • private 저장소에 코드를 올리다보면
    push를 할 때마다 패스워드를 입력해야해서 번거롭다.

  • 다음 명령어를 입력해서 패스워드를 묻지 않도록 설정할 수 있다.

git config --global credential.helper store
  • 이렇게 설정하고 나서 git push를 하고, 마지막으로 한 번 더 패스워드를 입력하면 그 다음부터는 패스워드를 더 이상 물어보지 않는다.

2) git add, commit, push 한 번에 하기

  • alias 설정으로 add, commit, push를 한 번에 할 수 있다.
git config --global alias.cmp '!f() { git add -A && git commit -m "$@" && git push; }; f'
  • 설정 후에 다음과 같이 입력하면 add & commit & push가 한 번에 된다.
git cmp "커밋 메세지"

  • .gitconfig 파일 내용을 확인해보면(vi ~/.gitconfig) credential과 alias 설정이 되어있는 걸 확인할 수 있다.
[user]
        name = `git_username`
        email = `git_email`
[credential]
        helper = store
[alias]
        cmp = "!f() { git add -A && git commit -m \"$@\" && git push; }; f"

profile
💛💛 🖥🏐🛋🥗💵📖 💛💛

1개의 댓글

comment-user-thumbnail
2021년 2월 19일

서로 화이팅해요!!

답글 달기