Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

self-learning by Lu-yeom_hw4 #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions homeworks/week1/hw4.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,32 @@
## 跟你朋友介紹 Git
在進行檔案管理的時候,如果你有將檔案更新過,但是又想繼續保留舊的檔案,那就得需要下點功夫,
Git就是可以幫你做版本控制的程式。以下就是版本控制的流程:
1.首先你要先啟動版本控制
git init
2.確認版本控制的狀態
git status
3.再指定想要進行版本控制的檔案
git add
或者也可將所有檔案加入版本控制
git add .
4.你也可預先處理不想要版本控制的檔案,將它忽略就可以了
vim.gitignore
5.然後建立一個commit
git commit -am "自己設定的版本敘述"
6.假如你commit了好多次,發現自己比較喜歡之前的版本而不是最新的版本
git checkout "版本名稱"

以上是線性流程,Git還有一個功能叫做Branch(分支),可以同時進行開發和修正,等兩個branch都完成後再合併。
1.建立branch
git branch "你自己設定的名稱"
2.切換到其他branch
git checkout “branch的名稱”
3.將branch拉回本機
git pull origin master
4.也可將指定的branch同步到Github
git push original "branch的名稱"