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

星期一, 5月 27, 2024

Git不要記錄文件變更權限

最近遇到git會吃到權限變更的記錄如下

diff --git a/classes/GTM.php b/classes/GTM.php
old mode 100644
new mode 100755 
diff --git a/classes/MetaTags.php b/classes/MetaTags.php 
old mode 100644 
new mode 100755

可以加上全域的忽略這個狀態即可
git config core.fileMode false

星期四, 9月 21, 2023

MAC更新bitbucket的known_hosts

按照以下步驟即可完成刷新

IDENTIFY IF YOUR CLIENT IS IMPACTED

$ ssh git@bitbucket.org host_key_info You are using host key with fingerprint: ssh-ed25519 SHA256:ybgmFkzwOSotHTHLJgHO0QN8L0xErw6vd0VhFA9m3SM See https://bitbucket.org/blog/ssh-host-key-changes for more details.

2. CONFIGURE YOUR CLIENT TO TRUST THE NEW HOST KEYS

$ ssh-keygen -R bitbucket.org && curl https://bitbucket.org/site/ssh >> ~/.ssh/known_hosts

或存取下面的網址,取得回應的字串,貼回你的known_hosts

https://bitbucket.org/site/ssh

bitbucket.org ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDQeJzhupRu0u0cdegZIa8e86EG2qOCsIsD1Xw0xSeiPDlCr7kq97NLmMbpKTX6Esc30NuoqEEHCuc7yWtwp8dI76EEEB1VqY9QJq6vk+aySyboD5QF61I/1WeTwu+deCbgKMGbUijeXhtfbxSxm6JwGrXrhBdofTsbKRUsrN1WoNgUa8uqN1Vx6WAJw1JHPhglEGGHea6QICwJOAr/6mrui/oB7pkaWKHj3z7d1IC4KWLtY47elvjbaTlkN04Kc/5LFEirorGYVbt15kAUlqGM65pk6ZBxtaO3+30LVlORZkxOh+LKL/BvbZ/iRNhItLqNyieoQj/uh/7Iv4uyH/cV/0b4WDSd3DptigWq84lJubb9t/DnZlrJazxyDCulTmKdOR7vs9gMTo+uoIrPSb8ScTtvw65+odKAlBj59dhnVp9zd7QUojOpXlL62Aw56U4oO+FALuevvMjiWeavKhJqlR7i5n9srYcrNV7ttmDw7kf/97P5zauIhxcjX+xHv4M=
bitbucket.org ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBPIQmuzMBuKdWeF4+a2sjSSpBK0iqitSQ+5BM9KhpexuGt20JpTVM7u5BDZngncgrqDMbWdxMWWOGtZ9UgbqgZE=
bitbucket.org ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIazEu89wgQZ4bqs3d63QSMzYVa0MuJ2e2gKTKqu+UUO

REF:
https://bitbucket.org/blog/ssh-host-key-changes

星期二, 2月 20, 2018

[Git] 讓merge不用再輸入訊息


最近在處理shell使用git merge都會跳出上圖所示的的訊息互動視窗

會讓整個想透過sh自動化無法完成,還好可以加上--no-edit參數就可以避過啦。
以下是最完整的語法:

git merge --no-ff develop --no-edit



星期五, 1月 05, 2018

[Git] 從https 的clone變更為ssh

由於先前使用https來clone repo,如果要變動的可以透過以下指令變更回ssh

git remote set-url origin git@github.com:username/your-repository.git

星期五, 5月 20, 2016

[GIT] server certificate verification failed. 錯誤排除

fatal: unable to access 'https://bigd@bitbucket.org/shark_tech/thegrand.git/': server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none


bigd@ubuntu:/var/www/thegrand$  export GIT_SSL_NO_VERIFY=1

bigd@ubuntu:/var/www/thegrand$  git submodule update --init --recursive

星期五, 4月 03, 2015

[GIT] 改壞了怎麼回到上一個版本

記錄一下GIT如何回到上一個版本的指令集

 Reverting Working Copy to Most Recent Commit To revert to previous commit, ignoring any changes:

