프로그램을 자동으로 실행하고 csv 파일을 내 저장소에 커밋하기 위해 다음 배치 스크립트를 만들었습니다. 패스는 내 실제 비밀번호로 채워져 있습니다. 복제 명령이 매번 가장 최근의 깨끗한 버전을 가져 오도록 기존 로컬 저장소를 삭제합니다. 이것을 실행할 때마다 다음을 얻습니다.
! [거부 됨] master-> master (non-fast-forward) 오류 : 일부 참조를 'https://github.com/maxbear123/Knox-County-Covid-19-Risk-Assesment.git'에 푸시하지 못했습니다. 힌트 : 업데이트 현재 분기의 팁이 힌트 뒤에 있기 때문에 거부되었습니다. 다시 푸시하기 전에 원격 변경 사항 (예 : 힌트 : 'git pull ...')을 통합합니다. 힌트 : 자세한 내용은 'git push --help'의 '빨리 감기에 대한 참고 사항'을 참조하십시오.
:: @echo off
call C:\Users\maxbear123\anaconda3\Scripts\activate.bat
call conda activate Scraper
call cd C:\Users\maxbear123\Documents\Python_Scripts
call python COVID-19_School_Risk_Data_Logger.py
call del Knox-County-Covid-19-Risk-Assesment /Q
call git clone https://maxbear123:[email protected]/maxbear123/Knox-County-Covid-19-Risk-Assesment
call git add historical_predictions.csv
call git commit -m"Automated Prediction Update"
call git push https://maxbear123:[email protected]/maxbear123/Knox-County-Covid-19-Risk-Assesment.git
cmd /k
누군가 실제로 이것을하는 방법을 말해 줄 수 있습니까? 나는 온라인에서 많은 것을 검색하고 작동하지 않는 많은 것들을 시도했습니다. 미리 감사드립니다.
나는 문제를 해결했다. 이를 위해 다음 스크립트가 작동합니다.
:: @echo off
call C:\Users\maxbear123\anaconda3\Scripts\activate.bat
call conda activate Scraper
call cd C:\Users\maxbear123\Documents\Python_Scripts\Knox-County-Covid-19-Risk-Assesment
call git init
call git pull https://maxbear123:[email protected]/maxbear123/Knox-County-Covid-19-Risk-Assesment
call python COVID-19_School_Risk_Data_Logger.py
call git add historical_predictions.csv
call git commit -m"Automated Prediction Update"
call git push https://maxbear123:[email protected]/maxbear123/Knox-County-Covid-19-Risk-Assesment.git
본질적으로 나는 git이 어떻게 작동하는지 근본적으로 이해하지 못했습니다.
비슷한 무지를 가진 다른 사람에게는 다음과 같은 과정이 있습니다.기존 저장소에 대한 커밋을 시작하려면 :
기존 저장소에 계속 커밋하려면 :
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다