zoukankan      html  css  js  c++  java
  • xcode-git笔记

    git init
    git add .
    vi .gitignore /*将代码区蓝色字体的内容*/
    git commit -m "初次建立"
    git remote add origin https://github.com/User/Qioa1.git
    git push -u origin master
    git push -u origin --all


    #.gitignore中的内容
    # Xcode
    */build/*
    *.pbxuser
    !default.pbxuser
    *.mode1v3
    !default.mode1v3
    *.mode2v3
    !default.mode2v3
    *.perspectivev3
    !default.perspectivev3
    !default.xcworkspace
    xcuserdata
    profile
    *.moved-aside
    .DS_Store
    *.svn/
    *.idea/


    1.删除仓库中跟踪的UserInterfaceState.xcuserstate
    git rm --cached /Users/kyo/Documents/IOS Development/protect/Git/JuMi/JuMi.xcodeproj/project.xcworkspace/xcuserdata/kyo.xcuserdatad/UserInterfaceState.xcuserstate
    git commit -m "Removed file that shouldn't be tracked"
    git push

    find . -name .DS_Store -print0 | xargs -0 git rm -f --ignore-unmatch


    原文地址:http://www.xuebuyuan.com/1933454.html

    git本地有修改如何强制更新
    本地有修改和提交,如何强制用远程的库更新更新。我尝试过用git pull -f,总是提示 You have not concluded your merge. (MERGE_HEAD exists)。

    我需要放弃本地的修改,用远程的库的内容就可以,应该如何做?傻傻地办法就是用心的目录重新clone一个,正确的做法是什么?

    正确的做法应该是:

    git fetch --all
    git reset --hard origin/master
    git fetch 只是下载远程的库的内容,不做任何的合并git reset 把HEAD指向刚刚下载的最新的版本

    参考链接:

    http://stackoverflow.com/questions/1125968/force-git-to-overwrite-local-files-on-pull

  • 相关阅读:
    人月神话阅读笔记之一
    第一阶段冲刺站立会议报告——9
    第一阶段冲刺站立会议报告——8
    第一阶段冲刺站立会议报告——7
    第一阶段冲刺站立会议报告——6
    第一阶段冲刺站立会议报告——5
    第二阶段冲刺第一天
    寻找水王2
    构建之法阅读笔记05
    第十二周学习进度条
  • 原文地址:https://www.cnblogs.com/yanlixin/p/4249116.html
Copyright © 2011-2022 走看看