git

git项目提交及分支操作命令

心不动则不痛 提交于 2021-02-18 13:41:00
本地代码提交到远程仓库: 设置git用户名、邮箱 git config --global user.name xxx git用户名 git config --global user.email xxx git邮箱 将项目提交到主分支(master): git remote rm origin 删除现有远程连接 git init 初始化本地仓库 touch README.md 创建README.md文件 git add . 将修改的文件添加到暂存 git commit -m "first commit" 将暂存中的文件提交到本地当前分支 git remote add origin https://xxxxxxx.xx/xx/ 将本地仓库连接到远程仓库 git push -u origin master 将本地仓库文件push到远程master分支 将主分支代码pull到dev分支: git branch -a 查看远程全部分支 git checkout -b dev origin/dev 在本地创建dev分支并将远程dev分支更新到本地分支 git pull origin master --allow-unrelated-histories 将master分支强制更新到当前分支 (执行git pull origin master 抛出错误refusing to merge

git提交项目常用命令及git分支的用法

佐手、 提交于 2021-02-18 12:56:49
1.第一步首先从git托管平台clone项目,我这里就使用idea为例: 填写git的url与存放本地目录名及项目名 2.如果你对项目进行了一些修改,就可以执行git命令,进行提交。 有两种方法: 1.使用idea自带的图形界面进行操作。选中修改过的文件,右键选择git--add添加到本地仓库。 再选择git --commit file进行提交 再进行commit和push,提交到远程仓库 2.使用命令行方式,个人比较喜欢这种方式。 首先打开terminal 执行步骤是一样的: 1.git status //查看更改的文件 2.git add 文件名 3.git commit -m '提交注释' 如果你这里感觉不对或者不想提交了,就使用如下命令,取消指定文件之前add的操作 git reset HEAD 文件名 git reset HEAD . 取消之前全部文件之前add的操作 4.git push //提交到远程仓库 分支: 在公司中通常不会让你直接提交到master,而是提交分支,等待项目管理人员或者产品经理进行审核后再merge(合并) 1.首先你可以自己在本地创建一个开发dev分支 git branch dev 创建分支 git branch 查看本地分支 删除本地分支:git branch -d dev 强制删除:git branch -D dev 2.切换分支 git

Does circleci checkout pull the latest code from master or the code for the specific commit

徘徊边缘 提交于 2021-02-18 12:13:46
问题 Hello stackoverflow/circleci gods. I have been using circleCI for a while now and I have a question about the 'checkout' step which I will do my best to explain. This is a snippet from my circleCI config file (I have a job 'a-job' whose first step is checkout): a-job: docker: - image: docker-image-here steps: - checkout ... My question is, does the circleci step 'checkout' pull the latest code from master or the code for the specific commit. i.e. does checkout simply git clone master:latest

Jenkins git commit for specific branch triggers build jobs for other branches too

心不动则不痛 提交于 2021-02-18 11:48:03
问题 We have a internal enterprise Github repo, and i have multiple feature branches. I am facing a issue with triggering a build on a specific branch. I have configured jobs for each of the feature branches. There is one jenkins job for one feature branch. The first time i commit a code, it also triggers builds for jobs with other branches. Steps to reproduce the problem: 1.We have a internal Github for enterprise. For my repo, i have setup webhook for github as below Settings -> Webhooks &

Merging branch into master in Xcode 11?

Deadly 提交于 2021-02-18 11:23:05
问题 I must be missing something very simple here. I never had a problem merging branches into master on earlier versions of Xcode, but I don't have the option on any projects while using Xcode 11. How should I merge into master? Thanks. 回答1: This is a frustrating Xcode 11 issue. As a workaround you can checkout master first and then merge the required branch into it. 来源: https://stackoverflow.com/questions/58606559/merging-branch-into-master-in-xcode-11

Git Merge - Not merging all changes from remote branch

