> For the complete documentation index, see [llms.txt](https://kawsing.gitbook.io/opensystem/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kawsing.gitbook.io/opensystem/github.md).

# gitHub

mkdir mypython

第一隻程式:hello.py

```python
# -*- coding: utf-8 -*-
#這是向世界打招呼
print("hello world")
```

### 使用github

#### Step 1: Create a local git repository&#x20;

cd mypython

```
git init
```

#### Step 2: Add a new file to the repo

```
mv ~/hello.py .
git status
```

![](/files/-LwW9eWnMrA5Fqg53zAG)

#### Step 3: Add a file to the staging environment

```
git add .
git status
On branch master

No commits yet

Changes to be committed:
  (use "git rm --cached <file>..." to unstage)

	new file:   hello.py
```

#### Step 4: Create a commit

```
git commit -m "This is my first python!"
*** 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.

```

```
git config --global user.email "kawsing@gmail.com"
git config --global user.name "kawsing"
```

#### Create a new repository on GitHub

![](/files/-LwWAVztz5aH8WoCCLSZ)

#### push an existing repository from the command line

```
git remote add origin https://github.com/kawsing/mypython.git
git push -u origin master
```

![](/files/-LwWAeZvrAd2-GADNn7U)

![](/files/-LwWAj-AsNgzr2Pb1QeU)
