Coggle requires JavaScript to display documents.
工作目錄 => git add 暫存區 => git commit 儲存庫
git log
commit cef6e4017eb1a16a7bb3434f12d9008ff83a821a (HEAD -> master) Author: Hello <xxx@gmail.com> Date: Fri Aug 4 03:02:37 2021 +0800 create index page commit cc797cdb7c7a337824a25075e0dbe0bc7c703a1e Author: Hello <xxx@gmail.com> Date: Wed Aug 2 03:02:37 2021 +0800 init commit
git log --online --graph
* cef6e40 create index page * cc797cd init commit
git checkout (id of a commit)
git branch
git show cef6e4017eb1a16a7bb3434f12d9008ff83a821a
rm hello.html
git status
On branch master Changes not staged for commit: (use "git add/rm <file>..." to update what will be committed) (use "git checkout -- <file>..." to discard changes in working directory) deleted: hello.html no changes added to commit (use "git add" and/or "git commit -a")
git add hello.html
On branch master Changes to be committed: (use "git reset HEAD <file>..." to unstage) deleted: hello.html
git rm hello.html
rm 'hello.html'
mv hello.html world.html
On branch master Changes not staged for commit: (use "git add/rm <file>..." to update what will be committed) (use "git checkout -- <file>..." to discard changes in working directory) deleted: hello.html Untracked files: (use "git add <file>..." to include in what will be committed) world.html no changes added to commit (use "git add" and/or "git commit -a")
git add --all
On branch master Changes to be committed: (use "git reset HEAD <file>..." to unstage) renamed: hello.html -> world.html
git mv hello.html world.html
git reset <filepath>
git log --oneline e12d8ef (HEAD -> master) add database.yml in config folder 85e7e30 add hello 657fce7 add container cc797cd init commit
git reset e12d8ef^
git reset master^
git reset HEAD^
git reset HEAD~2
git rm hello.html --cached
On branch master Changes to be committed: (use "git reset HEAD <file>..." to unstage) deleted: hello.html Untracked files: (use "git add <file>..." to include in what will be committed) hello.html
git log --online
4879515 WTF 7dbc437 add hello.html cc797cd init commit
git commit --amend -m "Welcome To Facebook"
[master 614a90c] Welcome To Facebook Date: Wed Aug 16 05:42:56 2017 +0800 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 config/database.yml
git check out -- .
git init
On branch master Initial commit nothing to commit (create/copy files and use "git add" to track)
echo "hello, git" > hello.html
On branch master Initial commit Untracked files: (use "git add <file>..." to include in what will be committed) hello.html nothing added to commit but untracked files present (use "git add" to track)
git add 檔案名稱
git add .
On branch master Initial commit Changes to be committed: (use "git rm --cached <file>..." to unstage) new file: hello.html
git commit -m "init commit"
[master (root-commit) dfccf0c] init commit 1 file changed, 1 insertion(+) create mode 100644 hello.html
git push -u origin master
* master
git branch vinny
vinny * master
git checkout -b "branch name"
git branch -m vinny wakanda
git branch wakanda * master
git branch -d wakanda
git branch * master
git branch -d wakanda error: The branch 'wakanda is not fully merged. If you are sure you want to delete it, run 'git branch -D wakanda'
git branch -D wakanda
Deleted branch wakanda (was b174a5a).
git checkout wakanda
Switched to branch 'wakanda'
git branch * wakanda master
git merge wakanda
Updating 35c42e..f17acb Fast-forward cat1.html | 0 cat2.html | 0 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 cat1.html create mode 100644 cat2.html
git checkout -b <new branch name> <origin branch name>
git checkout -b week_0_part_1 develop
git merge week_1_part_4
git tag 標籤名 SHA_1值
git tag 標籤名稱 SHA_1值 -a -m "附加訊息"
git tag -d 標籤名
Deleted tag '標籤名' (was 8ee0144)
git remote add origin <GitHub repository path>
git remote
git push
git checkout dev
git push -u origin dev
git clone <GitHub repo path>
pwd
cd 目錄名稱
cd ..
mkdir 資料夾名稱
ls
clear
touch 檔案名稱
cp 來源檔案名稱 新增檔案名稱
mv 來源檔案名稱 移動檔案名稱
rm 檔案名稱
vi
i
append
o
按下 esc
:w
:q
:wq 檔案名稱
git checkout -b gh-pages
git push -u origin gh-pages
brew install git
$ git config --global user.name "Hello" $ git config --global user.email "xxx@gmail.com"
$ git config --list