참고: youtu.be/DedY9dKv3tk

 

1. 기본으로 null을 쓰지 말자

2. null 문맥을 제한한 범위 안에 가두자

3. API에 null을 최대한 쓰지 말자

4. Null 객체를 활용하자

5. null을 명시적으로 표현하자

6. 계약에 의한 설계(design by contract)를 적용하자

7. 구조체에는 펑터(Functor)을 활용하자

8. 객체의 기본값을 유용하게 만들자

'Tip' 카테고리의 다른 글

Git Branch 복원 절차  (0) 2018.10.05
IntelliJ 단축키  (0) 2018.03.05

출처: https://stackoverflow.com/questions/4674226/does-github-keep-deleted-remote-branches-in-history-if-so-can-those-be-restore  





* 로컬 Git log를 이용하여 복원 작업이 이루어지기 때문에, 가장 최근에 해당 브랜치를 이용했던 사람이 branch 복원 작업을 진행해야 최신 상태로 복원 가능.


1. 해당 프로젝트의 로컬 directory 경로로 이동


2. 마우스 오른쪽 클릭 후, 'Git Bash Here' 클릭


4. Command창에 아래 순서대로 명령어 입력

   4-1. 아래 명령어를 입력하여 Git log 기록을 조회하고 해당 branch의 commit id 확인

         $ git reflog

   4-2. 아래 명령어를 입력하여 해당 commit id 상태인 로컬 branch 체크아웃

         $ git checkout -b [로컬 branch 이름] [commit id]


3. IntelliJ의 상단 메뉴에서 'VCS' 클릭 > 'Git' 클릭 > 'Fetch' 클릭

   : 해당 로컬 branch 이름으로 체크아웃되었는지 확인


4. IntelliJ의 상단 메뉴에서 'VCS' 클릭 > 'Git' 클릭 > 'Push' 클릭

   : 해당 로컬 branch를 push하여 원격 branch로서 생성

     (참고로, push 시에는 로컬 branch 이름과 다르게 원격 브랜치 이름을 설정할 수 있다.)


'Tip' 카테고리의 다른 글

null 안전한 좋은 코딩 법  (0) 2020.10.11
IntelliJ 단축키  (0) 2018.03.05

IntelliJ 단축키


- 출처: http://azeke.tistory.com/entry/intellij-단축키
 

<Editing>

Ctrl + Space Basic code completion (the name of any class,method or variable)

Ctrl + Shift + Space Smart code completion (filters the list of methodsand variables by expected type)

Ctrl + Shift + Enter Complete statement

Ctrl + P  함수호출시 인수 정보 확인 (within method call arguments)

Ctrl + Q  코드에 대한 문서창 팝업

Shift + F1 코드에 대한 문서 인터넷 브라우저로 팝업 

Ctrl + mouse  코드를 링크처럼 타고 들어감

Ctrl + F1 Show descriptions of error or warning at caret

Alt + Insert  코드 생성 (Getters, Setters, Constructors,hashCode/equals, toString)

Ctrl + O  메서드 오버라이드 구현

Ctrl + I    인터페이스 메서드 구현

Ctrl + Alt + T  다음으로 코드 감싸기… (if..else, try..catch, for,synchronized, etc.)

Ctrl + / 줄 단위 주석 토글

Ctrl + Shift + /  블럭 단위 주석 토글

Ctrl + W 가장 안쪽의 괄호부터 선택(점점 확장 된다.)

Ctrl + Shift + W Decrease current selection to previous state

Alt + Q Context info

Alt + Enter Show intention actions and quick-fixes

Ctrl + Alt + L  파일 단위 재정렬 (이클립스의 ctrl + shift + f) 

Ctrl + Alt + O import 문 최적화

Ctrl + Alt + I  줄단위 재정렬

Tab / Shift + Tab  들여쓰기/내어쓰기

Ctrl + X or Shift + Delete 잘라내기 (블럭 선택이 안되어 있으면 라인을 잘라냄)

Ctrl + C or Ctrl + Insert 복사하기(블럭 선택이 안되어 있으면 라인을 복사함)

Ctrl + V or Shift + Insert 붙여넣기

Ctrl + Shift + V 복사하기 (목록에서 선택하여)

Ctrl + D 선택된 블럭을 복제

Ctrl + Y 캐럿을 있는 곳의 라인 삭제

Ctrl + Shift + J 스마트하게 코드를 한 줄로 합친다.

Ctrl + Enter 스마트하게 코드를 여러줄로 나눈다.

Shift + Enter 커서가 어디에 있건 다음 라인을 생성하고 첫줄로 이도 

Ctrl + Shift + U 커서가 있는 곳이나 블럭이 있는 곳을 대문자 및 소문자로 치화

