git 명령어 정리

Programming 2017. 11. 30. 14:05


* 로컬 branch 삭제

$git branch -d feature/branchName


* 원격 브랜치 삭제

$git push origin --delete feature/branchName


* 동시 삭제  (문법으로 제공하지 않아서 bash에서 꼼수로ㅋ)

$ git branch --list "feature*" | xargs git branch -d

      옆으로 죽 쓰면되긴된다.

$ git branch -d A B C D


* 수정해버려서.. 브랜치를 새로 생성하고 싶을때

분기할 branch로 이동 후

$git checkout development

생성

$git checkout -b feature/branchName



설정

트랙백

댓글

Git diff ^M

Programming 2017. 11. 8. 19:54

windows 10 에서 intellij로 commit후 push 했는데

bash에서 git status로 확인해보면 잔뜩 commit되지 않았다고 목록이 출력된다.

git diff로 바뀐게 뭔가 확인해보면 line break문자열인지 ^M들이 잔뜩 들어가있다.


git의 옵션 중에 자동으로 Linux용 개행문자로 변환하는 옵션이 있다고한다.

$ git config --global core.autocrlf input



설정

트랙백

댓글

Windows 10 Bash 쉘에서 git http접속시 암호재입력 하지않게 하기

Programming 2017. 11. 8. 11:20

ssh로 접속 시 ssh agent가 계속 꺼져서 불편해서 다시 http접속으로 변경 후 credential manager를 이용하는 방법을 찾기 시작

windows 에 내장된 자격증명 관리자를 쓰면되는데.. bash쉘에서는 접근이 안되는듯 하다(내가 못하는 걸지도)


- 기존 credential이 있으면 확인 삭제

$ git config --global --list 

$ git config --global --unset credential.helper wincred


- 자바설치(Jre or JDK)

$ sudo apt-get install default-jdk

