git 常用命令

前臺軟件visual Studio Code

 

github新疆了項目會出現下面的命令

…or create a new repository on the command line

echo "# WeixinBot" >> README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/Urinx/WeixinBot.git
git push -u origin master

…or push an existing repository from the command line

git remote add origin https://github.com/Urinx/WeixinBot.git
git push -u origin master

…or import code from another repository

You can initialize this repository with code from a Subversion, Mercurial, or TFS project.

git log
找到需要回退的那次commit的 哈希值,
git reset --hard commit_id

 


出現過的問題:

1.文件太大,會報錯

remote: error: File translation/doc/knowledge_new.sql is 103.78 MB; this exceeds GitHub's file size limit of 100.00 MB

 

git導出dev分支

$ git clone http://192.168.1.50/wyqjs/qiuzhi.git
Cloning into 'qiuzhi'...
remote: Counting objects: 519, done.
remote: Compressing objects: 100% (409/409), done.
remote: Total 519 (delta 187), reused 408 (delta 105)
Receiving objects: 100% (519/519), 295.75 KiB | 16.43 MiB/s, done.
Resolving deltas: 100% (187/187), done.

lunmei@DESKTOP-5COD9DQ MINGW64 ~/Desktop
$ git branch -a
fatal: not a git repository (or any of the parent directories): .git

lunmei@DESKTOP-5COD9DQ MINGW64 ~/Desktop
$ cd qiuzhi/

lunmei@DESKTOP-5COD9DQ MINGW64 ~/Desktop/qiuzhi (master)
$ git branch -a
* master
  remotes/origin/HEAD -> origin/master
  remotes/origin/dev
  remotes/origin/master
  remotes/origin/v1.0.1bug

lunmei@DESKTOP-5COD9DQ MINGW64 ~/Desktop/qiuzhi (master)
$ git checkout dev
Switched to a new branch 'dev'
Branch 'dev' set up to track remote branch 'dev' from 'origin'.

lunmei@DESKTOP-5COD9DQ MINGW64 ~/Desktop/qiuzhi (dev)
$ git status
On branch dev
Your branch is up to date with 'origin/dev'.

nothing to commit, working tree clean

lunmei@DESKTOP-5COD9DQ MINGW64 ~/Desktop/qiuzhi (dev)
$ git log
commit 043f5afa3c28fb5a5c682c88836d85e16cb95a47 (HEAD -> dev, origin/dev)
Author: wyq-pc <[email protected]>
Date:   Fri Oct 12 16:00:12 2018 +0800

    開始時間

commit adf99e2bc7b5efc739104484247eeeba514a7d2c
Author: wyq-pc <[email protected]>
Date:   Fri Oct 12 15:54:42 2018 +0800

    bug

commit bdf088f67150a643b09eee4ef1072329f4507ae5
Author: wyq-pc <[email protected]>
Date:   Fri Oct 12 10:32:23 2018 +0800

    bug

commit 16a5e9ddb1cc222f81efebe8be9b9242b716334c
Author: wyq-pc <[email protected]>
Date:   Thu Oct 11 14:35:04 2018 +0800

    聊天

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章