git reset --hard HEAD

where HEAD is the last commit in your current branch Reverting Working Copy to an Older Commit To revert to a commit that's older than the most recent commit: # Resets index to former commit; replace '56e05fced' with your commit code
git reset 56e05fced  # Moves pointer back to previous HEAD git reset --soft HEAD@{1}

 git commit -m "Revert to 56e05fced" # Updates working copy to reflect the new commit git reset --hard

http://stackoverflow.com/questions/4114095/revert-to-previous-git-commit


另一篇Apple大大建議

cherry-pick跟reset + rebase (有點難懂XD)

https://blog.wu-boy.com/2009/12/git-how-to-remove-file-and-commit-from-history%E5%A6%82%E4%BD%95%E7%A7%BB%E9%99%A4-commit-%E6%AD%B7%E5%8F%B2%E7%B4%80%E9%8C%84/

星期日, 6月 08, 2014

[Git] 如何push已存在的Repo到另一個不同Romote repo server

簡單的步驟讓你可以把Local Repo丟到另一台遠端的Repo


  1. Create a new repo at github. 
  2. Clone the repo from fedorahosted to your local machine. 
  3. git remote rename origin upstream (將原本的origin repo這個儲存庫更名為upstream)
  4. git remote add origin URL_TO_GITHUB_REPO (新增新的遠端的repo為origin)
  5. git push origin master (將變動的檔案push上去)

Now you can work with it just like any other github repo. To pull in patches from upstream, simply run git pull upstream master && git push origin master.

星期三, 4月 09, 2014

[GIT] 輕鬆了解Git 分支的概念與基本操作手記




這張圖讓人可以很快速了解整個Git Branch的精要(分支的種類與用途)

主要分支

 * master 主程式(除非重大 bug,則會分出 hotfix 分支)
 * develop 開發分支(用來在另外分支出 Release, feature)

次要分支

 * Hotfixes(由 master 直接分支,馬上修正 bug)
 * Feature(由 develop 直接分支,開發新功能)
 * Release(由 develop 直接分支,開發下一版 Release)

小惡魔神人在2011年的文章有中文版的操作步驟:
 Git 版本控制 branch model 分支模組基本介紹
建議可以好好閱讀與演練:D

星期二, 4月 02, 2013

[Eclipse] 使用eGIT取回Github上面的專案

前言:
由於平常都使用eclispe開發,所以直接安裝git plugin來存取Github的repo是比較方便的,
感覺把一些sample code放在這,比放在blog上好維護多了xd
所以記錄一下如何從github取回專案 :D

前置處理:
1.請先安裝Egit pluign:

Help->Install New Software
EGit - http://download.eclipse.org/egit/updates
記得二個都打勾!!

星期一, 7月 05, 2010

Git 學習資源

好用的Git分散式版本控制工具。團隊開發畢備的好幫手。


Ubuntu Enviornment:
$apt-get install git-core gitk # in ubuntu

step1:create repository in server
/var/git/repos                                #server repos path
$mkdir serverproject #建立你的目錄
$cd serverproject
$git --bare init --shared                #建立GitProjectName的repository

step2:create repository in client
$vi .gitconfig #your profile
[user]
        name = kenwctsai
        email = bigdstut@gmail.com


$cd clientproject#到你的專案目錄下
$git init #git metadata

step3:commit to server (之後更新code只要用這就好)
$git add . #git新增檔案
$git commit -m 'your commit msg' #commit to repos server

其他輔助的功能:


檢查檔案狀態
$git status

檢查log
$git log

Reference:
  1. Pro Git
  2. A tour of git: the basics
  3. http://git-scm.com/
  4. Git-shape(Git for .NET)
  5. Git 初學筆記 - 指令操作教學
  6. 我愛GIT(.pdf) jserv
  7. Git Study
  8. Git 版本控制系統(2) 開 branch 分支和操作遠端 repo.




安裝工具
  1. msysgit-git for windows
  2. TortoiseGit The coolest Interface to (Git) Version Control

其他你感興趣的文章

Related Posts with Thumbnails