markdown 将远程克隆到现有本地

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了markdown 将远程克隆到现有本地相关的知识,希望对你有一定的参考价值。

Open Git CMD / Bash

1. First get to the existing directory  
  ```  
  > cd my/folder/
  ```
  or Hold SHIFT, right click the folder you're in, then select Open command window here.
  
2. Now start a new git repository  
  ```  
  > git init
  ```
  
3. Identify if the current elements on the directory are needed or not and add 
   them to the **.gitignore** file.  
    1. Create the text file gitignore.txt
    2. Open it in a text editor and add your rules, then save and close
    3. Hold SHIFT, right click the folder you're in, then select Open command window here
    4. Then rename the file in the command line, with `ren gitignore.txt .gitignore`
  
4. When ready create the first commit on the server
  ```
  > git add .
  > git commit -m "my first commit"
  ```
  
5. Now add the remote from where you want to clone  
  ```
  > git remote add origin https://github.com/sarpay/RoboAir.git
  ```
  
6. Now just pull and merge with local git  
  ```
  > git pull origin master
  ```
  
7. If you have some merge conflicts resolve them and commit your changes.

以上是关于markdown 将远程克隆到现有本地的主要内容,如果未能解决你的问题,请参考以下文章

markdown 将远程git仓库添加到现有本地项目

Git 基础 - 克隆远程仓库到本地,修改后推送到远程

一次性从git远程仓库中克隆到本地。

将本地现有目录连接到现有 Git 远程存储库

如何将本地文件push到github远程仓库中?

如何将本地文件push到github远程仓库中?