如何将我当前的项目添加到已经存在的GitHub存储库中 [英] How to add my current project to an already existing GitHub repository

查看:127
本文介绍了如何将我当前的项目添加到已经存在的GitHub存储库中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Git的新手.我一直在寻找答案,但是找不到答案.

I'm very new to Git. I've been searching for an answer, but I couldn't find one.

在我的计算机中,我有一个类似这样的项目文件夹:

In my computer I have a project folder like this:

project_a
--some_folder
--another_folder
--.git

我在GitHub上有一个存储库,例如https://github.com/company/our_repo.git.在此存储库下,我有一些文件夹.所以我的目标是将project_a放在trunk/bin下.我该如何实现? (再次,我非常非常新.)

And I have a repository on GitHub, let’s say https://github.com/company/our_repo.git. Under this repository I have some folders. So my goal is to put my project_a under trunk/bin. How do I achieve this? (Again, I'm very very very new.)

推荐答案

打开终端,访问该文件夹并输入:

Open your Terminal, access to this folder and write:

git init
git add .
git commit -m "my commit"
git remote set-url origin git@github.com:username/repo.git
git push origin master

这篇关于如何将我当前的项目添加到已经存在的GitHub存储库中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