美文网首页
Git 初始化Repository操作

Git 初始化Repository操作

作者: Thresh0ld | 来源:发表于2016-07-26 09:48 被阅读180次

Command line instructions

Git global setup

git config --global user.name "UserName"
git config --global user.email "1234567890@qq.com"

Create a new repository

git clone http://gitlab.ddns.net/DrivingExam/DrivingExamApi.git
cd DrivingExamApi
touch README.md
git add README.md
git commit -m "add README"
git push -u origin master

Existing folder or Git repository

cd existing_folder
git init
git remote add orign http://gitlab.ddns.net/DrivingExam/DrivingExamApi.git
git add .
git commit
git push -u origin master

注意:如果项目是用在XCode上的,建议在GitHub上创建项目时不要勾选创建ReadMe.md和.gitignore 不然的话在XCode上无法初始化推送。

CreateNewRepository.png XCodeSourceControl.png AddRemote.png

当然,如果你嫌麻烦,完全可以按照下面的Git命令来操作。
以下是在GitHub上新建一个项目后GitHub提供的提示信息:

Quick setup — if you’ve done this kind of thing before
Set up in Desktop
or

HTTPS: https://github.com/wind0ws/HelloSwift.git

SSH: <git@github.com:wind0ws/HelloSwift.git>

We recommend every repository include a README, LICENSE, and .gitignore.

…or create a new repository on the command line

echo "# HelloSwift" >> README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/wind0ws/HelloSwift.git
git push -u origin master

…or push an existing repository from the command line

git remote add origin https://github.com/wind0ws/HelloSwift.git
git push -u origin master

…or import code from another repository
You can initialize this repository with code from a Subversion, Mercurial, or TFS project.
Import code


关注我的公众号.jpg

相关文章

  • git

    git基本操作 安装git 初始化仓库(repository) 提交更改到暂存区 提交更改到版本库 撤销更改 删除...

  • Git 初始化Repository操作

    Command line instructions Git global setup Create a new r...

  • git仓库基础(总)

    初始化git仓库 git init ///输出:Initialized empty Git repository ...

  • git实用命令

    git实用命令 1 git init 命令 初始化 git 仓库 repository 2 git add 命令 ...

  • git笔记

    git init初始化一个本地git仓库repository git status查看状态 git add

  • Git命令大全

    Add & Commit git init 初始化一个 Git 仓库(repository),即把当前所在目录变成...

  • Git(二)——repository仓库

    git init会初始化一个空的仓库(empty Git repository,同时在我们执行git init后会...

  • 常用的git命令整理

    git init 初始化一个 Git 仓库(repository),即把当前所在目录变成 Git 可以管理的仓库...

  • git操作与分支管理规范

    一、git操作规范 git操作流程数据流图 Remote:远程主仓库 Repository:本地仓库 Index:...

  • Git常用命令

    初始化 git init:初始化 状态查看操作 git status:查看工作区、暂存区状态 添加操作 git a...

网友评论

      本文标题:Git 初始化Repository操作

      本文链接:https://www.haomeiwen.com/subject/wfsnjttx.html