Github

Git版本管理

簡介

安裝

命令

GitHub

GoogleCode

TortoiseGit

訊息

相關網站

參考文獻

最新修改

簡體版

English

mathnode 專案的上傳過程

首先進入 GitHub 按右上角「+」號的圖示,建立一個專案稱為 mathnode。

然後用下列指令。

Create a new repository on the command line

touch README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/ccckmit/mathnode.git
git push -u origin master

Push an existing repository from the command line

git remote add origin https://github.com/ccckmit/mathnode.git
git push -u origin master

我的操作過程

經過一堆錯誤亂試之後,終於將 mathnode 上傳到 GitHub 上了。

MathNode 的 github 網址如下: https://github.com/ccckmit/mathnode

D:\git\mathnode>git init
Reinitialized existing Git repository in D:/git/mathnode/.git/

D:\git\mathnode>git add -a
error: unknown switch `a'
usage: git add [options] [--] <filepattern>...

    -n, --dry-run         dry run
    -v, --verbose         be verbose

    -i, --interactive     interactive picking
    -p, --patch           select hunks interactively
    -e, --edit            edit current diff and apply
    -f, --force           allow adding otherwise ignored files
    -u, --update          update tracked files
    -N, --intent-to-add   record only the fact that the path will be added later

    -A, --all             add changes from all tracked and untracked files
    --refresh             don't add, only refresh the index
    --ignore-errors       just skip files which cannot be added because of error
s
    --ignore-missing      check if - even missing - files are ignored in dry run

D:\git\mathnode>git add -all
error: did you mean `--all` (with two dashes ?)

D:\git\mathnode>git add --all

D:\git\mathnode>git add README.md

D:\git\mathnode>dir
 磁碟區 D 中的磁碟沒有標籤。
 磁碟區序號:  4E2D-AA0B

 D:\git\mathnode 的目錄

2012/08/05  上午 09:45    <DIR>          .
2012/08/05  上午 09:45    <DIR>          ..
2012/08/05  上午 10:02               467 mathnode.js
2012/08/05  上午 09:47            82,117 jstat_ccc.js
2012/08/05  上午 09:47           131,004 numeric.js
2012/08/04  下午 04:41            10,554 numeric_test.js
2012/08/05  下午 02:00               390 README.md
               5 個檔案         224,532 位元組
               2 個目錄  364,544,557,056 位元組可用

D:\git\mathnode>git add jstat_ccc.md
fatal: pathspec 'jstat_ccc.md' did not match any files

D:\git\mathnode>git add jstat_ccc.js

D:\git\mathnode>git commit -m "first commit"

*** Please tell me who you are.

Run

  git config --global user.email "you@example.com"
  git config --global user.name "Your Name"

to set your account's default identity.
Omit --global to set the identity only in this repository.

fatal: unable to auto-detect email address (got 'Guest@ccc-PC.(none)')

D:\git\mathnode>git config --global user.eamil "ccckmit@gmail.com"

D:\git\mathnode>git commit -m "first commit"

*** Please tell me who you are.

Run

  git config --global user.email "you@example.com"
  git config --global user.name "Your Name"

to set your account's default identity.
Omit --global to set the identity only in this repository.

fatal: unable to auto-detect email address (got 'Guest@ccc-PC.(none)')

D:\git\mathnode>git config --global user.name "ccckmit"

D:\git\mathnode>git commit -m "first commit"

*** Please tell me who you are.

Run

  git config --global user.email "you@example.com"
  git config --global user.name "Your Name"

to set your account's default identity.
Omit --global to set the identity only in this repository.

fatal: unable to auto-detect email address (got 'Guest@ccc-PC.(none)')

D:\git\mathnode>git commit -m "first commit"

*** Please tell me who you are.

Run

  git config --global user.email "you@example.com"
  git config --global user.name "Your Name"

to set your account's default identity.
Omit --global to set the identity only in this repository.

fatal: unable to auto-detect email address (got 'Guest@ccc-PC.(none)')

D:\git\mathnode>git remote add origin https://github.com/ccckmit/mathnode.git

D:\git\mathnode>git push -u orinin master
fatal: 'orinin' does not appear to be a git repository
fatal: The remote end hung up unexpectedly

D:\git\mathnode>git push -u origin master
Username for 'https://github.com': ccckmit
Password for 'https://ccckmit@github.com':
error: src refspec master does not match any.
error: failed to push some refs to 'https://github.com/ccckmit/mathnode.git'

D:\git\mathnode>git push -u origin master
Username for 'https://github.com': ccckmit
Password for 'https://ccckmit@github.com':
error: src refspec master does not match any.
error: failed to push some refs to 'https://github.com/ccckmit/mathnode.git'

D:\git\mathnode>git push -u origin master
Username for 'https://github.com': ccckmit
Password for 'https://ccckmit@github.com':
error: src refspec master does not match any.
error: failed to push some refs to 'https://github.com/ccckmit/mathnode.git'

D:\git\mathnode>git remote add origin https://github.com/ccckmit/mathnode.git
fatal: remote origin already exists.

D:\git\mathnode>git
usage: git [--version] [--exec-path[=<path>]] [--html-path] [--man-path] [--info
-path]
           [-p|--paginate|--no-pager] [--no-replace-objects] [--bare]
           [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
           [-c name=value] [--help]
           <command> [<args>]

The most commonly used git commands are:
   add        Add file contents to the index
   bisect     Find by binary search the change that introduced a bug
   branch     List, create, or delete branches
   checkout   Checkout a branch or paths to the working tree
   clone      Clone a repository into a new directory
   commit     Record changes to the repository
   diff       Show changes between commits, commit and working tree, etc
   fetch      Download objects and refs from another repository
   grep       Print lines matching a pattern
   init       Create an empty git repository or reinitialize an existing one
   log        Show commit logs
   merge      Join two or more development histories together
   mv         Move or rename a file, a directory, or a symlink
   pull       Fetch from and merge with another repository or a local branch
   push       Update remote refs along with associated objects
   rebase     Forward-port local commits to the updated upstream head
   reset      Reset current HEAD to the specified state
   rm         Remove files from the working tree and from the index
   show       Show various types of objects
   status     Show the working tree status
   tag        Create, list, delete or verify a tag object signed with GPG

See 'git help <command>' for more information on a specific command.

D:\git\mathnode>git log
fatal: bad default revision 'HEAD'

D:\git\mathnode>git-init-db
'git-init-db' 不是內部或外部命令、可執行的程式或批次檔。

D:\git\mathnode>git init
Reinitialized existing Git repository in D:/git/mathnode/.git/

D:\git\mathnode>git add .

D:\git\mathnode>git commit

*** Please tell me who you are.

Run

  git config --global user.email "you@example.com"
  git config --global user.name "Your Name"

to set your account's default identity.
Omit --global to set the identity only in this repository.

fatal: unable to auto-detect email address (got 'Guest@ccc-PC.(none)')

D:\git\mathnode>git config --global user.name "ccckmit"

D:\git\mathnode>git config --global user.email "ccckmit@gmail.com"

D:\git\mathnode>git commit
[master (root-commit) 2213c1f] MathNode Created at 20120805 by ccckmit
warning: LF will be replaced by CRLF in jstat_ccc.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in mathnode.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in numeric.js.
The file will have its original line endings in your working directory.
 5 files changed, 7000 insertions(+)
 create mode 100644 README.md
 create mode 100644 jstat_ccc.js
 create mode 100644 mathnode.js
 create mode 100644 numeric.js
 create mode 100644 numeric_test.js

D:\git\mathnode>git diff -cached
error: invalid option: -cached

D:\git\mathnode>git diff --cached

D:\git\mathnode>git --diff
Unknown option: --diff
usage: git [--version] [--exec-path[=<path>]] [--html-path] [--man-path] [--info
-path]
           [-p|--paginate|--no-pager] [--no-replace-objects] [--bare]
           [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
           [-c name=value] [--help]
           <command> [<args>]

D:\git\mathnode>git diff

D:\git\mathnode>git commit
# On branch master
nothing to commit (working directory clean)

D:\git\mathnode>git log
commit 2213c1f265cddaafbebdf35b60a70152c3826327
Author: ccckmit <ccckmit@gmail.com>
Date:   Sun Aug 5 14:20:48 2012 +0800

    MathNode Created at 20120805 by ccckmit

D:\git\mathnode>git branch master
fatal: A branch named 'master' already exists.

D:\git\mathnode>git branch ccctest

D:\git\mathnode>git branch
  ccctest
* master

D:\git\mathnode>git commit -m "ccctest"
# On branch master
nothing to commit (working directory clean)

D:\git\mathnode>git remote add origin https://github.com/ccckmit/mathnode.git
fatal: remote origin already exists.

D:\git\mathnode>git push -u origin master
Username for 'https://github.com': cccàS
Password for 'https://cccàS@github.com':
fatal: Authentication failed
^C
D:\git\mathnode>git push -u origin master
Username for 'https://github.com': ccckmit
Password for 'https://ccckmit@github.com':
Counting objects: 7, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (7/7), done.
Writing objects: 100% (7/7), 56.56 KiB, done.
Total 7 (delta 0), reused 0 (delta 0)
To https://github.com/ccckmit/mathnode.git
 * [new branch]      master -> master
Branch master set up to track remote branch master from origin.

D:\git\mathnode>

Facebook

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License