岁酱吖の 提交于 2021-02-18 10:44:10
问题 I branched from master and created a branch called extra_work. Then I made lots of changes to master which included removing some files as well. Later now when I tried to merge the branch 'extra_work' into the master, it is not merging it entirely. It is not adding the files that I removed in master, basically all the work that I had undone, now I want it back into my master. How do I merge these two branches so that all the extra files/work from my 'extra_work' branch merges into master.

zsh的自动完成辅助工具:oh-my-zsh

蓝咒 提交于 2021-02-18 10:44:00
什么是Zsh Zsh和bash一样,是一种Unix shell,但大多数Linux发行版本都默认使用bash shell。但Zsh有强大的自动补全参数、文件名、等功能和强大的自定义配置功能。 替换Mac的bash Zsh虽然功能强大,但刚上手配置比较麻烦。别担心,Github已经有开源项目oh-my-zsh。按照官方的文档安装,非常简单。 一、使用curl自动安装 curl - L https ://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh | sh 二、手动安装 1.使用git clone 项目 git clone git ://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh 2.备份~/.zshrc文件 cp ~ /.zshrc ~/ .zshrc .orig 3.创建新的zsh配置文件 cp ~ /.oh-my-zsh/templates /zshrc .zsh - template ~/.zshrc 4.设置zsh为默认shell chsh -s /bin /zsh 5.重启Terminal或新建一个Terminal就可以看到效果了 接下来配置适合自己Zsh 1.主题修改,我比较喜欢前面是$符号,所以选择了steeef这款主题 $ vim

Git Merge - Not merging all changes from remote branch

北战南征 提交于 2021-02-18 10:43:51
问题 I branched from master and created a branch called extra_work. Then I made lots of changes to master which included removing some files as well. Later now when I tried to merge the branch 'extra_work' into the master, it is not merging it entirely. It is not adding the files that I removed in master, basically all the work that I had undone, now I want it back into my master. How do I merge these two branches so that all the extra files/work from my 'extra_work' branch merges into master.

linux链接及文件互相上传下载

眉间皱痕 提交于 2021-02-18 09:24:44
若排版紊乱可查看 我的个人博客原文地址 基本操作 本篇博客主要介绍如何去链接远程的linux主机及如何实现本地与远程主机之间文件的上传下载操作,下面的linux系统是CentOS6.6 链接远程linux主机 一般链接远程linux主机,如果电脑上没有安装类似SecureCRTPortable这种终端仿真程序,我们会用git的命令窗口使用命令去链接,但是这种方式不能保存链接的用户名和密码,下次还要重新输入链接信息,很麻烦,适合暂时的连一下,用一下,通常都会使用终端仿真程序,并保存相关链接信息。 未安装终端仿真程序链接方式-命令 在任意位置打开git命令窗口,输入如下命令即可 ssh username@ip_or_domain 该命令中username代表linux登录用户的用户名,ip_or_domain代表linux主机的ip地址或ip所映射的域名,例如: ssh root@116.196.115.151 代表的含义是使用root用户链接116.196.115.151的远程主机 之后,一般如果该账户设有密码,会在下一步提示输入链接密码,输入正确密码即可链接成功 安装SecureCRTPortable链接 本地电脑上有SecureCRTPortable这种终端仿真程序(直接浏览器搜索,一堆,本文使用版本为8.3),打开SecureCRTPortable,选择 文件(File)-

Combine Git Bash and opening in current folder in CMDER

允我心安 提交于 2021-02-18 08:32:06
问题 Please describe me, who have such experience, how to correctly set the options of CMDER to open new console with Git Bash in current folder(Open CMDER here, for example). This string does not work: "C:\Program Files (x86)\Git\bin\sh.exe" --login -i -new_console:%__CD__% I tried mix to this ""C:\Program Files (x86)\Git\bin\sh.exe" --login -i" and this cmd /k "%ConEmuDir%\..\init.bat" -new_console:%__CD__% 回答1: Your second option should have worked: See this gist (also for Cmder): Open Conemu