Skip to content

Phanix's Blog

Menu
  • About Me / 關於我

Tag: git

Checkout latest git commit automatically

No Comments
| 學習工作, 工作

如果要自動化拿到最後 commit 的 branch (大概只有再 staging/testing server 上有這樣的需求),可以用 git command 加上 shell (sed, grep) crontab 來完成。當然,如果是 gitlab 的話還有 gitlab-runner 可以幫忙,但好像用 shell script 比較直覺一點(?)

Read More »

git cherry-pick 與 git show + git apply 與 git merge

No Comments
| 學習工作, 工作

如果是有部分的更改或新增功能,用 git merge 有時候不見得是好主意

Read More »

Git Error: pack-objects died, out of memory

No Comments
| 學習工作, 工作

紀錄一下…

Read More »

go get with git repository with http

No Comments
| 學習工作, 工作

go lang 的 go tools 做 go get 時,預設都會用 https 去存取 git repository,可是當 https 不能使用,只能跑 http 的時候,要做一些改變。

Read More »

SSL Cert error of git operations via https

No Comments
| 學習工作, 工作

對 remote git repository 存取,可以透過 ssh 或 https,有時候用 https 的時候會遇到 Error

Read More »

Merge multiple git repositories

No Comments
| 學習工作, 工作

建議 git 版本 2.9 以上,原因是 2.9 的版本以上,在 git merge 時可以下參數 ––allow-unrelated-histories

Read More »

[GIT] Delete wrong merge, then redo

No Comments
| 學習工作, 工作

做 merge 的時候難免手殘… <!–more–> 如果還沒 push 到 server 上,那可以用 git reset –hard HEAD~1 來復原。如果是用 –soft 的話該 merge commit 依然會存在 local repository中,不像用 –hard 會刪除。 $ git log commit f92ab34564f48ad6ee9f6bdb13c352e63669dccd Merge: 62f6af0 4f641f3 Author: admin <admin@test.com> Date: Fri Jun 23 11:07:53 2017 +0800 before merge 3d_checkpoint commit 62f6af03b7dc1f0539836b13910850189a0fcd2a Author: admin <admin@test.com> Date: Thu Apr 20 11:54:58 2017 […]

Read More »

Git push detached HEAD, and set upstream to remote branch

No Comments
| 學習工作, 工作

今天遇到的狀況是,不小心把 local branch detach, 而且原本的 local branch 整個被改爛,然後要把修改過的東西(detached HEAD) push 回 remote branch,並把爛掉的 local branch track 上正確的 remote branch

Read More »

Git push to the wrong branch

No Comments
| 學習工作, 工作

其實就是同事弄錯的事情經過 起因是同事想把Branch A倒退回前先前的 commit (rollback),下命令要直接對remote上的 branch 改指到某個 commit 上,但是因為工時太長(x)恍神(o)下錯命令… #當下在3d_new這個branch上,要rollback一個commit,所以理論上要這樣 ~/testGit/gittest$ git push –force origin HEAD^:3d_new #但是下錯命令變成改到3d_test去 ~/testGit/gittest$ git push –force origin HEAD^:3d_test Total 0 (delta 0), reused 0 (delta 0) To git@git_url:group_name/gittest.git + 62f6af0…36b6b05 HEAD^ -> 3d_test (forced update) 這樣的結果變成 3d_test 的 HEAD 被定到 3d_new 的 HEAD^ 去,如果這時候比較 local 與 remote repository 會發現,local上3d_test的commit從與 3d_new […]

Read More »

Rollback a commit on remote git repository

1 Comment
| 學習工作, 工作

因為有同事幹了蠢事,所以紀錄一下順便寫一下差異

Read More »

Posts navigation

1 2 Next

Recent Posts

  • Print date time with ms in PHP, which is faster?
  • Backup mongodb to GCP storage with crontab
  • Apache redirects specific site requests to the other URL
  • Apache multiple allow origin (enable CORS) for multiple domains
  • Google Calendar 行事曆加行程 link

Recent Comments

  • 天灰 on 撲克牌遊戲 — 德州撲克 (Texas Hold’em / Texas Poker)
  • 用FFmpeg取代 AWS Media Converter - Phanix's Blog on AWS S3+Media Converter+CloudFront 做 video file streaming CDN服務
  • Mount GCP storage as filesystem, and access with php - Phanix's Blog on php+apache 執行 sudo 命令出現 sudo: no tty present and no askpass program specified
  • Chateau de la Roche-aux-Moines (Nicolas Joly) Tasting - Phanix's Blog on Nicolas Joly 與他的生物動力法哲學
  • 安裝非預設版號 certbot apache plugin / installing certbot apache plugin with non-default version number - Phanix's Blog on AWS Route53 Geo dns with letsencrypt

Archives

Tags

.net (29) 2008 (66) 2009 (91) Bordeaux (45) Bourgogne (36) c# (33) Cabernet Sauvignon (41) California (85) Chardonnay (46) dessert wine (26) food (53) France (57) France 法國 (68) French (28) japanese food (32) murmuring (25) photo-taking (46) photographing (48) php (41) Pinot Noir (52) programming (36) red wine (187) Santa Cruz (33) system administration (68) Taiwan (40) traveling (74) USA (125) white wine (119) wine (174) wine tasting (223) 加州 (64) 勃根地 (39) 台灣 (29) 品酒 (220) 攝影 (93) 旅遊 (60) 氣泡酒 (24) 法國 (31) 波爾多 (37) 甜酒 (28) 白酒 (115) 系統管理 (48) 紅酒 (184) 美國 (100) 義大利 (36)

Categories

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org

Phanix's Blog 2023 . Powered by WordPress