(https://www.digitalocean.com/community/tutorials/how-to-install-java-on-ubuntu-with-apt-get)


- Linux용 Git Credential Manager 설치

 ( https://github.com/Microsoft/Git-Credential-Manager-for-Mac-and-Linux )

java -jar /home/example/git-credential-manager/git-credential-manager-2.0.3.jar install


- 설치가 잘되었는지 확인

$ git config --global --get credential.helper git-credential-manager


- git pull을 두번 해보고.. 두번째부터 묻지않으면 성공!






'Programming' 카테고리의 다른 글

git 명령어 정리  (0) 2017.11.30
Git diff ^M  (0) 2017.11.08
apt-get 명령어정리  (0) 2017.11.06
mysql dateformat  (0) 2017.07.11
window 에서 괄호가 포함된 파일명 검색  (0) 2015.07.22

설정

트랙백

댓글

apt-get 명령어정리

Programming 2017. 11. 6. 15:16


특정 패키지만 upgrade 

$ apt-get install --only-upgrade git-all


설치된 목록확인

$ apt --installed list


'Programming' 카테고리의 다른 글

git 명령어 정리  (0) 2017.11.30
Git diff ^M  (0) 2017.11.08
Windows 10 Bash 쉘에서 git http접속시 암호재입력 하지않게 하기  (0) 2017.11.08
mysql dateformat  (0) 2017.07.11
window 에서 괄호가 포함된 파일명 검색  (0) 2015.07.22

설정

트랙백

댓글

select insert, multiple select query inert

Programming/oracle 2017. 9. 20. 10:53
insert into table(id, name, `time`) 
select id,'max_val', `time` from table_b where id= 1234 order by avg_value desc limit 1

괄호 해도되고 안해도 되고

insert into table(id, name, `time`) 
(select id,'max_val', `time` from table_b where id= 1234 order by avg_value desc limit 1)


이게 아니고 다중 select문을 insert 하고 싶다.

insert into table(id, name, `time`) 
(select id,'max_val', `time` from table_b where id= 1234 order by avg_value desc limit 1)
union all
(select id,'min_val', `time` from table_b where id= 1234 order by avg_value asc limit 1)

union : 중복제거 느림
union all : 중복제거안함 빠름

생각해보면 간단하구나..


'Programming > oracle' 카테고리의 다른 글

오라클(ORACLE) 그룹별 채번  (0) 2014.03.25

설정

트랙백

댓글

mysql dateformat

Programming 2017. 7. 11. 10:56
Format Description
%Y 4자리연도(1999, 2000)
%y 2자리연도(99, 00)
%c 월 (0 to 12)
%m 월 (00 to 12)
%M 월 (January to December)
%b 월 (Jan to Dec)
%d 일 (01 to 31)
%e 일 (0 to 31)

%a Abbreviated weekday name (Sun to Sat)
%D Day of the month as a numeric value, followed by suffix (1st, 2nd, 3rd, ...)
%f Microseconds (000000 to 999999)
%H Hour (00 to 23)
%h Hour (00 to 12)
%I Hour (00 to 12)
%i Minutes (00 to 59)
%j Day of the year (001 to 366)
%k Hour (00 to 23)
%l Hour (1 to 12)
%p AM or PM
%r Time in 12 hour AM or PM format (hh:mm:ss AM/PM)
%S Seconds (00 to 59)
%s Seconds (00 to 59)
%T Time in 24 hour format (hh:mm:ss)
%U Week where Sunday is the first day of the week (00 to 53)
%u Week where Monday is the first day of the week (00 to 53)
%V Week where Sunday is the first day of the week (01 to 53). Used with %X
%v Week where Monday is the first day of the week (01 to 53). Used with %X
%W Weekday name in full (Sunday to Saturday)
%w Day of the week where Sunday=0 and Saturday=6
%X Year for the week where Sunday is the first day of the week. Used with %V
%x Year for the week where Monday is the first day of the week. Used with %V


설정

트랙백

댓글

View의 isLaidOut 메서드

Programming/Android 2016. 1. 27. 14:33

Returns true if this view has been through at least one layout since it
     was last attached to or detached from a window.

view가 window에서 마지막으로 부착되거나 떼어진 이후에
적어도 한번의 layout을 겪었으면 true를 리턴??

 해당 View가 화면에 Layout을 호출당했냐?

//api 19(kitkat) 이후
ViewCompat.isLaidOut(View view)

//api 19(kitkat) 이전
ViewCompat.isLaidOut(View view)


설정

트랙백

댓글

View의 setWillNotDraw()

Programming/Android 2016. 1. 27. 11:04

View 자체 어떠한 그리기를 하지 않는 경우, 최적화 할 수 있도록 이 플래그를 설정합니다.

기본적으로이 플래그는 View 설정되지 않은 있지만, 뷰 그룹과 같은 일부 View 서브 클래스 설정 될 수 있습니다.


화면 갱신할때, 더이상 갱신이 필요없는 View일 경우(ex ViewGroup) true를 주면 그리지 않는다. 원하는 view가 onDraw가 호출되지않을때 파라메터를 false로 주고 호출해보자.

설정

트랙백

댓글

window 에서 괄호가 포함된 파일명 검색

Programming 2015. 7. 22. 11:39

download폴더에 같은파일명으로 생성하면 생기는 (1), (2)녀석을 검색해서 삭제할때 유용!


~"*(?)*"

'Programming' 카테고리의 다른 글

git 명령어 정리  (0) 2017.11.30
Git diff ^M  (0) 2017.11.08
Windows 10 Bash 쉘에서 git http접속시 암호재입력 하지않게 하기  (0) 2017.11.08
apt-get 명령어정리  (0) 2017.11.06
mysql dateformat  (0) 2017.07.11

설정

트랙백

댓글

[이클립스] Rename시 getter, setter도 자동으로 바꾸기

Programming/java 2015. 1. 14. 14:38

분류는 분명 java인데... 언어관련 관련 글이아니라.. 개발툴관련글로 도배되어간다... 씁슬

eclipse가 아닌 android studio를 쓰면서 변수명 rename할때 getter, setter까지 바꿔주길래 우왕 IntelliJ 짜..짱짱맨! 고유기능인줄 알았는데... 이클립스도 원래 있었다... 하아..OTL 

1. rename할 변수에다가 커서대고 Alt+Shift+R 누른다.
2. 한번더 Alt+Shift+R을 누르면 dialog가 뜨는데



3. 체크해줌끝.. 다음부턴 Alt+Shift+R 한번만 누르고 바꿔도 적용된다.




설정

트랙백

댓글