顯示具有 git 標籤的文章。 顯示所有文章
顯示具有 git 標籤的文章。 顯示所有文章

2020年3月23日

github記事

https://ithelp.ithome.com.tw/articles/10191301

git 環境設定
git config --global user.name "username"
git config --global user.email "xxxx@gmail.com"

産生一個新分支
git branch 分支名稱
切換到分支
git checkout 分支名稱

和master merge起來
git merge分支名稱

git的情況
git status

修改些檔案
git diff

隱藏檔案
編輯 .gitignore 加入要隱藏的資料夾或檔案名稱
node_modules/

 遠端資料庫名稱
git remote

 註記事項
git commit -m "modify ifttt "
新增
git add -A
git add .





 檔案上傳到github
 git push -u origin master

超過100MB時
git filter-branch --tree-filter 'rm -rf path/to/your/file' HEAD
git push


推不上去,強推
git push -f
先拉再推 
git pull --rebase 

2017年3月14日

git學習記錄

 學習git 筆記


git 環境設定
git config --list
git config --global user.email " 你的email"
git config --global user.name "你的姓名"
安裝數據庫 git init
新增索引 git add .
檢查狀態git status 
提交記錄 git commit -m "更新記錄"
忽略檔案 .gitignore
建立.gitignore把忽略檔案記錄其中表達方式(檔名 *.副檔名 資料夾/)
index.html
*.txt
forder/

取消索引
git reset HEAD
git reset HEAD 檔案名稱
還原檔案
git checkout 檔案
git reset --hard 還原整個專案

下載專案
git clone網址
上傳
git push

git branch
回復版本(四碼在git log中)
git checkout 前四碼
回到最新版本
git checkout master

建分支
git branch 分支名稱
合併分支
git merge 分支名稱

查詢標簽
git tag
詳細標簽
 git tag n
git tag 標簽

git checkout 標簽名稱
git tag -am "詳細內容" 標簽

git stash 暫時存當下目錄
git stash list  列出暫存記錄
git stash pop 還原暫存
git stash drop 刪除最新暫存
git stash clean 刪除全部暫存

有分支時push
git remote 查詢遠端數據庫
git remote rename 原名稱 修改名稱
git push origin master issue
                            [預設遠端主機名稱] [分支名稱]

git pull 更新其他開發者資料

git page

2014年10月22日

git筆記


第一次自己上傳專案,記錄一下。感謝士立線上即時教學。
照文件建立專案
touch README.md
git init
git add README.md

git config --global user.name "帳號"
git config --global user.email "xxx@gmail.com"
 
git commit -m "first commit" git remote add origin https://github.com/帳號/專案名稱
git push -u origin master




下載檔案
git clone 專案網址



上傳檔案

git add .
git commit -m "說明文字"
git push
這樣檔案應該都會上去了

2014年9月6日

git server建置ubuntu

有需要建置一個私人的git專案。記錄一下做法。
1.安裝套件
sudo apt-get install git-core

2.建立git目錄,用一般權限mkdir gitdir
cd mkdir gitdir

3.進入git目錄建立一個空的專案
cd gitdir
git init --bare

4.輸入「mkdir gitFileStore」建立一個存取git專案檔案的資料夾
 cd
mkdir gitFileStore

5.在clinet端輸入git clone 使用者@IP:專案名稱

參考文件
http://blog.wu-boy.com/2011/04/%E5%9C%A8-ubuntu-%E5%AE%89%E8%A3%9D%E6%88%96%E5%8D%87%E7%B4%9A-git-%E7%89%88%E6%9C%AC%E6%8E%A7%E5%88%B6%E7%9A%843%E7%A8%AE%E6%96%B9%E6%B3%95/