git

Jenkins高级用法

天大地大妈咪最大 提交于 2021-02-17 06:54:51
##系列目录 1.Jenkins 安装 2.Jenkins 集群 3.Jenkins 持续集成 - ASP.NET Core 持续集成(Docker&自由风格&Jenkinsfile) 4.Jenkins 高级用法 - Pipeline 安装 5.Jenkins 高级用法 - Jenkinsfile 介绍及实战经验 6.Jenkins 高级用法 - Blue Ocean 使用 7.Jenkins 高级用法 - 根据 git commit 控制构建过程 8.Jenkins 高级用法 - 微服务DevOps实战(ASP.NET Core) 常见问题: 1.Jenkins 时区设置 2.Jenkins 无法捕获构建脚本错误问题 一.什么是 Jenkinsfile Jenkinsfile 是 Jenkins 2.x 核心特性 Pipeline 的脚本,由Groovy语言实现。Jenkinsfile一般是放在项目根目录,随项目一起受源代码管理软件控制,无需像创建“自由风格"(Jenkins FreeStyle)项目一样,每次可能需要拷贝很多设置到新项目,提供了一些直接的好处: Pipeline上的代码审查/迭代 Pipeline的审计跟踪 Pipeline的唯一真实来源,可以由项目的多个成员查看和编辑。 Pipeline支持:Declarative(在Pipeline 2.5中引入

How to recover files from missing tree and dangling blobs?

本小妞迷上赌 提交于 2021-02-17 06:33:09
问题 After git add . I ran git rm -r -f . ,and all my local files were deleted accidentally. After recovering them with git fsck --lost-found I have this in lost-found/other directory: git fsck --full notice: HEAD points to an unborn branch (master) Checking object directories: 100% (256/256), done. notice: No default references dangling blob 0453ac74117a3e02ae1169ac28e6df356baec5b6 dangling blob 871364bedccaa2c57054509feeb60955e70bd141 dangling blob c38f2c2aead5f278b7680a0629ee56682264f9d3

Git Bash: Microsoft Visual C++ 14.0 is required, but I already have it installed

*爱你&永不变心* 提交于 2021-02-17 06:29:21
问题 I am using git to clone https://github.com/rkern/line_profiler.git on Windows 10. It is erroring out with this error but I have this installed (see image below): error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/ This is the command I am using: git clone https://github.com/rkern/line_profiler.git find line_profiler -name '*.pyx' -exec cython {} \; cd line_profiler pip install . --user 回答1: You don't have

Composer package conflict in git repository; how to untrack files but avoid deletion of files when pushing to remote

≡放荡痞女 提交于 2021-02-17 06:22:09
问题 I installed a package on my web application via composer. And added the package folder to .gitignore, whilst committing composer.json and composer.lock To deploy to our server, we Push to a bare Git remote on the server which in turn pushes the modified files to the relevant location on the server. This workflow was all working fine. At a later date, someone else working on the repository added the package files to the repository and removed the package from gitignore. We want the package

VSCode Python开发环境配置

强颜欢笑 提交于 2021-02-17 05:31:22
博客: blog.shinelee.me | 博客园 | CSDN [TOC] 准备工作 安装anaconda , 官网 下载安装,笔者安装在"D:\Anaconda3" 安装好之后,查看环境变量path中是否有如下路径,没有的话添加进去 D:\Anaconda3 D:\Anaconda3\Scripts 安装git , 官网 下载安装,默认安装路径"C:\Program Files\Git" 安装VSCode , 官网 下载安装 VSCode初步 查看 Visual Studio Code Tips and Tricks ,快速熟悉VSCode。 用户界面 了解VSCode用户界面,如下图所示,随便点一点,还是比较一目了然的。 快捷键 Windows下的默认快捷键如下图所示, 万能Ctrl+Shift+P 。也可以 文件→首选项→键盘快捷方式, 自定义快捷键绑定 。 安装扩展 如图搜索并安装相应扩展 安装**Chinese(Simplified)**中文简体语言包,参看官方文档 Display Language 设置显示语言 安装 Python 扩展,如果前面安装的anaconda的路径已经加入到path环境变量中,这里跟着提示操作就可以,vscode会自动找到系统python的位置,调试时如果发现提示pylint没有安装,可以通过 pip 或者 conda 安装,参看

git svn clone specific branches and merge

不羁岁月 提交于 2021-02-17 05:27:10
问题 I am looking to migrate my codebase from svn to git. There are too many branches in my svn repo. I only wish to clone couple of branches and merge them together and push it to git. I want to avoid cloning all branches as it takes long time. How do I achieve this? After it's done, I want to periodically get update from those svn branches, merge them and update the git repo and the svn will be active for certain period of time. It would be waste of time if I have to clone it again. Is there a

Push changes in git submodule to main module but not to submodule

為{幸葍}努か 提交于 2021-02-17 05:22:44
问题 I have a git project A that uses a submodule B from Github. I cannot push to the Github project B because it is not mine. I want to do a small change in B that is not pushed to the remote B (because I can't push) but it should be pushed to A (so when someone uses A, he should be able to see my changes). I tried to commit in B, then commit in A and it seems like the changes are committed correctly. When I push A to bitbucket it shows me the submodule with a new commit. I tried to clone A

Add / commit a file to all branches

萝らか妹 提交于 2021-02-17 05:22:09
问题 Say I am on a branch and the index is dirty. I made changes to a file x, and I have some other changes too. Is there a way to add file x to all existing branches? Something like this: #!/usr/bin/env bash current_branch="$(git rev-parse --abbrev-ref HEAD)" git add . git commit -am "added x" git fetch origin git for-each-ref --format='%(refname)' refs/heads | while read b ; do git checkout "$b" git checkout "$current_branch" -- x done git checkout "$current_branch"; # finally, check out the

generating version tags using semantic-release without the v

对着背影说爱祢 提交于 2021-02-17 05:11:55
问题 How can I use git tags with the format major . minor . patch , without the " v " in the beginning (i.e. versions 1.0.1, 2.0.1)? I'm using Gitlab CI, but even using the Docker image locally I'm not able to pass the value to tag-format correctly. What I'm trying to do: npx --no-install semantic-release --tag-format "\${version}" The error log: [8:42:06 PM] [semantic-release] › ✖ ETAGNOVERSION Invalid tagFormat option. The tagFormat (https://github.com/semantic-release/semantic-release/blob

Can i push into two remote repository in the same command line?

谁说胖子不能爱 提交于 2021-02-17 05:06:14
问题 I want to push and syncronize my code in two different remote repository, to Gitlab and Github at the same command, is it possible? 回答1: Let's me recommend this push-to-all-remotes alias: git config [--global] alias.push-to-all-remotes '!git remote | xargs -I% -n1 git push %' Usage: git push-to-all-remotes master . Taken from gitalias.com (full disclosure: I'm a contributor there). 回答2: Yes. Just define two remotes for your working copy: git remote add lab https://gitlab.com/... git remote