博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
git学习,git上建立自己的项目
阅读量:5768 次
发布时间:2019-06-18

本文共 1619 字,大约阅读时间需要 5 分钟。

官方帮助文档:

  https://help.github.com/articles/create-a-repo

登录github,点 New Repository.如下面图所示,

 

新建一个文件,初始化本地库git init,如下:

Step 1: Create the README file

In the prompt, type the following code:

mkdir ~/Hello-World # Creates a directory for your project called "Hello-World" in your user directorycd ~/Hello-World # Changes the current working directory to your newly created directorygit 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 ,git commit命令,如下:

Step 2: Commit your README

Now that you have your README set up, it's time to commit it. A commit is essentially a snapshot of all the files in your project at a particular point in time. In the prompt, type the following code:

git add README # Stages your README file, adding it to the list of files to be committedgit commit -m 'first commit' # Commits your files, adding the message "first commit"

提交自己的代码到github上,

  1,先添加远端,git remote add xxxxx

  2.push

  

Step 3: Push your commit

So far everything you've done has been in your local repository, meaning you still haven't done anything on GitHub yet. To connect your local repository to your GitHub account, you will need to set a remote for your repository and push your commits to it:

git remote add origin https://github.com/username/Hello-World.git # Creates a remote named "origin" pointing at your GitHub repositorygit push origin master # Sends your commits in the "master" branch to GitHub

转载于:https://www.cnblogs.com/atyou/archive/2013/03/11/2953639.html

你可能感兴趣的文章
Migration to S/4HANA
查看>>
sed 对目录进行操作
查看>>
什么是代码
查看>>
移动端开发单位——rem,动态使用
查看>>
系列文章目录
查看>>
手把手教你如何提高神经网络的性能
查看>>
前端布局原理涉及到的相关概念总结
查看>>
递归调用 VS 循环调用
查看>>
使用sstream读取字符串中的数字(c++)
查看>>
树莓派下实现ngrok自启动
查看>>
javascript静态类型检测工具—Flow
查看>>
MachineLearning-Sklearn——环境搭建
查看>>
node学习之路(二)—— Node.js 连接 MongoDB
查看>>
Goroutine是如何工作的?
查看>>
《深入理解java虚拟机》学习笔记系列——垃圾收集器&内存分配策略
查看>>
TriggerMesh开源用于多云环境的Knative Event Sources
查看>>
GitLab联合DigitalOcean为开源社区提供GitLab CI免费托管
查看>>
通过XAML Islands使Windows桌面应用程序现代化
查看>>
区块链现状:从谨慎和批判性思维看待它(第二部分)
查看>>
苹果公司透露Siri新发音引擎的内部原理
查看>>