Skip to content

Note

不挑戰記憶力的技術筆記

Menu
Menu

>[Git]初體驗

Posted on 2011 年 3 月 30 日 by febr

>準備工作:
1.於github申請帳號
2.Download git&install

建立一Repository:
Dashboardn → Create a Repository

產生SSH key:
開啟Git Bash,
輸入:(引號內為註冊mail帳號)
$ ssh-keygen -t rsa -C “yourmail@mail”

Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/yourUserName/.ssh/id_rsa):

修改安裝Git的路徑,照括號內輸入

Enter passphrase (empty for no passphrase):
Enter same passphrase again:

不必輸入,直接Enter,之後顯示生成一組key,
在 /.ssh 內會有兩個檔案,一個為private,另一個為public key,
將public key複製貼到github上儲存,輸入title以示區別。
(Account settings > SSH public keys)

設定使用者名稱與mail:
$  git config –global user.name “yourUserName”
$  git config –global user.mail “yourmail@mail.com”

設定utf-8:
初始化資料夾後,點開GUI,Option > 將 Global(All Repositories)內的Default File Contents Encoding改為utf-8

從github複製到電腦上:
$ git clone git@github.com:user_name/Repository_name.git

新增檔案(以下為所有檔案):
$ git add .

建立改變紀錄:
$git commit -m ‘first’

維護遠端檔案:
$ git remote add origin git@github.com:yourUserName/test.git

上傳:
$ git push origin master



若下維護遠端檔案的指令出現:

fatal: remote origin already exists.
使用以下指令刪除再重新執行指令即可:
$ git remote rm origin

發佈留言 取消回覆

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *

近期文章

  • [AWS] S3 Object Initiate restore (復原回 Standard)
  • [Windows] 使用者快速登出的方法 Logout/ Logoff/Sign Out from Windows User Account
  • [Windows] Windows 11 安裝Server管理工具Install RSAT(Remote Server Administrator Tools)
  • Chrome出現:你的連線不是私人連線 Your connection is not private
  • [C#] 取得 Request URL 的方法

近期留言

    彙整

    分類

    • Ajax
    • Android
    • ASP
    • ASP.NET MVC
    • Azure
    • C#
    • Cisco
    • CSS
    • Delphi
    • Developer Tools
    • Framework
    • FreeBSD
    • Git
    • HTML5
    • javascript
    • jQuery
    • Juniper
    • Linux
    • Mac
    • PHP
    • Python
    • Server&OS
    • Software
    • SQL server
    • Sublime Text
    • Ubuntu
    • Visual Studio
    • Vmware
    • Web Design
    • Web Development
    • Windows
    • WordPress
    • 未分類
    • 未分類

    彙整

    分類

    • Ajax
    • Android
    • ASP
    • ASP.NET MVC
    • Azure
    • C#
    • Cisco
    • CSS
    • Delphi
    • Developer Tools
    • Framework
    • FreeBSD
    • Git
    • HTML5
    • javascript
    • jQuery
    • Juniper
    • Linux
    • Mac
    • PHP
    • Python
    • Server&OS
    • Software
    • SQL server
    • Sublime Text
    • Ubuntu
    • Visual Studio
    • Vmware
    • Web Design
    • Web Development
    • Windows
    • WordPress
    • 未分類
    • 未分類

    其他操作

    • 登入
    • 訂閱網站內容的資訊提供
    • 訂閱留言的資訊提供
    • WordPress.org 台灣繁體中文
    © 2025 Note | Powered by Superbs Personal Blog theme