git coding使用教程(小白也能看懂)
基于上一个教程有人说需要安装印象笔记才能看,因此分享pdf版本Administrator@Sc-201611142331 MINGW32/h/androi workspace/Calculator (master)git addgit: add' is notommand. See git --helpDid you mean this?add没空格administrator@sc-201611142331 MINGw32/h/androi workspace/Calculator (master)s git addwarning: LF will be replaced by CRLF in idea/compiler.xmlThe file will have its original line endings in your working directory.warning: LF will be replaced by CRLF in idea/gradle. xmlThe file will have its original line endings in your working directory.warning: LF will be replaced by CRLF in idea/misc. xmlThe file will have its original line endings in your working directory.warning: LFwill be replaced byThe file will have its originalnF in idea/modules. xmlne endin your working directwarning: LF will be replaced by CRLF in idea/runConfigurations xm7.y.The file will have its original line endings in your working directory.warning: LF will be replaced by CRLF in gradle/wrapper/gradle-wrapper propertiThe file will have its original line endings in your working directory.warning LF will be replaced by CRlF in gradlew.The file will have its original line endings in your working directory添加成功以后,文件为绿色可以查看此时的状态AdministratoraSC-201611142331 MINGw32/h/androidworkspaceCalculator(master)s git statusOn branch masterInitial commitChanges to be committed(use"git rm --cached ."to unstage)f11.ignorenew filidea/compi lnew file: idea/ copyright/profiles_settings. xmlnewidea/gradle. xmnew file:, idea/misc. xmlnew file:. idea/ modules, xmlnew fileidea/runConfigurations xmlnew file: app/. gitignorenew file: app/bui ld gradnew file: app/proguard-rules pronew file: app/src/androidTestjava/main/com/cal cul ator/ExampleInstrumentedTest. javanew file: app/src/main/Androi mAnifest xmlnew file: app/src/main/java/main/com/cal cu l ator /Mai ty. javanew file: app/src/main/res/drawable/black. xmlnew file: app/src/main/res/drawable/brown. xmlnew file: app/src/main/res/drawable/delete. xmlnew file: app/src/main/res/drawable/gray. xmlnew file: app/src/main/res/drawable/ic_deletel. pngnew file: app/src/main/res/drawable/orange.xmnew file: app/src/main/res/drawable/orangetored xmlnew file: app/src/main/res/drawable/red. xmlnew file: app/src/main/res/drawable/white. xmlnew file: app/src/main/res/layout /activity main xmlnew file: app/src/main/res/mipmap-hdpi/ic_launcher. pngnew file: app/src/main/res/mmipmap-mdpi/ic_delete. pngnew file: app/src/main/res/mmipmap-mdpi/ic_launcher.pngapp/src/main/res/'m pmap-xhdpllauncher. pngnew file: app/src/main/res/mi pmap-xxhdplauncher. pngneyapp/src/main/res/mi pmap-xxxhdpi/ic_launcher. pngnew file: app/src/main/res/values-w820dp/dimens. xml/src/main/res/values/colors. xmTnew file: app/src/ main/res/values/dimens. xmlnew file: app/src/main/res/values/strings. xmlnew file: app/src/main/res /values/styles. xmlnew filsrc/test/java/main/com/calculator/ExampleUnitTest javanew file: bui ld gradlenew file: gradle. propertiesnew file: gradle/wrapper/gradle-wrapper jarnew file: gradle /wrapper /gradle-wrapper, propertiesnewe: gradlewnewgradlew, batnew file: settings. gradle5将文件提交到本地仓库git commit -madd first initcommit:提交-m:提交的日志双引号:日志的内容es MINGW32: /h/androidWorkspace/ CalculatorAdministratoresc-201611142331 MINGW32 /h/androidworks pace/Calculator (masters git commit -m"add first initMaster (root-commit) blad373] add first initwarning: LF will be replaced by CRLF in. idea/compiler. xmlThe file will have its original line endings in your working directory.The file will have its original line endings in your working directory.warning: LF will be replaced by CRLF in. idea/misc. xmlThe file will have its original line endings in your working directorwarning: LF will be replaced by CRLF in. idea/ modules.xmThe file will have its original line endings in your working directory.warning: LF will be replaced by CRLF in idea/runConfigurations xmlwarning: LF will be replaced by CRLF in gradle/wrapper/gradle-wraas toryThe file will have its originaThe file will have its original line endings in your working directory.warning: LF will be replaced by CRLF in grad] ew.The file will have its original line endings in your working direc42 files changed, 1259 insertions (create mode 100644. gitignorecreate mode 100644ldea/complIer. xmcreate mode 100644. idea/ copyright/profiles_settings. xmlcreate mode 100644. idea/gradle. xml文件提交完成,缓存区为空create mode 100644. idea/misc. xmlde 100644. idea/modules. xml文件为白色create mode 100644. idea/runConfigurations xmlcreate mode 100644 app/. gitignorecreate mode 100644 app/bui ld gradlecreate mode 100644 app/ proguard-rules procreate mode 100644 app/src/androidTest/java/main/com/calculator/ ExampleInstrumentedTest. javacreate mode 100644 app/src/main/AndroidManifest xm Icreate mode 100644 app/src/mai n/java/main/ com/calcul ator /MainActivity javacreate mode 100644 app/src/main/res/drawable/black. xmlcreate mode 100644 app/src/main/res/drawable/brown. xmlcreate mode 100644 app/src/main/res/drawable/delete. xmlcreate mode 100644 app/src/main/res/drawable/gray. xmlcreate mode 100644 app/src/main/res/drawable/ic_deletel. pngcreate mode 100644 app/src/main/res/drawable/orange. xmlcreate mode 100644 app/src/main/res/drawable/orangetored xmIcreate mode 100644 app/src/main/res/drawable/red. xmcreate mode 100644 app/src/main/res/drawable/white. xmlcreate mode 100644 app/src/main/res/layout/activity_main. mlcreate mode 100644 app/src/main/res/mipmap-hdpi/launcher. pngcreate mode 100644 app/src/main/resdelete. pngcreate mode 100644 app/src/main/res/mipmap-mdpi/ic_launcher. pngcreate mode 100644 app/src/main/res/mipmap-xhdpi/ic_launcher. pngcreate mode 100644 app/src/main/res/mipmap-xxhdplauncher. pngcreate mode 100644 app/src/main/res/mipmap-xxxhdpi/ic_launcher. pngcreate mode 100644 app/src/main/res/values-w820dp/dimens.xmlcreate mode 100644 app/src/main/res/values/colors. xmlcreate mode 100644 app/src/main/res/values/dimens. xmlcreate mode 100644 app/src/main/res/values/strings. xmlcreate mode 100644 app/src/main/res/values/styles. xmlcreate mode 100644 app/src/test/java/main/com/calcul ator/ExampleUnitTest javacreate mode 100644 build gradlecreate mode 100644 gradle propertiescreate mode 100644 gradle/wrapper /gr adle-wrapper, jar6绑定远程仓库的地址gitremoteaddoriginhttps://git.codingnet/wsw/calcuLar.gitorigIn:默认的远程版本库名称,可以修改https://git.codingnetwsw/calculAr.git:远程仓库的地址Administratoresc-201611142331 MINGW32/h/androidworkspaceCalculator (master)sgitremoteaddoriginhttps://git.codingnet/w_5_w/calcular.git7.将本地仓库的文件,提交到远程仓库第一次提交时命令由于远程库是空的,我们第一次准送 mmaster分支时,加上了-u参数,G不但会把本地的 master分支内溶推送的远程新的 master分支,还会把本地的mate分支和远程的 master分克关联起来,在以后的送或者拉职时就可以简化命令。git push -u origin masterAdministratorasc-201611142331 MINGW32/h/androidworkspace/Calculator(master)s git push -u origin masterCounting objects: 75, done.Delta compression using upthreadsCompressing objects: 100%(52/52),done.Writing objects: 100%(75/75),95.85 KiB I o bytes/s,done.Total 75 (delta 6), reused o(delta o)Tohttps://git.codingnet/w_s_w/calcular.git[new branch]master - masterBranch master set up to track remote branch master from origin更新提交命令git push origin masterAdministrator@sc-201611142331 MINGW32 -/Desktop/project (master)s git push origin masterCounting objects: 3, doneWriting objects: 100% (3/3), 252 bytes I 0 bytes/s, done.Total 3 (delta 0), reused o (delta 0)Tohttps://git.codingnet/w_5_w/calculator.git7ae08ce. 6cbef3c mastermaster此时,项目已经上传成功,可以到网站刷新一下8.如果想要将该目录下的文件,上传到其他远程仓库gIt remote remove origin移除当前远程仓库地址,gitremoteaddoriginhttps://git.codingnet/wsw/11.g然后绑定新的地址git push origin master将本地仓库文件上传到了新的远程仓库9将远程仓库的文件下载下来1先创建一个文件夹,进入文件夹内,右键打开 Git Bash HereCs MINGW32: /c/Users/Administrator/Desktop/projectAdministrator@sc-201611142331 MINGW32 -/Desktop/project (master)e 100644 ann/err/main/res/mi nmar2克隆远程仓库的内容itclonehttps://git.codingnetwsw/calcuLar.githttps://git.codingnetwsw/calculAr.git:远程仓库的地址Administrator@sc-201611142331 MINGW32/h/compute(master)itclonehttps://git.codingnet/w_5_w/calcular.gitCloning into 'Calcularemote: Counting objects: 75, doneemote: Compressing objects: 100%(52/52), doneemote: Total 75(delta 6, reused o(delta o)Unpacking objects: 100%(75/75), donehecking connectivity.. done.
用户评论