반응형

[text]    : 선택사항 값

<text>  : 반드시 입력해야하는 값 


1. Branch 관련 명령어

git checkout -b <브랜치이름>    - 현재 시점에서 새로운 브랜치를 생성하면서, Checkout하는 명령어

git push origin <브랜치이름>    - 로컬 브랜치를 원격 브렌치에 업데이트 , 또는 원격 브랜치 생성

git checkout <브랜치이름>    - <브랜치이름>해당 브랜치로 Checkout

git branch 

git branch --list    - 현재 로컬 브랜치 목록을 보여줌

git branch -r 

git branch -r --list    - 원격 브랜치 리스트를 보여줌

git branch -d <브랜치이름>    - 로컬 브랜치를 삭제함

git push origin -d <브랜치이름> - 해당 리모트 브랜치를 삭제함



2. Merge 관련 명령어
git fetch origin [브랜치이름]   - 리모트 브렌치의 히스토리 상태를 업데이트 함
git merge <브랜치이름>    - 해당 브랜치와 현재 브랜치를 병합
git rebase origin/<브랜치이름>    - 해당 브랜치를 리베이스 함


3. Commit 관련 명령어

git stage -A    - 현재 변경사항을 Stage함

git reset    - 현재 Stage에 올라간 파일들을 Unstage함.

git commit -am "커밋메세지"    - 현재 커밋 메시지로 Commit

git status     - 현재 로컬 브랜치 변경사항을 표시

git checkout -- .    -현재 모든 변경사항을 제거함.(함부로 사용하지 말것)



4. merge 충돌 관련 명령어

git mergetool    -현재 충돌난 상태를 외부 병합툴로 실행

git diff     - 변경 전후 상태 비교

git merge --abort   - 현재 병합중 취소

git rebase --continue    - 계속해서 rebase 병합함

git rebase --abort    - 리베이크 병합 취소


5. 소스 추출시 Tracking된 파일만 압축

git archive -o latest.zip HEAD

 

Tag 달기


 git tag <tagName> [Hash code]    : 태그 생성.

 git push origin master <tagName> : 특정 태그만 원격저장소에 올리기

 git push --tags  : 모든 태그를 원격저장소에 올리기

 

 Tag 삭제.

 git tag -d <tagName>     : 특정 태그 삭제

 git  push origin :refs/tags/<tagName> : 원격저장소에 태그 삭제.

 

 

 Git File목록 검색 

 

 git ls-files | grep -i <pattern>


파일을 수정한 부분중 특정 부분만 찾아서 되돌리고 싶을때


git difftool -y #ref -- /path/aa.cpp

머지 툴을 이용해서 해당 부분을 찾아서 되돌릴 수 있다.


6. MergeTool 이나 DiffTool을 사용할 때 등록되어 있는 Tool을 선택해서 사용할 수 있다.


git mergetool -t <toolname> OR git mergetool -tool=<toolname>

git difftool -t <toolname> OR git difftool -tool=<toolname>


ex)git difftool -t p4merge, git mergetool -t tortoisemerge ...등등


* toolname : .gitconfig 파일에 등록되어 있는 Tool이름을 의미 한다.



반응형

Git 을 편하게 쓰는 UI 프로그램 중에 Commit 하거나 Pull 로 병합이나 Rebase 시에 out of memory가 발생할 때가 있다.

 

이때 .gitconfig 파일에 아래 값을 추가로 넣어 주어서 해결을 했다.

 

아마 git에서 해당 부분에 메모리 Default 값이 낮아서 저런식으로 설정을 해주는 것일 꺼라 추측 해본다.

 

[core]

 packedGitLimit = 128m
 packedGitWindowSize = 128m


[pack]
  deltaCacheSize = 128m
  packSizeLimit = 128m
  windowMemory = 128m

반응형

1. GridView에 Editing Mode로 진입 할때 클릭수와 관련된 옵션.

 - GridView.OptionsBehavior.EditorShowMode

 - columnEdit에 TextEditStyle을 DisableTextEditor로 함.

 

 

