xin@XIN MINGW64 ~/Desktop/LED
$ git clone https://github.com/cqut-liuxin/LED.git
Cloning into 'LED'...
warning: You appear to have cloned an empty repository.
Checking connectivity... done.
xin@XIN MINGW64 ~/Desktop/LED$
xin@XIN MINGW64 ~/Desktop/LED
$ touch .gitignore
xin@XIN MINGW64 ~/Desktop/LED (master)
$
xin@XIN MINGW64 ~/Desktop/LED (master)
$ git add .
warning: LF will be replaced by CRLF in USER/LED.uvguix.Administrator.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in USER/LED.uvguix.LIUXIN.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in USER/LED.uvguix.PH.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in USER/LED.uvguix.刘鑫.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in USER/LED.uvoptx.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in USER/LED.uvprojx.
The file will have its original line endings in your working directory.
xin@XIN MINGW64 ~/Desktop/LED (master)
$ git status
On branch master
Initial commit
Changes to be committed:
(use "git rm --cached <file>..." to unstage)
new file: .gitignore
new file: CORE/core_cm3.c
new file: CORE/core_cm3.h
new file: CORE/startup_stm32f10x_hd.s
new file: HARDWARE/LED/led.c
new file: HARDWARE/LED/led.h
new file: README.TXT
new file: STM32F10x_FWLib/inc/misc.h
new file: STM32F10x_FWLib/inc/stm32f10x_adc.h
new file: STM32F10x_FWLib/inc/stm32f10x_bkp.h
new file: STM32F10x_FWLib/inc/stm32f10x_can.h
new file: STM32F10x_FWLib/inc/stm32f10x_cec.h
new file: STM32F10x_FWLib/inc/stm32f10x_crc.h
new file: STM32F10x_FWLib/inc/stm32f10x_dac.h
new file: STM32F10x_FWLib/inc/stm32f10x_dbgmcu.h
new file: STM32F10x_FWLib/inc/stm32f10x_dma.h
new file: STM32F10x_FWLib/inc/stm32f10x_exti.h
new file: STM32F10x_FWLib/inc/stm32f10x_flash.h
new file: STM32F10x_FWLib/inc/stm32f10x_fsmc.h
new file: STM32F10x_FWLib/inc/stm32f10x_gpio.h
new file: STM32F10x_FWLib/inc/stm32f10x_i2c.h
new file: STM32F10x_FWLib/inc/stm32f10x_iwdg.h
new file: STM32F10x_FWLib/inc/stm32f10x_pwr.h
new file: STM32F10x_FWLib/inc/stm32f10x_rcc.h
new file: STM32F10x_FWLib/inc/stm32f10x_rtc.h
new file: STM32F10x_FWLib/inc/stm32f10x_sdio.h
new file: STM32F10x_FWLib/inc/stm32f10x_spi.h
new file: STM32F10x_FWLib/inc/stm32f10x_tim.h
new file: STM32F10x_FWLib/inc/stm32f10x_usart.h
new file: STM32F10x_FWLib/inc/stm32f10x_wwdg.h
new file: STM32F10x_FWLib/src/misc.c
new file: STM32F10x_FWLib/src/stm32f10x_adc.c
new file: STM32F10x_FWLib/src/stm32f10x_bkp.c
new file: STM32F10x_FWLib/src/stm32f10x_can.c
new file: STM32F10x_FWLib/src/stm32f10x_cec.c
new file: STM32F10x_FWLib/src/stm32f10x_crc.c
new file: STM32F10x_FWLib/src/stm32f10x_dac.c
new file: STM32F10x_FWLib/src/stm32f10x_dbgmcu.c
new file: STM32F10x_FWLib/src/stm32f10x_dma.c
new file: STM32F10x_FWLib/src/stm32f10x_exti.c
new file: STM32F10x_FWLib/src/stm32f10x_flash.c
new file: STM32F10x_FWLib/src/stm32f10x_fsmc.c
new file: STM32F10x_FWLib/src/stm32f10x_gpio.c
new file: STM32F10x_FWLib/src/stm32f10x_i2c.c
new file: STM32F10x_FWLib/src/stm32f10x_iwdg.c
new file: STM32F10x_FWLib/src/stm32f10x_pwr.c
new file: STM32F10x_FWLib/src/stm32f10x_rcc.c
new file: STM32F10x_FWLib/src/stm32f10x_rtc.c
new file: STM32F10x_FWLib/src/stm32f10x_sdio.c
new file: STM32F10x_FWLib/src/stm32f10x_spi.c
new file: STM32F10x_FWLib/src/stm32f10x_tim.c
new file: STM32F10x_FWLib/src/stm32f10x_usart.c
new file: STM32F10x_FWLib/src/stm32f10x_wwdg.c
new file: SYSTEM/delay/delay.c
new file: SYSTEM/delay/delay.h
new file: SYSTEM/sys/sys.c
new file: SYSTEM/sys/sys.h
new file: SYSTEM/usart/usart.c
new file: SYSTEM/usart/usart.h
new file: USER/JLinkSettings.ini
new file: USER/LED.uvguix.Administrator
new file: USER/LED.uvguix.LIUXIN
new file: USER/LED.uvguix.PH
new file: "USER/LED.uvguix.\345\210\230\351\221\253"
new file: USER/LED.uvoptx
new file: USER/LED.uvprojx
new file: USER/main.c
new file: USER/stm32f10x.h
new file: USER/stm32f10x_conf.h
new file: USER/stm32f10x_it.c
new file: USER/stm32f10x_it.h
new file: USER/system_stm32f10x.c
new file: USER/system_stm32f10x.h
new file: keilkilll.bat
xin@XIN MINGW64 ~/Desktop/LED (master)
xin@XIN MINGW64 ~/Desktop/LED (master)
$ git commit -m "add a new project named LED"
[master (root-commit) eeb24cf] add a new project named LED
warning: LF will be replaced by CRLF in USER/LED.uvguix.Administrator.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in USER/LED.uvguix.LIUXIN.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in USER/LED.uvguix.PH.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in USER/LED.uvguix.刘鑫.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in USER/LED.uvoptx.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in USER/LED.uvprojx.
The file will have its original line endings in your working directory.
74 files changed, 47425 insertions(+)
create mode 100644 .gitignore
create mode 100644 CORE/core_cm3.c
create mode 100644 CORE/core_cm3.h
create mode 100644 CORE/startup_stm32f10x_hd.s
create mode 100644 HARDWARE/LED/led.c
create mode 100644 HARDWARE/LED/led.h
create mode 100644 README.TXT
create mode 100644 STM32F10x_FWLib/inc/misc.h
create mode 100644 STM32F10x_FWLib/inc/stm32f10x_adc.h
create mode 100644 STM32F10x_FWLib/inc/stm32f10x_bkp.h
create mode 100644 STM32F10x_FWLib/inc/stm32f10x_can.h
create mode 100644 STM32F10x_FWLib/inc/stm32f10x_cec.h
create mode 100644 STM32F10x_FWLib/inc/stm32f10x_crc.h
create mode 100644 STM32F10x_FWLib/inc/stm32f10x_dac.h
create mode 100644 STM32F10x_FWLib/inc/stm32f10x_dbgmcu.h
create mode 100644 STM32F10x_FWLib/inc/stm32f10x_dma.h
create mode 100644 STM32F10x_FWLib/inc/stm32f10x_exti.h
create mode 100644 STM32F10x_FWLib/inc/stm32f10x_flash.h
create mode 100644 STM32F10x_FWLib/inc/stm32f10x_fsmc.h
create mode 100644 STM32F10x_FWLib/inc/stm32f10x_gpio.h
create mode 100644 STM32F10x_FWLib/inc/stm32f10x_i2c.h
create mode 100644 STM32F10x_FWLib/inc/stm32f10x_iwdg.h
create mode 100644 STM32F10x_FWLib/inc/stm32f10x_pwr.h
create mode 100644 STM32F10x_FWLib/inc/stm32f10x_rcc.h
create mode 100644 STM32F10x_FWLib/inc/stm32f10x_rtc.h
create mode 100644 STM32F10x_FWLib/inc/stm32f10x_sdio.h
create mode 100644 STM32F10x_FWLib/inc/stm32f10x_spi.h
create mode 100644 STM32F10x_FWLib/inc/stm32f10x_tim.h
create mode 100644 STM32F10x_FWLib/inc/stm32f10x_usart.h
create mode 100644 STM32F10x_FWLib/inc/stm32f10x_wwdg.h
create mode 100644 STM32F10x_FWLib/src/misc.c
create mode 100644 STM32F10x_FWLib/src/stm32f10x_adc.c
create mode 100644 STM32F10x_FWLib/src/stm32f10x_bkp.c
create mode 100644 STM32F10x_FWLib/src/stm32f10x_can.c
create mode 100644 STM32F10x_FWLib/src/stm32f10x_cec.c
create mode 100644 STM32F10x_FWLib/src/stm32f10x_crc.c
create mode 100644 STM32F10x_FWLib/src/stm32f10x_dac.c
create mode 100644 STM32F10x_FWLib/src/stm32f10x_dbgmcu.c
create mode 100644 STM32F10x_FWLib/src/stm32f10x_dma.c
create mode 100644 STM32F10x_FWLib/src/stm32f10x_exti.c
create mode 100644 STM32F10x_FWLib/src/stm32f10x_flash.c
create mode 100644 STM32F10x_FWLib/src/stm32f10x_fsmc.c
create mode 100644 STM32F10x_FWLib/src/stm32f10x_gpio.c
create mode 100644 STM32F10x_FWLib/src/stm32f10x_i2c.c
create mode 100644 STM32F10x_FWLib/src/stm32f10x_iwdg.c
create mode 100644 STM32F10x_FWLib/src/stm32f10x_pwr.c
create mode 100644 STM32F10x_FWLib/src/stm32f10x_rcc.c
create mode 100644 STM32F10x_FWLib/src/stm32f10x_rtc.c
create mode 100644 STM32F10x_FWLib/src/stm32f10x_sdio.c
create mode 100644 STM32F10x_FWLib/src/stm32f10x_spi.c
create mode 100644 STM32F10x_FWLib/src/stm32f10x_tim.c
create mode 100644 STM32F10x_FWLib/src/stm32f10x_usart.c
create mode 100644 STM32F10x_FWLib/src/stm32f10x_wwdg.c
create mode 100644 SYSTEM/delay/delay.c
create mode 100644 SYSTEM/delay/delay.h
create mode 100644 SYSTEM/sys/sys.c
create mode 100644 SYSTEM/sys/sys.h
create mode 100644 SYSTEM/usart/usart.c
create mode 100644 SYSTEM/usart/usart.h
create mode 100644 USER/JLinkSettings.ini
create mode 100644 USER/LED.uvguix.Administrator
create mode 100644 USER/LED.uvguix.LIUXIN
create mode 100644 USER/LED.uvguix.PH
create mode 100644 "USER/LED.uvguix.\345\210\230\351\221\253"
create mode 100644 USER/LED.uvoptx
create mode 100644 USER/LED.uvprojx
create mode 100644 USER/main.c
create mode 100644 USER/stm32f10x.h
create mode 100644 USER/stm32f10x_conf.h
create mode 100644 USER/stm32f10x_it.c
create mode 100644 USER/stm32f10x_it.h
create mode 100644 USER/system_stm32f10x.c
create mode 100644 USER/system_stm32f10x.h
create mode 100644 keilkilll.bat
xin@XIN MINGW64 ~/Desktop/LED (master
$ git push -u origin master
Counting objects: 72, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (70/70), done.
Writing objects: 100% (72/72), 191.90 KiB | 0 bytes/s, done.
Total 72 (delta 11), reused 0 (delta 0)
remote: Resolving deltas: 100% (11/11), done.
To https://github.com/cqut-liuxin/LED.git
* [new branch] master -> master
Branch master set up to track remote branch master from origin.
$ git push -u origin master
Counting objects: 72, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (70/70), done.
Writing objects: 100% (72/72), 191.90 KiB | 0 bytes/s, done.
Total 72 (delta 11), reused 0 (delta 0)
remote: Resolving deltas: 100% (11/11), done.
To https://github.com/cqut-liuxin/LED.git
* [new branch] master -> master
Branch master set up to track remote branch master from origin.
xin@XIN MINGW64 ~/Desktop/LED (master)
$ git fetch
remote: Counting objects: 3, done.
remote: Compressing objects: 100% (1/1), done.
remote: Total 3 (delta 1), reused 3 (delta 1), pack-reused 0
Unpacking objects: 100% (3/3), done.
From https://github.com/cqut-liuxin/LED
4e3b834..93c5c18 master -> origin/master
xin@XIN MINGW64 ~/Desktop/LED (master)
$
xin@XIN MINGW64 ~/Desktop/LED (master)
$ git merge
Updating 4e3b834..93c5c18
Fast-forward
README.TXT | 60 -----------------------------------------------------------
keilkilll.bat | 27 ---------------------------
new.txt | 0
3 files changed, 87 deletions(-)
delete mode 100644 README.TXT
delete mode 100644 keilkilll.bat
create mode 100644 new.txt
xin@XIN MINGW64 ~/Desktop/LED (master)
$ git log
commit 93c5c18ccaf6cee7e10d78665f7555054eceb9d9
Author: cqut-liuxin <625092890@qq.com>
Date: Sat Feb 11 13:54:39 2017 +0800
delete and delete
delete akeilkill,README and add new
commit 4e3b834b65ec406c7250f2eebeba33a4172a4d9e
Author: cqut-liuxin <625092890@qq.com>
Date: Sat Feb 11 13:46:01 2017 +0800
add user
commit 3856ea85a2c73bb2395c15059eec2cc3811a8e9c
Author: cqut-liuxin <625092890@qq.com>
Date: Sat Feb 11 13:40:23 2017 +0800
Revert "d"
This reverts commit 83a94aa9d8955a85905e0762bb18383e1c3aa5f6.
commit 13626fcb47e2c2652457a77b7931907955d3582c
xin@XIN MINGW64 ~/Desktop/LED (master)
$ git reset --hard 4e3b834b65ec406c7250f2eebeba33a4172a4d9e
HEAD is now at 4e3b834 add user
xin@XIN MINGW64 ~/Desktop/LED (master)
$ git status
On branch master
Your branch is behind 'origin/master' by 1 commit, and can be fast-forwarded.
(use "git pull" to update your local branch)
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: README.TXT
no changes added to commit (use "git add" and/or "git commit -a")
xin@XIN MINGW64 ~/Desktop/LED (master)
$ git status
On branch master
Your branch is behind 'origin/master' by 1 commit, and can be fast-forwarded.
(use "git pull" to update your local branch)
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: README.TXT
no changes added to commit (use "git add" and/or "git commit -a")
xin@XIN MINGW64 ~/Desktop/LED (master)
$ git add .
xin@XIN MINGW64 ~/Desktop/LED (master)
$ git status
On branch master
Your branch is behind 'origin/master' by 1 commit, and can be fast-forwarded.
(use "git pull" to update your local branch)
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
modified: README.TXT
xin@XIN MINGW64 ~/Desktop/LED (master)
$ gut commit -m "修改了一个txt文件"
bash: gut: command not found
xin@XIN MINGW64 ~/Desktop/LED (master)
$ git commit -m "修改了一个txt文件"
[master ad0e614] 修改了一个txt文件
1 file changed, 18 insertions(+), 60 deletions(-)
rewrite README.TXT (94%)
xin@XIN MINGW64 ~/Desktop/LED (master)
$ git push -u origin master
To https://github.com/cqut-liuxin/LED.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'https://github.com/cqut-liuxin/LED.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
$ git pull
Updating 4e3b834..93c5c18
Fast-forward
README.TXT | 60 -----------------------------------------------------------
keilkilll.bat | 27 ---------------------------
new.txt | 0
3 files changed, 87 deletions(-)
delete mode 100644 README.TXT
delete mode 100644 keilkilll.bat
create mode 100644 new.txt
结果发现,直接被同化成了远程仓库的版本。keilkill.bat 和 README被删除了
我们回到上一个版本,也就是回到A,我们没修改“READ.TXT”的时候。
依旧使用git log git reset --hard <>
我们做这样的尝试,我们建立一个服务器上没有,历史版本上也没有的文件,比如在文件夹下随便新建一个c文件" GPIO.c” ,我们在里面写一些代码我们来测试
我们再 git add . 然后commit 最后 pull (注意:前面两部必须要有,因为被标记之后,我们才能进行pull融合)
xin@XIN MINGW64 ~/Desktop/LED (master)
$ git status
On branch master
Your branch is behind 'origin/master' by 1 commit, and can be fast-forwarded.
(use "git pull" to update your local branch)
Untracked files:
(use "git add <file>..." to include in what will be committed)
GPIO.c
nothing added to commit but untracked files present (use "git add" to track)
xin@XIN MINGW64 ~/Desktop/LED (master)
$ git add .
xin@XIN MINGW64 ~/Desktop/LED (master)
$ git commit -m "新建了一个C文件"
[master 6b9810b] 新建了一个C文件
1 file changed, 6 insertions(+)
create mode 100644 GPIO.c
xin@XIN MINGW64 ~/Desktop/LED (master)
$ git pull
Removing keilkilll.bat
Removing README.TXT
Merge made by the 'recursive' strategy.
README.TXT | 60 -----------------------------------------------------------
keilkilll.bat | 27 ---------------------------
new.txt | 0
3 files changed, 87 deletions(-)
delete mode 100644 README.TXT
delete mode 100644 keilkilll.bat
create mode 100644 new.txt
xin@XIN MINGW64 ~/Desktop/LED (master)
xin@XIN MINGW64 ~/Desktop/LED (master)
$ git push
Counting objects: 5, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (5/5), done.
Writing objects: 100% (5/5), 610 bytes | 0 bytes/s, done.
Total 5 (delta 2), reused 0 (delta 0)
remote: Resolving deltas: 100% (2/2), completed with 1 local objects.
To https://github.com/cqut-liuxin/LED.git
93c5c18..0408807 master -> master
xin@XIN MINGW64 ~/Desktop/LED (master)
$ git add .
xin@XIN MINGW64 ~/Desktop/LED (master)
$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
modified: GPIO.c
xin@XIN MINGW64 ~/Desktop/LED (master)
$ git commit -m "改变高低电平"
[master 28db7d9] 改变高低电平
1 file changed, 3 insertions(+), 1 deletion(-)
xin@XIN MINGW64 ~/Desktop/LED (master)
$ git push
To https://github.com/cqut-liuxin/LED.git
! [rejected] master -> master (fetch first)
error: failed to push some refs to 'https://github.com/cqut-liuxin/LED.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
xin@XIN MINGW64 ~/Desktop/LED (master)
$ git pull
remote: Counting objects: 3, done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 3 (delta 1), reused 3 (delta 1), pack-reused 0
Unpacking objects: 100% (3/3), done.
From https://github.com/cqut-liuxin/LED
0408807..6200b7c master -> origin/master
Auto-merging GPIO.c
CONFLICT (content): Merge conflict in GPIO.c
Automatic merge failed; fix conflicts and then commit the result.
xin@XIN MINGW64 ~/Desktop/LED (master|MERGING)
$
xin@XIN MINGW64 ~/Desktop/LED (master|MERGING)
$ git add .
xin@XIN MINGW64 ~/Desktop/LED (master|MERGING)
$ git commit -m "改变了LED的高低电平"
[master b0ba0ba] 改变了LED的高低电平
xin@XIN MINGW64 ~/Desktop/LED (master)
$ git commit -m "改变了LED的高低点平,并增加了对LED3的操作"
On branch master
Your branch is ahead of 'origin/master' by 2 commits.
(use "git push" to publish your local commits)
nothing to commit, working tree clean
xin@XIN MINGW64 ~/Desktop/LED (master)
$ git status
On branch master
Your branch is ahead of 'origin/master' by 2 commits.
(use "git push" to publish your local commits)
nothing to commit, working tree clean
xin@XIN MINGW64 ~/Desktop/LED (master)
$ git push
Counting objects: 6, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (6/6), done.
Writing objects: 100% (6/6), 648 bytes | 0 bytes/s, done.
Total 6 (delta 3), reused 0 (delta 0)
remote: Resolving deltas: 100% (3/3), completed with 1 local objects.
To https://github.com/cqut-liuxin/LED.git
6200b7c..b0ba0ba master -> master
欢迎光临 重工电子论坛 (http://cqutlab.cn/) | Powered by Discuz! X3.1 |