可能重复:
git:我可以提交文件并忽略内容更改吗?
我有一个简单的问题,我希望有一个简单的解决方案.
使用Git(和Tower,很棒的应用程序),我有一个存储库,其中有一个文件,每个人都需要在克隆存储库时下载,但是该文件永远不应该重新上载更改(因为它是一个配置文件,具有特定于数据库的用户名/密码和路径) - 仅在本地使用时才进行更改.
我想要做的是忽略我在本地对该文件所做的任何更改,因此当我将更改推送到我的仓库时,文件将不会更新.怎么能实现这一目标?
应当指出的是:
当我克隆repo时,文件显示出来,但是当我忽略它时(仅限本地,而不是通过.gitignore)我必须解开它,当我这样做并将更改推回服务器时,任何克隆回购的人都不会下载文件<<不良行为.
如果我忽略了该文件但我没有忘记它,该文件仍显示在我的工作目录中,等待提交"不良行为".
我使用以下命令将CVS存储库转换为Git存储库:
$ git cvsimport -vaikd :pserver:thillaiselvan@192.168.1.11:2401/ -C IVR-GUI GIT
Run Code Online (Sandbox Code Playgroud)
但是,Git会忽略CVS存储库中的空目录.但我希望克隆存储库,包括那些空存储库.我怎么能让Git这样做?
当我尝试从存储库克隆以下内容时:
git clone git://gitorious.org/qt/qt5.git qt5
Run Code Online (Sandbox Code Playgroud)
我收到这个错误:
fatal: Unable to look up gitorious.org (port 9418) (This is usually a temporary error during hostname resolution and means that the local server did not receive a response from an authoritative server. )
Run Code Online (Sandbox Code Playgroud)
有什么问题?
另一件事我的网络使用代理,我已经设置了它:
git config --global http.proxy http://192.168.0.7:8080
Run Code Online (Sandbox Code Playgroud) 我在github上有一个项目,我想在我的服务器上镜像.
我尝试过以下几点:git clone --mirror git@github.com:user/repo.git.
然后在repo.git目录中,我有以下文件结构(例如,输出ls):
FETCH_HEAD branches/ description info/ packed-refs HEAD config hooks/ objects/ refs/
所以我的问题是:我的文件在哪里!?看起来有一堆git相关的东西,但我找不到我写的代码.我错过了一些明显的东西吗
顺便说一句,git status返回fatal: This operation must be run in a work tree但git branch返回分支.奇怪的.
当我将远程存储库添加为上游并尝试获取它时,它会失败,如下所示:
$ git fetch upstream
remote: Counting objects: 11901, done.
remote: aborting due to possible repository corruption on the remote side.
error: pack-objects died of signal 9
error: git upload-pack: git-pack-objects died with error.
fatal: git upload-pack: aborting due to possible repository corruption on the re
mote side.
fatal: protocol error: bad pack header
Run Code Online (Sandbox Code Playgroud)
我知道它由于存储库中存在大量文件而失败(我们确实有),但为什么克隆相同的存储库时它不会失败?因为我能够成功克隆存储库.不应该在克隆请求时打包相同的对象吗?
我通过拖动链接将Gist从GitHub克隆到我的桌面.
但是,文件夹名称是不需要的长号码.
如何重命名文件夹,仍然能够继续将该文件夹中的更新提交到GitHub上的Gist?
有可能吗?
我从Github克隆了一个废弃的存储库,现在我希望能够将我的更改上传到私人仓库,以便其他一些人可以与我一起处理这些变更.不幸的是,因为我克隆它而不是制作一个fork,所以Xcode试图对原始repo进行提交.有没有办法改变正在进行的提交回购?如果有,是否有办法将其更改为另一个网站(Bit Bucket)上的回购?
一旦变更完成,我完全打算让回购公开.
我的一位朋友加入了他作为合作者的Github项目.我能够看到回购,但当我尝试克隆时:
git clone https:/github.com/FriendsUserName/FriendsRepo.git
Run Code Online (Sandbox Code Playgroud)
获取错误:
remote: Repository not found.
fatal: repository https:/github.com/FriendsUserName/FriendsRepo.git not found
Run Code Online (Sandbox Code Playgroud)
我已经成功设置了多个Github帐户,从这篇文章 - Github工作和娱乐(多个帐户)
以前有人遇到过这个问题吗?
我也尝试分叉回购然后克隆.但仍然与克隆相同的错误.
我试图从本地裸克隆创建一个--shallow-since工作克隆,但它不断拉动所有东西.--depth = N工作正常.
我在想这个问题是我使用了错误的格式?我已经尝试过搜索但是没有明确说明<date>应该是什么格式--shallow-since = <date>.
我正在尝试使用SSH密钥将私有git仓库(gitLab)克隆到kubernetes容器中。我已将密钥存储在一个秘密中。这是执行所需任务的作业的yaml文件。
继承人相同的问题,但没有给出确切的解决方案:
在Kubernetes Pod中克隆一个安全的git repo
执行后初始化容器的日志:
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/community/x86_64/APKINDEX.tar.gz
v3.7.1-66-gfc22ab4fd3 [http://dl-cdn.alpinelinux.org/alpine/v3.7/main]
v3.7.1-55-g7d5f104fa7 [http://dl-cdn.alpinelinux.org/alpine/v3.7/community]
OK: 9064 distinct packages available
OK: 23 MiB in 23 packages
Cloning into '/tmp'...
Host key verification failed.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Run Code Online (Sandbox Code Playgroud)
yaml文件非常适合公共回购:
apiVersion: batch/v1
kind: Job
metadata:
name: nest-build-kaniko
labels:
app: nest-kaniko-example
spec:
template:
spec:
containers:
-
image: 'gcr.io/kaniko-project/executor:latest'
name: kaniko
args: ["--dockerfile=/workspace/Dockerfile",
"--context=/workspace/",
"--destination=aws.dest.cred"]
volumeMounts:
-
mountPath: /workspace …Run Code Online (Sandbox Code Playgroud)