推送项目至github
When I started actively pushing content to Github, I did not push Open Source contributions, Components or anything of the like - I pushed poetry. I did this, because it is what I love the most, after coding. I remain ever grateful that I took the initiative to make my first git commit
.
当我开始积极地向Github推送内容时,我没有推动开放源代码贡献,组件或类似的东西-我推动了诗歌。 我这样做是因为编码后我最喜欢的是它。 我一直很感激我主动提出了第一个git commit
。
Now, I want to breakdown the process for new coders (and poets - hopefully ), so that they can become comfortable with working with Github too. I will be breaking down several ways to push content to Github. For the purpose of this article, I will assume that readers are familiar with Terminal usage (GitBash or otherwise).
现在,我想细分新编码人员(和诗人,希望是)的过程,以便他们也可以轻松地与Github合作。 我将分解几种将内容推送到Github的方法。 出于本文的目的,我将假定读者熟悉终端的使用(GitBash或其他方式)。
使用自述文件推送到新存储库 (Pushing to a new repository with a README file)
There are just a few essential steps to this:
仅有几个必要步骤:
Click the green Clone or download button on the repository page.
单击存储库页面上绿色的克隆或下载按钮。
Use the Clone with HTTPS option, and copy the link provided.
使用“使用HTTPS克隆”选项,然后复制提供的链接。
Run
git clone https://github.com/UserProfile/repository.git
in the terminal. Here, UserProfile and repository will be replaced by the values provided in the copied link.在终端中运行
git clone https://github.com/UserProfile/repository.git
。 在这里, UserProfile和存储库将被复制的链接中提供的值替换。Run
git init
in the terminal. This will initialize the folder/repository that you have on your local computer system.在终端中运行
git init
。 这将初始化本地计算机系统上的文件夹/存储库。Run
git add .
in the terminal. This will track any changes made to the folder on your system, since the last commit. If this is the first time you are committing the contents of the folder, it will add everything.运行
git add .
在终端。 自上次提交以来,这将跟踪对系统上的文件夹所做的任何更改。 如果这是您第一次提交文件夹的内容,它将添加所有内容。Run
git commit -m"insert Message here"
. This will prepare the added/tracked changes to the folder on your system for pushing to Github. Here, insert Message here can be replaced with any relevant commit message of your choice.运行
git commit -m"insert Message here"
。 这将为系统上的文件夹准备添加/跟踪的更改,以推送到Github。 在这里, insert Message here可以替换为您选择的任何相关提交消息。Run
git push origin master
. Note that the last word in the command master, is not a fixed entry when runninggit push
. It can be replaced with any relevant “branch_name”.运行
git push origin master
。 请注意,运行git push
时,命令主命令中的最后一个单词不是固定条目。 可以用任何相关的“ branch_name”代替。
如何将现有代码推送到新的Github存储库 (How to push Existing Code to a new Github repository)
"Coding is a beautiful thing. Anyone can learn to code!"
“编码是一件美丽的事情。任何人都可以学习编码!”
What you need to do:
你需要做什么:
Copy the
HTTPS
link provided.复制提供的
HTTPS
链接。
Run
git init
in the terminal. This will initialize the folder/repository that you have on your local computer system.在终端中运行
git init
。 这将初始化您在本地计算机系统上拥有的文件夹/存储库。Run
git add .
in the terminal. This will track any changes made to the folder on your system, since the last commit. As this is the first time you are committing the contents of the folder, it will add everything.运行
git add .
在终端。 自上次提交以来,这将跟踪对系统上的文件夹所做的任何更改。 由于这是您第一次提交文件夹的内容,它将添加所有内容。Run
git commit -m"insert Message here"
. This will prepare the added/tracked changes to the folder on your system for pushing to Github. Here, insert Message here can be replaced with any relevant commit message of your choice.运行
git commit -m"insert Message here"
。 这将为系统上的文件夹准备添加/跟踪的更改,以推送到Github。 在这里, insert Message here可以替换为您选择的任何相关提交消息。Run
git remote add origin https://github.com/Usheninte/example.git
in the terminal. Here, Usheninte and example will be replaced by the values provided in the copied link. This will push the existing folder on you local computer system, to the newly created Github repository.在终端中运行
git remote add origin https://github.com/Usheninte/example.git
。 在这里, Usheninte和example将被复制的链接中提供的值替换。 这会将本地计算机系统上的现有文件夹推送到新创建的 Github存储库中。Run
git remote -v
. This does some git pull and git push magic, to ensure that the contents of your new Github repository, and the folder on you local system are the same.运行
git remote -v
。 这确实做了一些git pull和git push魔术,以确保新的Github存储库的内容与本地系统上的文件夹相同。Run
git push origin master
. Note that the last word in the command master, is not a fixed entry when runninggit push
. It can be replaced with any relevant “branch_name”.运行
git push origin master
。 请注意,运行git push
时,命令主命令中的最后一个单词不是固定条目。 可以用任何相关的“ branch_name”代替。
So, that's it! I honestly believe anyone can learn to code. I have spent the past year, tutoring undergraduate students in Nigeria, on Software Development. Soon, I will be starting off my journey as an Entrepreneur-in-Training at the Meltwater Entrepreneurial School of Technology.
就是这样了! 老实说,我相信任何人都可以学习编码。 过去一年中,我一直在为尼日利亚的本科生辅导软件开发。 很快,我将在Meltwater企业家技术学院担任 培训企业家的旅程开始。
Start coding today!
立即开始编码!
翻译自: https://www.freecodecamp.org/news/pushing-to-github-made-simple-enough-for-poets/
推送项目至github