克隆到本地目录? [英] Cloning to local directory?

查看:42
本文介绍了克隆到本地目录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在旧的github存储库上有一些代码. 我已经更新了当前完全未连接到github的本地文件夹中的代码.该文件夹包含与github存储库中相同的文件名,以及一些其他文件.

I have some code on a github repository that is old. I have updated code in a local folder that is currently not connected to github at all. This folder contains the same filenames as the ones in the github repository, with some additional files.

我想将该本地文件夹中的所有代码推送到现有存储库中.

I would like to push all the code in that local folder to the existing repository.

我已经在线尝试了两种解决方案,例如 https://gist.github.com/davisford/5039064 , 但我没有在github上看到更改.这似乎并不复杂,所以我不确定自己在做什么错.

I've tried two solutions online like https://gist.github.com/davisford/5039064, but I'm not seeing the changes on github. This doesn't seem that complicated so I'm not sure what I'm doing wrong.

谢谢!

推荐答案

所以要这样.

在github master/branch上推送新代码之前必须同步 执行以下操作

It is must to come in sync before you push new code on github master/branch Do the following

1.)使用命令git stash存储本地更改.

1.) Stash your local changes using command git stash.

2.)使用命令git pull从github仓库中拉出更改.

2.)Pull changes from github repo using command git pull.

3.)根据您的堆栈清理项目或重建或进行任何所需的操作. 4.)使用命令git stash pop取消存储您的更改,或右键单击projetc-> git->取消存储->选择您的存储更改.

3.) Clean project or rebuild or whatever is needed based on your stack. 4.) Unstash your changes using command git stash pop or right click on projetc -> git -> unstash -> select your stash changes.

这样,您的更改将覆盖在git repo更改之上.

With that your changes will be layered over your git repo changes.

5.)git status您将看到所做的更改.

5.) git status you will see your changes reflecting.

6.)git add .git add <file name(s)>

7.)git commit -m您的消息在这里"

7.) git commit -m "Your message here"

8.)git pushgit push origin master,具体取决于您的git方案.

8.) git pushor git push origin master depending on your git scenario.

一旦您的PR被批准,您将保持同步.

And you will be in sync once your PR is approved.

这篇关于克隆到本地目录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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