Skip to content

Zeroplex 生活隨筆

軟體開發、伺服器和生活瑣事

小 縮小字型大小。 中 重設字型大小。 大 放大字型大小。

標籤: Git

整理 git local / remote branch

Posted on 2015 年 4 月 25 日2021 年 3 月 12 日 By 日落 在〈整理 git local / remote branch〉中尚無留言

先列出所有的 branch:

$ git branch -a
* api
  cleanCode
  dev
  master
  remotes/github/api
  remotes/github/dev
  remotes/github/master
  remotes/github/pub/anime
  remotes/github/pub/dev
  remotes/github/pub/lock

已知其中 “pub/*” 開頭的 branch 其實已經都不存在了,這時候如果刪除 remote branch 會出現錯誤訊息:

$ git push github :pub/lock
error: unable to delete 'pub/lock': remote ref does not exist
error: failed to push some refs to 'git@github.com:johnroyer/aniTrace-fuel.git'

表示 local container 已經和 remote 資料有差異了。

這時候可以用 prune 指令,讓 git 同步 local 和 remote 的資料:

git remote prune github

執行後,若 remote 已經刪除的 branch,也不會在 git branch -a 時顯示了。

Tags:Git

Git 學習資源

Posted on 2012 年 10 月 18 日2021 年 3 月 12 日 By 日落 在〈Git 學習資源〉中有 1 則留言

一些覺得不錯的投影片、教學和工具。

寫給大家的 Git 教學 by 小 B

寫給大家的 Git 教學 from littlebtc

Git Tutorial by ihower

Git Tutorial 教學 from Wen-Tien Chang

Github 推出了互動教學 tryGit,可以邊看說明邊操作。
http://try.github.com

Tags:Git

gitignore @ github

Posted on 2012 年 5 月 26 日2021 年 3 月 12 日 By 日落 在〈gitignore @ github〉中有 2 則留言

用 CodeIgniter 當 framework 時,搞不清楚 .gitignore 要怎麼寫比較好。

後來才知道 Github 上面有個 gitignore 專案,已經整理了不少預設設定檔供參考,從 C/C++、Java、Objective-C 到常用的程式架構如 Android、CodeIgniter、CakePHP、Wordpress 等,直接複製貼上就可以用了,非常方便。

github/gitignore
https://github.com/github/gitignore

Tags:Git, 程式設計

刪除 github 上的 branch

Posted on 2011 年 9 月 8 日2021 年 3 月 12 日 By 日落 在〈刪除 github 上的 branch〉中尚無留言

每次都找很久每次都忘記。

git push origin :branchToDelete

參考資料:http://originblog.wordpress.com/2008/04/28/github-tips-removing-a-remote-branch/

Tags:Git

Delete a branch on Github

Posted on 2011 年 5 月 7 日2021 年 3 月 12 日 By 日落 在〈Delete a branch on Github〉中尚無留言

Take “NAME” as the branch we want to delete:

git push origin :NAME

Ref: Github Cheat Sheet
http://help.github.com/git-cheat-sheets/

Tags:Git

文章分頁

上一頁 1 2 3 下一頁

其他

關於我  (About me)

小額贊助

  文章 RSS Feed

  留言 RSS Feed

Apache AWS Bash C/C++ Docker FreeBSD GCP Git Google Java JavaScript Laravel Linux Microsoft MSSQL MySQL Nginx PHP PHPUnit PostgreSQL Python Qt Ubuntu Unix Vim Web Windows WordPress XD 作業系統 分享 好站推薦 專題 攝影 新奇搞笑 新聞 旅遊 生活雜記 程式設計 網路架站 網頁設計 資訊學習 資訊安全 遊戲 音樂


創用 CC 授權條款
本著作係採用創用 CC 姓名標示-相同方式分享 4.0 國際 授權條款授權.