반응형
public delegate object DynamicGetValue<T>(T component);
public delegate void DynamicSetValue<T>(T component, object newValue);

public class DynamicPropertyDescriptor<T> : PropertyDescriptor
    where T: class
{
    public enum AccessMode
    {
        ReadWrite,
        ReadOnly,
    };
    
    protected Type _componentType;
    protected Type _propertyType;
    protected DynamicGetValue<T> _getDelegate;
    protected DynamicSetValue<T> _setDelegate;

    public override string DisplayName
    {
        get
        {
            return base.DisplayName;
        }
    }
    
    public DynamicPropertyDescriptor(string name, Type propertyType,
        DynamicGetValue<T> getDelegate, DynamicSetValue<T> setDelegate, Attribute[] attrs = null)
        :
        base(name, attrs)
    {
        _componentType = typeof(T);
        _propertyType = propertyType;
        _getDelegate = getDelegate;
        _setDelegate = setDelegate;
    }
    public DynamicPropertyDescriptor(string name, Type propertyType, AccessMode accessMode = AccessMode.ReadWrite,  Attribute[] attrs = null)
        : base(name, attrs)
    {
        _componentType = typeof(T);
        _propertyType = propertyType;

        _getDelegate += component => _componentType.GetProperty(name).GetValue(component, null);
        if(accessMode==AccessMode.ReadWrite)
            _setDelegate += (component, value) => _componentType.GetProperty(name).SetValue(component, value, null);
    }

    public override bool CanResetValue(object component)
    {
        return false;
    }
        public override Type ComponentType
    {
        get { return _componentType; }
    }

    public override object GetValue(object component)
    {
        return _getDelegate(component as T);
    }

    public override bool IsReadOnly
    {
        get { return _setDelegate == null; }
    }

    public override Type PropertyType
    {
        get { return _propertyType; }
    }

    public override void ResetValue(object component)
    {
        
    }

    public override void SetValue(object component, object value)
    {
        _setDelegate(component as T, value);
    }

    public override bool ShouldSerializeValue(object component)
    {
        return true;
    }
}
    
//위에 클래스가 Dynamic하게 동적으로 PropetyGrid에 Binding하기위한 클래스 이다.
//실제 PropertyGrid에 어떤 이벤트에서 처리를 하냐면

PropertyGrid.CustomPropertyDescriptors += PropertyGrid_CustomPropertyDescriptors;

//이벤트 등록을 완료한 후


 private void _propertyGrid_CustomPropertyDescriptors(object sender, DevExpress.XtraVerticalGrid.Events.CustomPropertyDescriptorsEventArgs e)
 {
     if (e.Source != null)
     {
         e.Properties = new PropertyDescriptorCollection(_propertyDescriptors.ToArray());
     }
 }



//이제 거의 끝났다.. 그렇다면 _propertyDescriptors 는 어떻게 생성할까?
//내경우는 실제 바인딩 객체(=> PropertyGrid.Selectobject 에 Dictionary를 넣었기 때문에 아래와 같이 코딩이 되었다.)

List<DynamicPropertyDescriptor> _propertyDescriptors = new List<DynamicPropertyDescriptor>();

var dynamicPropertyDes = new DynamicPropertyDescriptor<MyType>(
    displayName //속성창에 이름
    , typeof(string) //값의 타입
    , dic => dic.ContainsKey(value.ToString()) ? dic[value.ToString()] : string.Empty // 실제 바인딩된 객체의 Getter
    , (dic, input) =>{dic[value.ToString()] = input.ToString().Trim();}                     //실제 바인딩된 객체의 Setter
    , new []{new CategoryAttribute("Category"), }                                           //Category셋팅
    );

_propertyDescriptors.Add(dynamicPropertyDes);


//이렇게 코딩을 하면 원하는 값과 형태로 PropertyGrid에 동적으로 할당할 수 있을 것이다.

+ Recent posts