zoukankan      html  css  js  c++  java
  • Git and Xcode

      1、web site "New Repository"

      2、为本地 git 管理的项目添加 Repository

    $ cd ~/ProjectName
    $ git remote add origin https://github.com/userName/xxx.git $ git push -u origin master  # 第一次提交需要 -u,以后执行提交可以简化不再需要 -u。(原因:第一次提交不但会把本地的 master 分支内容推送到远程新的 master 分支,还会把本地的 master 分支和远程的 master 分支关联起来。)

      3、为非本地 git 管理的项目添加 Repository

    $ cd ~/Project
    $ git init    # 初始化,并在当前目录下出现一个名为 .git的目录
    
    # 注意:如果某些文件没有必要提交的,请先创建 .ignore 文件,否则对 已经被跟踪或者 commit 的文件再放进 .gitignore 会失效。
    
    $ git add .    # 将给目录下所有不包含在 .ignore 的文件提交
    $ git commit -m "Initial commit"
    # reopen xcode, Source Control was enable

    # 执行第二步 "为本地 git 管理的项目添加 Repository"
    # create Repository and copy repository address, Xcode.Preferance.Accounts add repository

        关于 .ignore 请参考 ref

      4、Xcode project 在创建的时候,就勾选上使用本地 git 管理。

        也需要执行第二步 “为本地 git 管理的项目添加 Repository”,以后才能在 Xcode -> Source Control -> push。

      5、拷贝他人的 git project

    $ git clone repository address
  • 相关阅读:
    css如何设置div中的内容垂直居中?
    有哪些sql优化工具
    XSS攻击
    java的HashSet 原理
    复杂度O(n)计算
    Kubernetes(K8s)基础知识(docker容器技术)
    Golang glog使用详解
    教你如何找到Go内存泄露【精编实战】
    Linux生产环境上,最常用的一套“AWK“技巧【转】
    Go 程序的性能监控与分析 pprof
  • 原文地址:https://www.cnblogs.com/eileenleung/p/3493210.html
Copyright © 2011-2022 走看看