git-4_新建repo并添加到远程server

testgit@linux-0m25:[/local/workspace/testgit]$ mkdir testGit
testgit@linux-0m25:[/local/workspace/testgit]$ cd testGit/
testgit@linux-0m25:[/local/workspace/testgit/testGit]$ vi a.c
testgit@linux-0m25:[/local/workspace/testgit/testGit]$ git init
Initialized empty Git repository in /local/workspace/testgit/testGit/.git/
testgit@linux-0m25:[/local/workspace/testgit/testGit]$ git add a.c
testgit@linux-0m25:[/local/workspace/testgit/testGit]$ git commit
[master (root-commit) 5baa64b] add empty file
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 a.c
testgit@linux-0m25:[/local/workspace/testgit/testGit](master)$ git st
On branch master
nothing to commit, working directory clean
testgit@linux-0m25:[/local/workspace/testgit/testGit](master)$ git  remote  add  origin  git://github.com/someone/another_project.git

猜你喜欢

转载自blog.csdn.net/zhanghuanhuanzhh/article/details/88660477