我想在GitHub上维护一个Dart服务器端项目。用2个酒吧包“git”& amp; “github上”。还考虑使用Process.Run作为典型的批处理命令:
cd project_directory
git init
git add .
git commit -m "your_commit_message"
git remote add origin https://github.com/[your_user_name]/[repo_name]
git push origin master
Dart是否有标准实施? Devs是否使用Process.Run自行推出? 找到一个简单的直接记录的HeloWorld类型示例推送到GitHub会很棒。 任何想法或例子都非常感谢!
答案 0 :(得分:1)
Chrome Dev Editor团队在Dart编写了一个本机Git客户端(我认为它是in here)。它不完整,我不知道你可以轻松地使用它(它不是一个酒吧套餐;而且我不知道它是否曾经存在);但是如果我试图与Git互动,它肯定是我开始的地方。它是CDE中非常重要的一部分,因此Google肯定会开发它,直到它能够很好地用于一般用途!
答案 1 :(得分:1)
决定去旧学校"目前使用Windows命令文件。在这里发帖,其他人感兴趣:
:: --------------------------------------------
:: PUBLISH TO GITHUB
:: dxConsole:Dart Console Library for Windows(32/64bit Native Extension)
:: --------------------------------------------
mode con:cols=100 lines=200
setlocal
:: --------------------------------------------
:: Initialize environment variables
:: --------------------------------------------
set ERRORMSG=
:: <<< Set Paths >>>
set PATH-GITLOCALREPRO=%TMP%\dxConsole
set PATH-GITHUBDXCONSOLE=[https://github.com/osstekz/dxConsole][1]
set PATH-DXCONSOLEPROJECTPATH=C:\Users\OSSDevYorgi\DartProjects\libraries\native-ext\dxConsole\
:: <<< remove the temp directory >>>
rmdir /s /q %PATH-GITLOCALREPRO%\
:: <<< make temp GitRepro sub folders >>>
mkdir %PATH-GITLOCALREPRO%\
if %ERRORLEVEL% NEQ 0 goto ERRORHANDLER
:: --------------------------------------------
:: <<< Init/clone local repository >>>
:: --------------------------------------------
::go into folder..
cd %PATH-GITLOCALREPRO%
::if folder is empty, then clone repro
git clone %PATH-GITHUBDXCONSOLE% .
::else
::git init
::git remote add origin %PATH-GITHUBDXCONSOLE%
::git config user.name "<your user name>"
::git fetch
::git checkout -t origin/master
if %ERRORLEVEL% NEQ 0 goto ERRORHANDLER
:: --------------------------------------------
:: <<< Copy local project files to local git repository >>>
:: --------------------------------------------
:: <<< Set Dart project path >>>
cd %PATH-DXCONSOLEPROJECTPATH%
:: <<< Copy example folder >>>
rmdir /s /q %PATH-GITLOCALREPRO%\example\
xcopy /Y example\dxConsoledemo_*.* %PATH-GITLOCALREPRO%\example\
if %ERRORLEVEL% NEQ 0 goto ERRORHANDLER
:: <<< Copy lib folder >>>
rmdir /s /q %PATH-GITLOCALREPRO%\lib\
xcopy /Y /e lib\*.* %PATH-GITLOCALREPRO%\lib\
if %ERRORLEVEL% NEQ 0 goto ERRORHANDLER
:: <<< Copy bin folder >>>
rmdir /s /q %PATH-GITLOCALREPRO%\bin\
xcopy /Y git\bin\dxConsole_win*.dll %PATH-GITLOCALREPRO%\bin\
if %ERRORLEVEL% NEQ 0 goto ERRORHANDLER
:: <<< Copy root items >>>
copy git\gitattributes.txt %PATH-GITLOCALREPRO%\.gitattributes
if %ERRORLEVEL% NEQ 0 goto ERRORHANDLER
copy git\gitignore.txt %PATH-GITLOCALREPRO%\.gitignore
if %ERRORLEVEL% NEQ 0 goto ERRORHANDLER
copy git\license.txt* %PATH-GITLOCALREPRO%\LICENSE
if %ERRORLEVEL% NEQ 0 goto ERRORHANDLER
copy git\README.md %PATH-GITLOCALREPRO%\README.md
if %ERRORLEVEL% NEQ 0 goto ERRORHANDLER
copy pubspec.yaml %PATH-GITLOCALREPRO%\
if %ERRORLEVEL% NEQ 0 goto ERRORHANDLER
:: <<< Update Github >>>
cd %PATH-GITLOCALREPRO%
git add .
git commit -m "v0.8.0"
::git commit -a
git push origin master
@echo.
@echo -----------------------------------------
@echo SUCCESS:GOOD JOB
@echo -----------------------------------------
@echo.
goto :exit
:: --------------------------------------------
:: SUBROUTINE:ERRORHANDLER
:: --------------------------------------------
:ERRORHANDLER
@echo.
@echo -----------------------------------------
@echo ERROR:%ERRORMSG%
@echo -----------------------------------------
@echo.
pause
:: --------------------------------------------
:: END OF JOB
:: --------------------------------------------
:exit
::%temp%\dxConsole.log
::set
:exit1
::pause
答案 2 :(得分:0)
要跟进Danny的回复,请参阅&#34; Git工作流程&#34;在CDE项目的GettingStarted.md中。
CDE位于Chrome商店中。将git项目克隆到CDE后,可以右键单击文件以提交更改,以及其他git函数。