Git遇到一个问题:
fatal: Not a git repository (or any parent up to mount point /home)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
解决办法:git init
Git遇到一个问题:
fatal: Not a git repository (or any parent up to mount point /home)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
解决办法:git init
执行git commit -am “提交描述”即可将add和commit操作合并, 不需要先git add file 再 git commit -m “提交描述” 了
-a
–all
参数作用: Tell the command to automatically stage files that have been modified and deleted, but new files you have not told Git about are not affected.
-m
–message=
参数作用 Use the given as the commit message. If multiple -m options are given, their values are concatenated as separate paragraphs.
git config http.postBuffer 524288000
git运行突然提示
Auto packing the repository in background for optimum performance.
See “git help gc” for manual housekeeping.
error: The last gc run reported the following. Please correct the root cause
and remove .git/gc.log.
Automatic cleanup will not be performed until the file is removed.
fatal: object 0e6e9b9ea821b1f859f9e2cab931ad8c00194daf cannot be read
error: failed to run repack
查资料,原来是自己本地一些 “悬空对象”太多(git删除分支或者清空stash的时候,这些其实还没有真正删除,成为悬空对象,我们可以使用merge命令可以从中恢复一些文件)
git fsck --lost-found
,可以看到好多“dangling commit”git gc --prune=now
,完成
I have wide experience working with corporate proxies. Configuration is usually working well with
But if you have configured the proxy and it’s impossible to work with git (always getting 443 error) try to check if you have a remote.origin.proxy bypassing your configuration.
git config --list --show-origin
If you check that “remote.origin.proxy” is configured as empty value try to unset it or almost set it with your corporate proxy:
git config --add remote.origin.proxy "http://[yourproxy]:[yourport]"
And since several enterprise sites have untrusted certificates I recomend you to avoid certificate checking if you are using ssl:
git config http.sslverify false
git config --global http.sslverify false
在gitlab服务器上配置
git config --global http.postBuffer 524288000
[pack]
windowMemory = 0
packSizeLimit = 20000m
threads = 1
deltaCacheSize = 100000m
window = 0
thread = 1
[core]
packedGitLimit = 1g
packedGitWindowSize = 1g
compression = 0
bigFileThreshold = 10g
一、列出标签
$ git tag # 在控制台打印出当前仓库的所有标签
二、搜索标签
$ git tag -l ‘v0.1.*’ # 搜索符合模式的标签
三、推送标签到远程仓库
git push并不会把tag标签传送到远端服务器上,只有通过显式命令才能分享标签到远端仓库。
1.push单个tag,命令格式为:git push origin [tagname]
例如:
git push origin v1.0 #将本地v1.0的tag推送到远端服务器
2.push所有tag,命令格式为:git push [origin] –tags
例如:
git push –tags
或
git push origin –tags
查找大文件
find / -type f -size +200M -print0 | xargs -0 du -h | sort -nr
cd /var/opt/gitlab/git-data/repositories/@hashed/5e/c1/5ec1a0c99d428601ce42b407ae9c675e0836a8ba591c8ca6e2a2cf5563d97ff0.git
今天在使用git clone项目的时候出现 ”remote: warning: suboptimal pack – out of memory”
经过搜索找到解决方法:在服务端该项目的仓库下,编辑 config 文件,在文件中添加
[pack] window=0
保存退出即可。