Flutter学习 git管理项目

2019-11-20  本文已影响0人  隔墙送来秋千影

//git status ---- 查看当前git状态 --发现没有git

twinkleo@TwinkleoMacBookPro flutter_demo1 % git status
fatal: not a git repository (or any of the parent directories): .git

//git init ---- 创建git

twinkleo@TwinkleoMacBookPro flutter_demo1 % git init
Initialized empty Git repository in /Users/twinkleo/Desktop/Flutter_Study/flutter_demo1/.git/

//git add . ---- 添加

twinkleo@TwinkleoMacBookPro flutter_demo1 % git add .

//git commit -m "初始化项目" ---- 提交项目

twinkleo@TwinkleoMacBookPro flutter_demo1 % git commit -m "初始化项目"
[master (root-commit) a9a7aad] 初始化项目
 58 files changed, 1594 insertions(+)
 create mode 100644 .gitignore
 create mode 100644 .metadata
 create mode 100644 README.md
 create mode 100644 android/app/build.gradle
 create mode 100644 android/app/src/debug/AndroidManifest.xml
 create mode 100644 android/app/src/main/AndroidManifest.xml
 create mode 100644 android/app/src/main/java/com/example/flutter_demo1/MainActivity.java
 create mode 100644 android/app/src/main/res/drawable/launch_background.xml
 create mode 100644 android/app/src/main/res/mipmap-hdpi/ic_launcher.png
 create mode 100644 android/app/src/main/res/mipmap-mdpi/ic_launcher.png
 create mode 100644 android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
 create mode 100644 android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
 create mode 100644 android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
 create mode 100644 android/app/src/main/res/values/styles.xml
 create mode 100644 android/app/src/profile/AndroidManifest.xml
 create mode 100644 android/build.gradle
 create mode 100644 android/gradle.properties
 create mode 100644 android/gradle/wrapper/gradle-wrapper.properties
 create mode 100644 android/settings.gradle
 create mode 100644 ios/Flutter/AppFrameworkInfo.plist
 create mode 100644 ios/Flutter/Debug.xcconfig
 create mode 100644 ios/Flutter/Release.xcconfig
 create mode 100644 ios/Runner.xcodeproj/project.pbxproj
 create mode 100644 ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata
 create mode 100644 ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
 create mode 100644 ios/Runner.xcworkspace/contents.xcworkspacedata
 create mode 100644 ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
 create mode 100644 ios/Runner/AppDelegate.h
 create mode 100644 ios/Runner/AppDelegate.m
 create mode 100644 ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json
 create mode 100644 ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png
 create mode 100644 ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png
 create mode 100644 ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png
 create mode 100644 ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png
 create mode 100644 ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png
 create mode 100644 ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png
 create mode 100644 ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png
 create mode 100644 ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png
 create mode 100644 ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png
 create mode 100644 ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png
 create mode 100644 ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png
 create mode 100644 ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png
 create mode 100644 ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png
 create mode 100644 ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png
 create mode 100644 ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png
 create mode 100644 ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json
 create mode 100644 ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
 create mode 100644 ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
 create mode 100644 ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png
 create mode 100644 ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md
 create mode 100644 ios/Runner/Base.lproj/LaunchScreen.storyboard
 create mode 100644 ios/Runner/Base.lproj/Main.storyboard
 create mode 100644 ios/Runner/Info.plist
 create mode 100644 ios/Runner/main.m
 create mode 100644 lib/main.dart
 create mode 100644 pubspec.lock
 create mode 100644 pubspec.yaml
 create mode 100644 test/widget_test.dart

//git status ---- 结束后再次查看git状态 ---发现没有什么可以提交了,就是都已经提交上去了

twinkleo@TwinkleoMacBookPro flutter_demo1 % git status
On branch master
nothing to commit, working tree clean

//git tag flutter_demo01_HelloWorld的案例代码实现 ---- 写tag,为了以后容易辨别

twinkleo@TwinkleoMacBookPro flutter_demo1 % git tag flutter_demo01_HelloWorld的案例代码实现

---项目发生变动---再次提交项目---

//git add . ---- 添加

twinkleo@TwinkleoMacBookPro flutter_demo1 % git add .

//git commit -m "阶段案例实现 3图滚动表" --- 提交

twinkleo@TwinkleoMacBookPro flutter_demo1 % git commit -m "阶段案例实现 3图滚动表"
[master 2daa83d] 阶段案例实现 3图滚动表
 1 file changed, 84 insertions(+), 116 deletions(-)
 rewrite lib/main.dart (83%)

//git status ---- 查看git状态

twinkleo@TwinkleoMacBookPro flutter_demo1 % git status
On branch master
nothing to commit, working tree clean

//git reflog ---查看之前git上做过的变动

twinkleo@TwinkleoMacBookPro flutter_demo1 % git reflog
2daa83d (HEAD -> master) HEAD@{0}: commit: 阶段案例实现 3图滚动表
a9a7aad (tag: flutter_demo01_HelloWorld的案例代码实现) HEAD@{1}: commit (initial): 初始化项目

//git reset --hard a9a7aad ---- 回滚到为a9a7aad的代码

twinkleo@TwinkleoMacBookPro flutter_demo1 % git reset --hard a9a7aad 
HEAD is now at a9a7aad 初始化项目
twinkleo@TwinkleoMacBookPro flutter_demo1 % 
上一篇下一篇

猜你喜欢

热点阅读