Github基本操作【学习笔记】
2014-02-26 17:14
218 查看
Set Up Git
配置全局用户名
git config --global user.name "Your Name Here"
配置全局邮箱
git config --global user.email "your_email@example.com"
配置全局邮箱
Create A Repo
More about repositories
Click New Repository.
Click "New Repository
Fill out the information on this page. When you're done, click "Create Repository."
Fill in the info
Congratulations! You have successfully created your first repository!
远程仓库建立后,在本地建立项目
mkdir ~/Hello-World
# Creates a directory for your project called "Hello-World" in your user directory
cd ~/Hello-World
# Changes the current working directory to your newly created directory
git init
# Sets up the necessary Git files
# Initialized empty Git repository in /Users/you/Hello-World/.git/
touch README
# Creates a file called "README" in your Hello-World directory
提交指定的文件
git add README
# Stages your README file, adding it to the list of files to be committed
git commit -m 'first commit'
# Commits your files, adding the message "first commit"
将本地动作提交到远程仓库
git remote add origin https://github.com/username/Hello-World.git
# Creates a remote named "origin" pointing at your GitHub repository
git push origin master
# Sends your commits in the "master" branch to GitHub
发现无法提交,解决办法直接暴力上传
To https://github.com/kelespring/test.git
! [rejected] master -> master (fetch first)
error: failed to push some refs to 'https://github.com/kelespring/test.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
git push -f
讲远程仓库下载到本地
git clone https://github.com/username/Spoon-Knife.git
先写到这里
配置全局用户名
git config --global user.name "Your Name Here"
配置全局邮箱
git config --global user.email "your_email@example.com"
配置全局邮箱
Create A Repo
More about repositories
Click New Repository.
Click "New Repository
Fill out the information on this page. When you're done, click "Create Repository."
Fill in the info
Congratulations! You have successfully created your first repository!
远程仓库建立后,在本地建立项目
mkdir ~/Hello-World
# Creates a directory for your project called "Hello-World" in your user directory
cd ~/Hello-World
# Changes the current working directory to your newly created directory
git init
# Sets up the necessary Git files
# Initialized empty Git repository in /Users/you/Hello-World/.git/
touch README
# Creates a file called "README" in your Hello-World directory
提交指定的文件
git add README
# Stages your README file, adding it to the list of files to be committed
git commit -m 'first commit'
# Commits your files, adding the message "first commit"
将本地动作提交到远程仓库
git remote add origin https://github.com/username/Hello-World.git
# Creates a remote named "origin" pointing at your GitHub repository
git push origin master
# Sends your commits in the "master" branch to GitHub
发现无法提交,解决办法直接暴力上传
To https://github.com/kelespring/test.git
! [rejected] master -> master (fetch first)
error: failed to push some refs to 'https://github.com/kelespring/test.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
git push -f
讲远程仓库下载到本地
git clone https://github.com/username/Spoon-Knife.git
先写到这里
相关文章推荐
- GitHub入门与实践学习笔记--github学习基础之关于git的基本操作
- MySQL学习笔记2:数据库的基本操作
- Github学习之路-小试牛刀,练习Git 的基本操作
- MySQL学习笔记 2 - 基本操作
- ASP.NET学习笔记(5)——原生Ajax基本操作
- 实验楼linux学习笔记(四:Linux 目录结构及文件基本操作
- redis学习笔记3--基本操作1
- Swift学习笔记(二十)——数组的基本操作
- MyBatis学习笔记:基于xml和注解对表的基本操作
- Java学习笔记2 - 数组的基本操作
- C语言学习笔记:17_数组-一维数组(基本操作,选择和冒泡排序,斐波那契数列)
- 【[学习笔记----数据结构15-图的基本数据操作]】
- MySql学习笔记-介绍以及基本操作
- HBase学习笔记 --- 基本shell操作
- MySQL学习笔记3:表的基本操作介绍
- Mysql入门学习笔记---基本操作
- 虚拟项目学习git/github原理与基本操作3
- 虚拟项目学习git/github原理与基本操作9
- pyramid学习笔记x-mongodb基本操作
- Python学习笔记之:文件基本操作