- 浏览: 2552938 次
- 性别:
- 来自: 成都
文章分类
最新评论
-
nation:
你好,在部署Mesos+Spark的运行环境时,出现一个现象, ...
Spark(4)Deal with Mesos -
sillycat:
AMAZON Relatedhttps://www.godad ...
AMAZON API Gateway(2)Client Side SSL with NGINX -
sillycat:
sudo usermod -aG docker ec2-use ...
Docker and VirtualBox(1)Set up Shared Disk for Virtual Box -
sillycat:
Every Half an Hour30 * * * * /u ...
Build Home NAS(3)Data Redundancy -
sillycat:
3 List the Cron Job I Have>c ...
Build Home NAS(3)Data Redundancy
github(2)Github Basics and Remote Repositories
Chapter 1 Getting Started
1.1. About Version Control
Local Version Control
----> Centralized Version Control System(CVCS, CVS, Subversion, Perforce)
----> Distributed Version Control System (DVCS, Git, Mercurial, Bazaar, Darcs)
1.2. Git Basic
Git does not care about the file differences, but saves all snapshot of all the files.
3 Status of the files
committed ----> modified ---> staged(it is in the commit list)
3 working area
Working directory ----> Staging area -----> git directory(repository)
1.3. Windows Install
http://code.google.com/p/msysgit
>git --version
git version 1.7.9.msysgit.0
user information
>git config --global user.name luohuazju
>git config --global user.email luohuazju@gmail.com
check the configuration file
>git config --list
getting help
>git help <verb>
Chapter 2 Git Basics
2.1 Getting a Git Repository
Initializing a Repository in an Existing Directory
Go to the project's directory and type
>git init
This creates a new subdirectory named .git that contains all of your necessary repository files.
>git add readme.txt
>git commit -m "create repository"
After this, we have a git repository with tracked files.
>git remote add origin git@github.com:luohuazju/magic.git
>git push -u origin master
error message:
Permission denied (publickey).
fatal: The remote end hung up unexpectedly
Cloning an Existing Repository
>git clone git://github.com/luohuazju/cat.git
or
>git clone git://github.com/luohuazju/cat.git cat
2.2 Recording Changes to the Repository
Checking the Status of Your Files
>git status
Tracking New Files
>git add filename
Staging Modified Files
>git add filename
Ignoring Files
>vi .gitignore
*.[oa] #ignore the files .o or .a
!lib.a #do track lib.a, even though you are ignoring .a files above
build/ #ignore all files in the build/ directory
doc/*.txt #
Viewing Your Staged and Unstaged Changes
Committing Your Changes
>git commit
or
>git commit -m "message"
Removing Files
>git rm filename
Moving Files
>git mv file_from file_to
2.3 Viewing the Commit History
Simple command
>git log
Using a GUI to Visualize History
2.4 Undoing Things
Unstaging a Staged File
>git reset HEAD t2.txt
Unmodifying a Modified File
>git checkout -- filename
2.5. Working with Remotes
You can have several remote servers. You can pushing and pulling data to and from remote repositories when you need to share work.
Showing Your Remotes
>git remote
It lists the shortnames of each remote handle.
>git remote -v
origin git://github.com/luohuazju/cat.git (fetch)
origin git://github.com/luohuazju/cat.git (push)
Adding Remote Repositories
>git remote
>git remote add origin git://github.com/luohuazju/magic.git
>git remote -v
origin git://github.com/luohuazju/magic.git (fetch)
origin git://github.com/luohuazju/magic.git (push)
>git fetch origin
Pushing to Your Remotes
>git push [remote-name] [branch-name]
>git push origin master
There are some error message, so I change the remote like this.
>git remote add origin git@github.com:luohuazju/magic.git
>git push -u origin master
Permission denied (publickey).
fatal: The remote end hung up unexpectedly
solution:
Set Up SSH Keys
step1: open Git Bash
>cd ~/.ssh
step2: I already have this directory. Backup and remove existing SSH Keys.
>mkdir key_backup
>cp known_hosts key_backup/
>rm known_hosts
step3: Generate a new SSH key.
>ssh-keygen -t rsa -C "luohuazju@gmail.com"
>start.
I open the directory on win7 and get the key file id_rsa.pub.
step4:Add my SSH Key to GitHub
Account Setting--->SSH Keys ----> Add New SSH key
step5: Test everything out
>ssh -T git@github.com
Everything works fine now.
Inspecting a Remote
>git remote show [remote-name]
Removing and Renaming Remotes
>git remote rename first_name second_name
>git remote rm remote_name
references:
http://progit.org/book/zh/
http://progit.org/book/ch2-1.html
http://progit.org/book/ch2-5.html
http://sillycat.iteye.com/blog/1323263
http://sillycat.iteye.com/blog/1131274
http://sillycat.iteye.com/blog/1074171
http://sillycat.iteye.com/blog/689970
http://help.github.com/ssh-issues/
http://help.github.com/linux-set-up-git/
http://help.github.com/win-set-up-git/
Chapter 1 Getting Started
1.1. About Version Control
Local Version Control
----> Centralized Version Control System(CVCS, CVS, Subversion, Perforce)
----> Distributed Version Control System (DVCS, Git, Mercurial, Bazaar, Darcs)
1.2. Git Basic
Git does not care about the file differences, but saves all snapshot of all the files.
3 Status of the files
committed ----> modified ---> staged(it is in the commit list)
3 working area
Working directory ----> Staging area -----> git directory(repository)
1.3. Windows Install
http://code.google.com/p/msysgit
>git --version
git version 1.7.9.msysgit.0
user information
>git config --global user.name luohuazju
>git config --global user.email luohuazju@gmail.com
check the configuration file
>git config --list
getting help
>git help <verb>
Chapter 2 Git Basics
2.1 Getting a Git Repository
Initializing a Repository in an Existing Directory
Go to the project's directory and type
>git init
This creates a new subdirectory named .git that contains all of your necessary repository files.
>git add readme.txt
>git commit -m "create repository"
After this, we have a git repository with tracked files.
>git remote add origin git@github.com:luohuazju/magic.git
>git push -u origin master
error message:
Permission denied (publickey).
fatal: The remote end hung up unexpectedly
Cloning an Existing Repository
>git clone git://github.com/luohuazju/cat.git
or
>git clone git://github.com/luohuazju/cat.git cat
2.2 Recording Changes to the Repository
Checking the Status of Your Files
>git status
Tracking New Files
>git add filename
Staging Modified Files
>git add filename
Ignoring Files
>vi .gitignore
*.[oa] #ignore the files .o or .a
!lib.a #do track lib.a, even though you are ignoring .a files above
build/ #ignore all files in the build/ directory
doc/*.txt #
Viewing Your Staged and Unstaged Changes
Committing Your Changes
>git commit
or
>git commit -m "message"
Removing Files
>git rm filename
Moving Files
>git mv file_from file_to
2.3 Viewing the Commit History
Simple command
>git log
Using a GUI to Visualize History
2.4 Undoing Things
Unstaging a Staged File
>git reset HEAD t2.txt
Unmodifying a Modified File
>git checkout -- filename
2.5. Working with Remotes
You can have several remote servers. You can pushing and pulling data to and from remote repositories when you need to share work.
Showing Your Remotes
>git remote
It lists the shortnames of each remote handle.
>git remote -v
origin git://github.com/luohuazju/cat.git (fetch)
origin git://github.com/luohuazju/cat.git (push)
Adding Remote Repositories
>git remote
>git remote add origin git://github.com/luohuazju/magic.git
>git remote -v
origin git://github.com/luohuazju/magic.git (fetch)
origin git://github.com/luohuazju/magic.git (push)
>git fetch origin
Pushing to Your Remotes
>git push [remote-name] [branch-name]
>git push origin master
There are some error message, so I change the remote like this.
>git remote add origin git@github.com:luohuazju/magic.git
>git push -u origin master
Permission denied (publickey).
fatal: The remote end hung up unexpectedly
solution:
Set Up SSH Keys
step1: open Git Bash
>cd ~/.ssh
step2: I already have this directory. Backup and remove existing SSH Keys.
>mkdir key_backup
>cp known_hosts key_backup/
>rm known_hosts
step3: Generate a new SSH key.
>ssh-keygen -t rsa -C "luohuazju@gmail.com"
>start.
I open the directory on win7 and get the key file id_rsa.pub.
step4:Add my SSH Key to GitHub
Account Setting--->SSH Keys ----> Add New SSH key
step5: Test everything out
>ssh -T git@github.com
Everything works fine now.
Inspecting a Remote
>git remote show [remote-name]
Removing and Renaming Remotes
>git remote rename first_name second_name
>git remote rm remote_name
references:
http://progit.org/book/zh/
http://progit.org/book/ch2-1.html
http://progit.org/book/ch2-5.html
http://sillycat.iteye.com/blog/1323263
http://sillycat.iteye.com/blog/1131274
http://sillycat.iteye.com/blog/1074171
http://sillycat.iteye.com/blog/689970
http://help.github.com/ssh-issues/
http://help.github.com/linux-set-up-git/
http://help.github.com/win-set-up-git/
发表评论
-
Stop Update Here
2020-04-28 09:00 316I will stop update here, and mo ... -
NodeJS12 and Zlib
2020-04-01 07:44 476NodeJS12 and Zlib It works as ... -
Docker Swarm 2020(2)Docker Swarm and Portainer
2020-03-31 23:18 369Docker Swarm 2020(2)Docker Swar ... -
Docker Swarm 2020(1)Simply Install and Use Swarm
2020-03-31 07:58 370Docker Swarm 2020(1)Simply Inst ... -
Traefik 2020(1)Introduction and Installation
2020-03-29 13:52 337Traefik 2020(1)Introduction and ... -
Portainer 2020(4)Deploy Nginx and Others
2020-03-20 12:06 431Portainer 2020(4)Deploy Nginx a ... -
Private Registry 2020(1)No auth in registry Nginx AUTH for UI
2020-03-18 00:56 436Private Registry 2020(1)No auth ... -
Docker Compose 2020(1)Installation and Basic
2020-03-15 08:10 374Docker Compose 2020(1)Installat ... -
VPN Server 2020(2)Docker on CentOS in Ubuntu
2020-03-02 08:04 456VPN Server 2020(2)Docker on Cen ... -
Buffer in NodeJS 12 and NodeJS 8
2020-02-25 06:43 385Buffer in NodeJS 12 and NodeJS ... -
NodeJS ENV Similar to JENV and PyENV
2020-02-25 05:14 479NodeJS ENV Similar to JENV and ... -
Prometheus HA 2020(3)AlertManager Cluster
2020-02-24 01:47 424Prometheus HA 2020(3)AlertManag ... -
Serverless with NodeJS and TencentCloud 2020(5)CRON and Settings
2020-02-24 01:46 337Serverless with NodeJS and Tenc ... -
GraphQL 2019(3)Connect to MySQL
2020-02-24 01:48 248GraphQL 2019(3)Connect to MySQL ... -
GraphQL 2019(2)GraphQL and Deploy to Tencent Cloud
2020-02-24 01:48 452GraphQL 2019(2)GraphQL and Depl ... -
GraphQL 2019(1)Apollo Basic
2020-02-19 01:36 328GraphQL 2019(1)Apollo Basic Cl ... -
Serverless with NodeJS and TencentCloud 2020(4)Multiple Handlers and Running wit
2020-02-19 01:19 314Serverless with NodeJS and Tenc ... -
Serverless with NodeJS and TencentCloud 2020(3)Build Tree and Traverse Tree
2020-02-19 01:19 319Serverless with NodeJS and Tenc ... -
Serverless with NodeJS and TencentCloud 2020(2)Trigger SCF in SCF
2020-02-19 01:18 294Serverless with NodeJS and Tenc ... -
Serverless with NodeJS and TencentCloud 2020(1)Running with Component
2020-02-19 01:17 312Serverless with NodeJS and Tenc ...
相关推荐
**GitHub Repositories Search-crx插件详解** GitHub Repositories Search-crx是一款专为开发者设计的浏览器扩展程序,它使得在GitHub上快速、精准地搜索和导航到特定的仓库变得异常简便。这款插件支持多种搜索条件...
### 从GitHub建立远程项目详解 #### 一、前言 随着开源文化的普及和技术交流的需求增加,越来越多的开发者选择使用GitHub来托管他们的项目代码。GitHub不仅提供了强大的版本控制功能,还支持团队协作、代码审查等...
解决fatal:remote error:You can’t push to git://github.com/username/*.git问题的办法 今天Git push的时候 fatal:remote error: You can't push to git://github.com/username/*.git Use git@github....
【GitHub Android App源码解析】 GitHub Android App 是一个官方出品的应用程序,允许用户在移动设备上无缝地浏览、管理以及协作开发GitHub上的项目。这款应用的源码是公开的,对于Android开发者而言,它是一个宝贵...
GitHub是一个基于Git的代码托管平台,它提供给开源项目及私有项目托管服务,同时支持版本控制和协作。自2008年4月10日正式发布以来,GitHub就以其独特的理念和强大的功能,迅速成为开发者社区中不可或缺的一部分。 ...
表格中的几个网站是github的同步镜像网站,均从网络搜集。下面是镜像网站的优点: 一:速度快,能节省打开github网页的时间和下载程序资源的时间。 二:同步性高,提供几乎和github官网一样的内容。 三:部分网站已...
微信小程序demo:github博客(源代码+截图)微信小程序demo:github博客(源代码+截图)微信小程序demo:github博客(源代码+截图)微信小程序demo:github博客(源代码+截图)微信小程序demo:github博客(源代码+截图)微信...
2. **代码托管**:GitHub 客户端使开发者能够便捷地上传、下载项目代码,同时支持对仓库的克隆、拉取和推送操作。这使得团队成员可以在本地工作,然后将更改同步到云端仓库,实现代码的集中托管。 3. **协作功能**...
GitHub iOS client in RxSwift and MVVM-C clean architecture
2. GitHub Help:官方的帮助文档,包含详细的使用指南和常见问题解答。 3. GitHub Community:官方社区论坛,用户可以在这里交流问题,寻求帮助。 4. GitHub Actions:自动化工具,可以自定义构建、部署和测试流程...
《PyPI官网下载:深入解析github2pandas-1.1.11.tar.gz》 在Python编程领域,PyPI(Python Package Index)是全球最大的Python软件仓库,它为开发者提供了一个集中发布和获取Python库的平台。今天,我们要探讨的是...
GitHub 上标星 115k+ 的 Java 教程 GitHub 上标星 115k+ 的 Java 教程 GitHub 上标星 115k+ 的 Java 教程 GitHub 上标星 115k+ 的 Java 教程 GitHub 上标星 115k+ 的 Java 教程 GitHub 上标星 115k+ 的 Java 教程 ...
Effectively use GitHub by learning its key features that leverage the power of Git and make collaboration on code easy to work with. Be more productive on the development workflow of your projects ...
github加速器,可以解决github打开慢的问题
/usr/bin/git ls-remote -h -t https://github.com/nhn/raphael.git npm ERR! npm ERR! fatal: unable to access 'https://github.com/nhn/raphael.git/': Failed connect to github.com:443; Connection timed out...
为了进行任何请求,你需要一个有效的OAuth2令牌或者个人访问令牌,可以在GitHub的开发者设置中生成: ```go import "github.com/google/go-github/github" // 创建一个新的GitHub客户端 client := github.New...
2. 同步性高: Github 镜像网站提供几乎和 Github 官方网站一样的内容,用户可以通过镜像网站获取最新的代码和资源。这使得用户可以及时获取最新的信息,不会错过任何重要的更新。 3. 部分网站已汉化: 部分 Github...
GitHub Pages 指南GitHub Pages 可以为你或者你的项目提供介绍网页,它是由 GitHub 官方托管和发布的。你可以使用 GitHub 提供的页面自动生成器,GitHub App 或者命令行来创建 GitHub Pages。本指南是 GitHub Pages ...
2. 将原项目的修改同步到自己的分支:Github 的项目—>fetch、merge 到本地版本库—>push 到 Github 网站分支—>将自己 Github 网站分支 pull request 到 Github 的原项目 通过掌握这些命令和流程,我们可以更好地...
The unofficial GitHub Cards. Card for your GitHub profile, card for your GitHub repositories.