Gogs 创建新的仓库并提交代码
- 1. 登录
- 2. 仓库 -> 我的仓库
- 3. + 创建新的仓库
- 4. 仓库
- 5. Copy
- 6. 公开代码
- 7. 提交成功 Gogs - git
- References
Gogs 是一款极易搭建的自助 Git 服务。
1. 登录
2. 仓库 -> 我的仓库
3. + 创建新的仓库
4. 仓库
5. Copy
6. 公开代码
strong@foreverstrong:~/gogsgit_work$ pwd
/home/strong/gogsgit_work
strong@foreverstrong:~/gogsgit_work$
strong@foreverstrong:~/gogsgit_work$ git clone http://******/PyTorch-Examples.git
Cloning into 'PyTorch-Examples'...
remote: Counting objects: 5, done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 5 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (5/5), done.
Checking connectivity... done.
strong@foreverstrong:~/gogsgit_work$ ls
PyTorch-Examples
strong@foreverstrong:~/gogsgit_work$ cd PyTorch-Examples/
strong@foreverstrong:~/gogsgit_work/PyTorch-Examples$ ls
LICENSE README.md
strong@foreverstrong:~/gogsgit_work/PyTorch-Examples$
strong@foreverstrong:~/gogsgit_work/PyTorch-Examples$ ls
foreverstrong.txt LICENSE README.md
strong@foreverstrong:~/gogsgit_work/PyTorch-Examples$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
Untracked files:
(use "git add <file>..." to include in what will be committed)
foreverstrong.txt
nothing added to commit but untracked files present (use "git add" to track)
strong@foreverstrong:~/gogsgit_work/PyTorch-Examples$
strong@foreverstrong:~/gogsgit_work/PyTorch-Examples$ git branch
* master
strong@foreverstrong:~/gogsgit_work/PyTorch-Examples$
strong@foreverstrong:~/gogsgit_work/PyTorch-Examples$ git add .
strong@foreverstrong:~/gogsgit_work/PyTorch-Examples$
strong@foreverstrong:~/gogsgit_work/PyTorch-Examples$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
new file: foreverstrong.txt
strong@foreverstrong:~/gogsgit_work/PyTorch-Examples$
strong@foreverstrong:~/gogsgit_work/PyTorch-Examples$ git commit -m "Hello World!"
[master 9c02bff] Hello World!
1 file changed, 2 insertions(+)
create mode 100644 foreverstrong.txt
strong@foreverstrong:~/gogsgit_work/PyTorch-Examples$ ls
foreverstrong.txt LICENSE README.md
strong@foreverstrong:~/gogsgit_work/PyTorch-Examples$ git status
On branch master
Your branch is ahead of 'origin/master' by 1 commit.
(use "git push" to publish your local commits)
nothing to commit, working directory clean
strong@foreverstrong:~/gogsgit_work/PyTorch-Examples$
strong@foreverstrong:~/gogsgit_work/PyTorch-Examples$ git log
commit 9c02bff5ff1cb5224c384ccd1bf63585c3a9f365
Author: chengyq116 <chengyq116@163.com>
Date: Tue Jun 26 20:52:14 2018 +0800
Hello World!
commit a8474765709505de1ce0ffe7fff58e91e1ebd9ab
Author: chengyq116 <chengyq116@163.com>
Date: Tue Jun 26 12:05:28 2018 +0000
Initial commit
strong@foreverstrong:~/gogsgit_work/PyTorch-Examples$ git push
warning: push.default is unset; its implicit value has changed in
Git 2.0 from 'matching' to 'simple'. To squelch this message
and maintain the traditional behavior, use:
git config --global push.default matching
To squelch this message and adopt the new behavior now, use:
git config --global push.default simple
When push.default is set to 'matching', git will push local branches
to the remote branches that already exist with the same name.
Since Git 2.0, Git defaults to the more conservative 'simple'
behavior, which only pushes the current branch to the corresponding
remote branch that 'git pull' uses to update the current branch.
See 'git help config' and search for 'push.default' for further information.
(the 'simple' mode was introduced in Git 1.7.11. Use the similar mode
'current' instead of 'simple' if you sometimes use older versions of Git)
Counting objects: 3, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 307 bytes | 0 bytes/s, done.
Total 3 (delta 1), reused 0 (delta 0)
Username for 'http://******': ******@163.com
Password for 'http://******':
To http://******/PyTorch-Examples.git
a847476..9c02bff master -> master
strong@foreverstrong:~/gogsgit_work/PyTorch-Examples$
strong@foreverstrong:~/gogsgit_work/PyTorch-Examples$ git log
commit 9c02bff5ff1cb5224c384ccd1bf63585c3a9f365
Author: chengyq116 <chengyq116@163.com>
Date: Tue Jun 26 20:52:14 2018 +0800
Hello World!
commit a8474765709505de1ce0ffe7fff58e91e1ebd9ab
Author: chengyq116 <chengyq116@163.com>
Date: Tue Jun 26 12:05:28 2018 +0000
Initial commit
strong@foreverstrong:~/gogsgit_work/PyTorch-Examples$
7. 提交成功 Gogs - git
References
[1] Yongqiang Cheng, https://yongqiang.blog.csdn.net/