zoukankan      html  css  js  c++  java
  • 上传本地代码到github&&从github下载源码

    最近在玩github,下面简单介绍下githup的使用

    将本地代码同步到github.

    使用Git GUI同步 

    1,先下载git,然后安装。右键如图所示。

    2,在github里新建一个 repository。

    复制地址待用:https://github.com/yaoxing365/spring-mvc-study

    3,启动git GUI,新建一个repository,选择目录为你要上传到github的项目根目录。

    如下;

    4,建立远程repository映射。如下:

    5,commit代码,之前可以rescan下

    6.push代码到github。选择之前建立的repository。

    最后出现成功提示,刷新github页面就能看到提交的代码了。

    使用Git Bash同步

     也可以使用以下命令提交:

    1,当前项目目录:git clone https://github.com/************.git  #(https://github.com/************.git替换成你之前复制的地址)
    这个步骤以后你的本地项目文件夹下面就会多出个文件夹,该文件夹名即为你github上面的项目名,吧这个新增目录下的文件copy到本地项目目录下,并删除这个新增目录。

    2,
    当前项目目录:git add .

    3,当前项目目录:git commit
    -m “初始化代码”

    4,当前项目目录:git push origin master

    下面介绍下从github下载源码

     首先在项目目录右键,选择git bash here(选择git gui here 也可以),打开提示行并输入用户名和邮箱:

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

    然后输入以下命令来初始化:

      git init
    
      git remote add origin https://github.com/yaoxing365/online-message-dev.git

    然后就克隆项目到本地:

    git clone https://github.com/yaoxing365/online-message-dev.git

    更新项目:

    git pull origin master 

     附:

    git 代理设置:

    C:Users用户  下的.gitconfig文件末尾添加如下内容:

    [http]

      proxy = http://www.proxy.com:8080/

    参考:博客园 git bash

  • 相关阅读:
    [quote] Rough Notes on Linux Networking Stack
    All my miscellaneous assembly
    chrome浏览器屏幕网页内嵌的flash广告?
    [quote] How to determine what target is given in Makefile from the make command-line?
    [quote] colour your linux command line
    python 3 函数
    python 2 控制流
    薛定谔的猫 转载
    using distance to keep track of the min in a stack
    Java String
  • 原文地址:https://www.cnblogs.com/hoaprox/p/5566756.html
Copyright © 2011-2022 走看看