Ctrl + Shift + ] / [  가장 가까운 괄호 시작/종료로 이동

Ctrl + Delete 단어 삭제 (커서 시작부터)

Ctrl + Backspace Delete to word start

Ctrl + NumPad+/- Expand/collapse code block

Ctrl + Shift + NumPad+ Expand all

Ctrl + Shift + NumPad- Collapse all

Ctrl + F4 Close active editor tab



<Double Shift Search everywhere>

Ctrl + F Find

F3 Find next

Shift + F3 Find previous

Ctrl + R Replace

Ctrl + Shift + F Find in path

Ctrl + Shift + R Replace in path

Ctrl + Shift + S Search structurally (Ultimate Edition only)

Ctrl + Shift + M Replace structurally (Ultimate Edition only)

 


<Usage Search>

Alt + F7 / Ctrl + F7 Find usages / Find usages in file

Ctrl + Shift + F7 Highlight usages in file

Ctrl + Alt + F7 Show usages


 

<Compile and Run>

Ctrl + F9 Make project (compile modifed and dependent)

Ctrl + Shift + F9 Compile selected file, package or module

Alt + Shift + F10 Select configuration and run

Alt + Shift + F9 Select configuration and debug

Shift + F10 Run

Shift + F9 Debug

Ctrl + Shift + F10 Run context configuration from editor


 


<Debugging>

F8 Step over

F7 Step into

Shift + F7 Smart step into

Shift + F8 Step out

Alt + F9 Run to cursor

Alt + F8 Evaluate expression

F9 Resume program

Ctrl + F8 Toggle breakpoint

Ctrl + Shift + F8 View breakpoints




<Navigation>

Ctrl + N Go to class

Ctrl + Shift + N Go to file

Ctrl + Alt + Shift + N Go to symbol

Alt + Right/Left Go to next/previous editor tab

F12 Go back to previous tool window

Esc Go to editor (from tool window)

Shift + Esc Hide active or last active window

Ctrl + Shift + F4 Close active run/messages/find/... tab

Ctrl + G Go to line

Ctrl + E Recent files popup

Ctrl + Alt + Left/Right Navigate back/forward

Ctrl + Shift + Backspace Navigate to last edit location

Alt + F1 Select current file or symbol in any view

Ctrl + B or Ctrl + Click Go to declaration

Ctrl + Alt + B Go to implementation(s)

Ctrl + Shift + I Open quick definition lookup

Ctrl + Shift + B Go to type declaration

Ctrl + U Go to super-method/super-class

Alt + Up/Down Go to previous/next method

Ctrl + ] / [ Move to code block end/start

Ctrl + F12 File structure popup

Ctrl + H Type hierarchy

Ctrl + Shift + H Method hierarchy

Ctrl + Alt + H Call hierarchy

F2 / Shift + F2 Next/previous highlighted error

F4 / Ctrl + Enter Edit source / View source

Alt + Home Show navigation bar

F11 Toggle bookmark

Ctrl + F11 Toggle bookmark with mnemonic

Ctrl + #[0-9] Go to numbered bookmark

Shift + F11 Show bookmarks



<Refactoring>

F5 Copy

F6 Move

Alt + Delete Safe Delete

Shift + F6 Rename

Ctrl + F6 Change Signature

Ctrl + Alt + N Inline

Ctrl + Alt + M Extract Method

Ctrl + Alt + V Extract Variable

Ctrl + Alt + F Extract Field

Ctrl + Alt + C Extract Constant

Ctrl + Alt + P Extract Parameter

 


<VCS/Local History>

Ctrl + K Commit project to VCS

Ctrl + T Update project from VCS

Alt + Shift + C View recent changes

Alt + BackQuote (`) ‘VCS’ quick popup



<Live Templates>

Ctrl + Alt + J Surround with Live Template

Ctrl + J Insert Live Template

iter Iteration according to Java SDK 1.5 style

inst Check object type with instanceof and downcast it

itco Iterate elements of java.util.Collection

itit Iterate elements of java.util.Iterator

itli Iterate elements of java.util.List

psf public static final

thr throw new



<General>

Alt + #[0-9] Open corresponding tool window

Ctrl + S Save all

Ctrl + Alt + Y Synchronize

Ctrl + Shift + F12 Toggle maximizing editor

Alt + Shift + F Add to Favorites

Alt + Shift + I Inspect current file with curre​nt profile

Ctrl + BackQuote (`) Quick switch current scheme

Ctrl + Alt + S Open Settings dialog

Ctrl + Alt + Shift + S Open Project Structure dialog

Ctrl + Shift + A Find Action

Ctrl + Tab Switch between tabs and tool window





'Tip' 카테고리의 다른 글

null 안전한 좋은 코딩 법  (0) 2020.10.11
Git Branch 복원 절차  (0) 2018.10.05

+ Recent posts