gll89的个人博客分享 http://blog.sciencenet.cn/u/gll89

博文

github-tutorial for beginners

已有 1836 次阅读 2017-7-6 10:48 |个人分类:Linux|系统分类:科研笔记

1. install (Ubuntu) git in local computer

   sudo apt-get install git

2. configuration

  • git config --global user.name "Your Name"

  • git config --global user.email "youremail@domain.com"

3.first clone repository  (useless)

   input the following command line in terminal

       git clone repository_name /path/to/localrepo/

4.upload files

Given you've set up a git daemon on <url> and an empty repository:

   I.cd <localdir>

   II.git init

   III.git add .

   IV.git commit -m 'message'

   V.git remote add origin <url>

   VI.git pull <url> master    

   VII.git push -u origin master

from : https://stackoverflow.com/questions/3311774/how-to-convert-existing-non-empty-directory-into-a-git-working-directory-and-pus


After the step VI, you may meet of problem of "merge branch....", the solution is :

I. ctrl+O : to save info.

II. ctrl+x : to exit


5. Common problem

Q1:  ! [rejected]        master -> master (non-fast-forward) error: failed to push some refs to 'https://github.com/gll89/AD_MCI_NC_classifier.git'

A1 :In this case the only change was the readme file created as optional step when creating github repository.

git pull https://github.com/*username*/*repository*.git master

from: https://stackoverflow.com/questions/11696295/rejected-master-master-non-fast-forward



       

 




https://blog.sciencenet.cn/blog-1969089-1064887.html

上一篇:learning material of Keras callback
下一篇:AD diagnosis
收藏 IP: 128.227.37.*| 热度|

0

该博文允许注册用户评论 请点击登录 评论 (0 个评论)

数据加载中...
扫一扫,分享此博文

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-5-19 12:40

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部