- gitHub의 용량 제한은 100M. 초과시 에러가 발생하며 Push가 되지 않음.

 

  • 해결방법

   1. bfg 다운로드
      링크 : https://rtyley.github.io/bfg-repo-cleaner/

 

BFG Repo-Cleaner by rtyley

$ bfg --strip-blobs-bigger-than 100M --replace-text banned.txt repo.git an alternative to git-filter-branch The BFG is a simpler, faster alternative to git-filter-branch for cleansing bad data out of your Git repository history: Removing Crazy Big Files Re

rtyley.github.io

2. 레파지토리 폴더에 bfg 파일 복사

3. git Bash 실행

4. [ java -jar bfg-1.14.0.jar --strip-blobs-bigger-than 100M ] 명령어 입력

4-1. 실패시 출력문구

4-2. [ git repack && git gc ] 명령어 입력

4-3. 위와같은 메세지가 출력되엇다면 다시 [ java -jar bfg-1.14.0.jar --strip-blobs-bigger-than 100M ] 명령어 입력

 

5. 위와 같은 메세지가 출력되엇다면. 다시 Push 하기!

'Git' 카테고리의 다른 글

[Sourcetree] 여러 계정 이용시 인증 에러 해결 방법  (0) 2024.04.24
Posted by 샌츠
,

 TryParse 메서드

입력한 문자열이 숫자로 변환할 수 있는 문자열인지 체크하여 
숫자로 변환이 가능하다면 True, 문자등이 포함되어 있어서 숫자로 변환이 불가능한다면 False를 반환한다.

 

  • 아래는 가단하게 테스트 해볼 수 있는 코드
using System;

namespace StringConversion
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.Write("숫자를 입력해주세요: ");
            if (int.TryParse(Console.ReadLine(), out int intInput))
                Console.WriteLine(intInput);
            else
                Console.WriteLine("{0} : 입력한 값을 다시 확인해주세요.");

            // 프로그램이 종료되지 않도록 추가
            Console.WriteLine("프로그램을 종료하려면 아무 키나 누르세요...");
            Console.ReadLine(); //엔터 키를 누를 때까지 대기.
        }
    }
}

'C#' 카테고리의 다른 글

[C#] 메인폼에서 다른폼 열기  (0) 2024.04.26
[C#] 파일 다운로드기능  (0) 2024.01.05
[C#] 버튼 일괄 숨기기 / 보이기  (0) 2023.11.23
Posted by 샌츠
,

메인폼의 메뉴에서 다른 서브폼을 열었을때, 가장 기본적인 코드로 폼을 열어보면 서브창만 움직일 수 있고

메인폼은 움직일 수가 없다.

using System;
using System.Windows.Forms;

namespace Namespace
{
    public partial class MainForm : Form
    {
        public MainForm()
        {
            InitializeComponent();
        }

        private void menuButton_Click(object sender, EventArgs e)
        {
            //폼을 생성하고 보여줍니다.
            frmSub subForm = new frmSub();
            subForm.ShowDialog(); // 모달 다이얼로그로 표시합니다.
        }
    }

    public partial class frmSub : Form
    {
        public frmSub()
        {
            InitializeComponent();
        }
    }
}

 

아래의 코드는 메뉴의 버튼을 눌렀을때, 서브폼이 팝업되고 메인폼도 제어가 가능한 코드이다.

그리고 sub폼이 열린 상태에서 메뉴의 버튼을 다시 한번 누르면 에러가 발생한다.

이것을 방지하기 위해서는 subForm이 실행되엇는지 체크하면 된다.

using System;
using System.Windows.Forms;

namespace Namespace
{
    public partial class MainForm : Form
    {
        private frmSub subForm; // frmSub 폼의 인스턴스를 보관할 멤버 변수 선언

        public MainForm()
        {
            InitializeComponent();
        }

        private void menuButton_Click(object sender, EventArgs e)
        {
            if (subForm == null || subForm.IsDisposed)
            {
                // frmSub 폼이 없거나 이미 닫혔다면 새로 생성.
                subForm = new frmSub();
                subForm.FormClosed += (s, args) => subForm = null; // 폼이 닫힐 때 참조를 제거.
            }

            if (!subForm.Visible)
            {
                subForm.Show(this); // MainForm의 소유자로 frmSub 폼을 표시.
            }
        }
    }

    public partial class frmSub : Form
    {
        public frmSub()
        {
            InitializeComponent();
        }
    }
}

'C#' 카테고리의 다른 글

[C#] 문자열을 숫자로 변환  (0) 2024.05.23
[C#] 파일 다운로드기능  (0) 2024.01.05
[C#] 버튼 일괄 숨기기 / 보이기  (0) 2023.11.23
Posted by 샌츠
,