Vor*_*Vor 32 git version-control github
我对git很新.我一直在寻找答案,却找不到答案.在我的电脑中,我有一个像这样的项目文件夹:
project_a
--some_folder
--another_folder
--.git
Run Code Online (Sandbox Code Playgroud)
我在github上有一个存储库,让我们说https://github.com/company/our_repo.git
在这个回购下我有一些文件夹.所以我的目标是让我project_a
失望trunk/bin
.能否请你告诉我如何实现这个目标.(再次,我非常非常新)
Ziy*_*gov 47
打开终端,访问此文件夹并写入:
git init
git add .
git commit -m "my commit"
git remote set-url origin git@github.com:username/repo.git
git push origin master
Run Code Online (Sandbox Code Playgroud)
Ada*_*dam 26
我有幸导航到我想要添加到存储库的目录(使用/替换为/的cd文件路径),然后:
git init
git add .
git commit -m "my commit"
git remote add origin <remote repository URL>
git push origin master
Run Code Online (Sandbox Code Playgroud)
这是一篇文章的链接,解释了如何更详细地解释它:https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
请注意,您将无法运行"git add".如果有问题的目录是打开的话
Vik*_*wat 11
1. first create a git repostry.
2. second open git bash in existing or uploading project.
3. perform git init
4. git add .
5. git commit -m "print message"
6. git remote add github<repostry url>
7. git remote -v
8. git push github master
Run Code Online (Sandbox Code Playgroud)
或者
git push origin master
Run Code Online (Sandbox Code Playgroud)
如果您遇到任何错误,您可以使用它
git push -f origin master
Run Code Online (Sandbox Code Playgroud)
Aja*_*dal 11
上面的所有答案似乎都指导了在git中创建一个新的存储库,但问题是关于向现有存储库添加一个文件夹.为此,可以遵循以下步骤.
git clone https://github.com/company/our_repo.git
trunk/bin
git commit -m "message"
和git push origin master
小智 8
-f
当你要推送已经存在的存储库时,你必须使用。
git init
git add *
git commit -m "Initial commit"
git branch -M main
git remote add origin <repo url>
git push -f origin main
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
54796 次 |
最近记录: |