Git操作步骤

项目中git操作步骤 在接到一个新任务后,首先需要将自己当前的本地代码更新到当前最新版本: git checkout origin/master 验证是否进入远端主干分支: git log 看历史信息 和小乌龟(TortoiseGit)上 git log 里 origin -> master 的 tree 节点信息是否一致; 更新远端主干代码: git fetch // git fetch origin/master 将远端主干分支的变动迁移到个人开发的分支上: (附:merge 和 rebase 的区别:h 阅读详情

1. 安装Git

使用图形化Git安装工具,下载地址:Git - Downloads

2. 搭建自己的git

2.1 进入.ssh目录
打开Mac终端(Terminal),输入以下命令:

cd ~/.ssh

2.2 查看是否有已存在的公钥
输入  "ls"  命令查看目录下的所有文件。

检查目录下是否有名为id_rsa.pub的文件。
如果已经存在且不需要新的公钥,就可以直接打开该文件,获取到公钥。
输入以下命令打开文件:

cat id_rsa.pub

如果有该文件但是需要新的,请继续第3步;
如果没有该文件,请跳过第3步,继续第4步。

2.3 删除旧公钥
依次输入以下命令备份,删除旧公钥:

mkdir key_backup
cp id_rsa* key_backup
rm id_rsa*

2.4 生成公钥
输入以下命令生成公钥:

ssh-keygen -t rsa -C "你的邮箱"

会询问你key的存储位置,直接Enter。

会提示你输入密码,可不输,直接Enter。

至此,本地的SSH密钥对就生成了,默认存在账号主目录下的.ssh文件夹中。

2.5 添加gitla  Deploy Keys:
cat ~/.ssh/id_rsa.pub 复制密钥,打开gitlab网页右上角点击Deploy Keys添加.

登录gitlab账号,点击头像,Settings -> SSH keys,将复制的公钥贴到“Key”文本框中,输入“Title”以区分不同的SSH Key,点“Add key”添加。

 2.6 验证是否成功

$ ssh -T git@gitlab.com

如果看到如下内容,即设置成功:

Hi xxx! You've successfully authenticated, but GitHub does not # provide shell access.

2.7 下载git项目

git clone 项目地址 

2.8 上传与下载:

打开项目根目录的terminal,配置git用户名和邮箱,之后代码提交以该用户名名义提交。

$ git config user.name "yourname"
$ git config user.email "youremail@youremail.com"

下载:git pull
添加分支:git branch xx
指定分支:git checkout xx
上传步骤:1、git add -A;2、git commit -m "xx";3、git push;4、打开gitlab网页 create new merge request;5、merge


注意:修改脚本前先执行git pull

3. Git 工作流程

1. 在工作目录中,添加修改文件;

2. 将需要进行版本管理的文件放入暂存区;

3. 将暂存区的文件提交到git仓库。

Git 管理文件的三种状态

1. 已修改

2. 已暂存

3. 已提交

Git 通过维护三棵树来实现版本控制

1. 工作区(working)

2. 暂存区(index),存放临时改动的文件

3. 仓库(HEAD指向最新版本)

4. 线上线下开发流程

11

git操作步骤 初始化配置 配置用户名和邮箱地址 Git config --global user.name ‘自定义’ Git config --global user.email ‘自定义’ Git config --list 查看信息 创建新项目 git remote rm origin 删除相同旧别名 //第一步git 初始化git仓库 git init //可以查看暂存区中的文件状态 git stat... 阅读详情

相关推荐

Git 常用命令与操作步骤

Git常用命令速查指南:涵盖初始化和克隆仓库(git init/clone)、分支管理(branch/checkout)、提交推送(add/commit/push)、合并冲突(merge/rebase)、撤销回退(reset/revert)、远程操作(remote/pull)等核心场景。附实用技巧:git log查看历史、stash暂存修改、diff比较差异,以及工作区→暂存区→本地库→远程库的工作流程图解。注意事项:慎用force推送,合理配置.gitignore,推荐语义化提交信息。适用于日常开发快速查

程序员之道 1194

git 第一次http提交报错

git 第一次http提交报错

hzm博客 458

LoRa模块选型指南:正点原子ATK-LORA-01与SX1278芯片深度评测(含实测距离/功耗数据)

本文深度评测了正点原子ATK-LORA-01与SX1278芯片的性能表现,通过实测数据展示其在复杂环境中的通信距离与功耗表现。特别适合智慧农业、工业监测等物联网应用场景,提供详细的配置指南和优化技巧,帮助开发者实现高效、低功耗的LoRa通信解决方案。

weixin_29191081的博客 290

常用 Git 命令清单

一般来说,日常使用只要记住下图6个命令,就可以了。但是熟练使用,恐怕要记住60~100个命令。 下面是我整理的常用 Git 命令清单。几个专用名词的译名如下。 Workspace:工作区 Index / Stage:暂存区 Repository:仓库区(或本地...

767

告别‘耀斑’降落:手把手教你用PX4+激光测距仪实现固定翼精准自动着陆

本文详细介绍了如何利用PX4飞控与激光测距仪实现固定翼无人机的精准自动着陆,解决传统气压计在低空环境下的测量误差问题。通过硬件选型、安装要点、PX4参数配置及实战调校,帮助开发者实现厘米级高度感知,优化降落曲线,提升着陆稳定性与安全性。

weixin_30336061的博客 520

flink定位反压节点

在 Apache Flink 中定位反压(Backpressure)节点需要结合监控工具和作业行为分析。

2301_80954266的博客 1047

Mac上配置Git和设置SSH

前往.shh文件所在的路径(前往~/.ssh 这个路径),然后用xcode打开.pub这个文件。$ vim id_rsa.pub 将这个文件的内容显示到终端上。Mac上是自带git的,所以不需要自己下载和安装。$ cd ~/.ssh 切换目录到这个路径。:这里的邮箱填写你提交代码时要用的邮箱。

weixin_38649188的博客 4252

别再傻傻分不清了!Anaconda和Miniconda到底选哪个?附保姆级安装与镜像源配置(Windows/Mac)

本文详细解析了Anaconda和Miniconda的核心差异,包括体积、预装内容、系统资源占用等关键维度,并提供了针对不同需求的决策框架。附有Windows和Mac双平台的详细安装与配置指南,帮助用户根据实际需求选择最适合的conda工具,提升开发效率。

weixin_30315723的博客 426

解决git:‘remote-http‘ 不是一个 git 命令错误提示

第一步:yum -y install curl-devel curl libcurl-devel libcurl。stderr: git:‘remote-http’ 不是一个 git 命令。参见 ‘git --help’。安装Git时缺少curl-devel curl libcurl-devel libcurl组件。第二步:删除/usr/local/git和git源码,重新安装Git软件。

董云飞的博客 6053

Codex 赋能UI自动化测试

✅ 零编码门槛:业务人员也能直接上手✅ 无需复杂配置:跳过部署陷阱,分钟级启用✅ 无权限风险:沙箱隔离 + 操作审计,安全可控✅ 精准匹配 UI 自动化需求:生成代码与执行操作一体化本文我使用CRM系统分类管理功能进行测试演示,手把手教你从测试用例编写,到上传Codex、自动执行浏览器操作,每一步都有细节,看完直接复刻到工作中。

十二测试录 460

linux内核学习(八)---摄像头框架移植(上)

本章来开始进行摄像头的移植,同时回顾一下V4L2的整个框架

文艺小少年的博客 113

From http://...-> FETCH_HEAD = [up to date] feature-assumeUnit -> origin/feature-assumeUnit Committe

打开命令行(Windows下为cmd,macOS和Linux下为terminal)。这个问题是因为Git无法自动检测到你的邮箱地址。如果你只想在当前仓库设置这些信息,可以省略。替换为你的实际邮箱地址,将。

wfdfg的博客 745

【YOLOv11工业级实战】15. YOLOv11海洋监测实战:珊瑚礁健康评估(水下图像增强|机器人搭载)

摘要:本文针对珊瑚礁健康评估的海洋监测需求,基于YOLOv11提出解决方案,聚焦水下色偏、悬浮物干扰、珊瑚形态复杂三大难题。引用全球珊瑚礁监测网络(GCRMN)标准,采用CoralNet数据集,通过Jaffe-McGlamery物理模型引导增强与悬浮物去除算法,在浑浊水域(能见度<5m)实现87.3%的健康珊瑚识别率,藻类误判率低至7.2%。介绍了以BlueROV2水下机器人和Jetson AGX Orin为核心的部署方案,结合水下SLAM定位技术,实现珊瑚健康的实时评估与三维覆盖率计算。

专注于人工智能、软件开发、工控自动化、工厂数字化及智能化等领域,希望和大家共同进步! 1644

git 下载项目操作步骤

git 下载项目操作步骤 1.下载项目 git clone 链接地址 2.查看分支 git branch -a 3.切换分支: git checkout -b develop --track remotes/origin/develop 或者 git checkout -b develop origin/develop ...

博客 1183

ROS 之 使用yocs_velocity_smoother对机器人速度进行限制

yocs_velocity_smoother是一个速度、加速度限制器,用来防止robot navigation的速度/转速过快,加速度/快减速过大。Bound incoming velocity messages according to robot velocity and acceleration limits. The velocity smoother nodelet runs together with the kobuki_node to apply robot’s velocity and .

https://shixuebin.gitee.io/hexo-blog/ 2622

OV9734 DATASHEET,完整规格书

OV9734完整规格书,包括电气参数,尺寸规格,寄存器配置表等

我的Git 操作步骤

检查本地仓库连接的远端仓库。1. 创建仓库,cd目录。

weixin_75123427的博客 148

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

GIT安装及集成到IDEA中操作步骤

最近深感GIT使用技能太差,我只会些皮毛,还是得看官网,总结一下常用的操作方法吧。

Matrix70的博客 4937

SAP B1中文培訓教材_SDK

公司内部培训资料,对开发工具 ,DIAPI, UIAPI,Add-ON有详细解说

Statistics and Machine Learning Toolbox

Statistics and Machine Learning Toolbox(带书签),MATLAB统计学习工具

git commit之后后面的操作步骤

git commit后面的操作步骤 1 按下小写字母i,会进入编辑模式。输入你想要的 message 2 按下esc退出编辑模式 3 按下英文输入法下的冒号(英文冒号要用Shift键) 4 再输入wq,就可以保存退出了,w是write,q是quit。 4.1 也可以在按esc退出编辑模式以后,切换到大写模式,连按两下Z。 ...

weixin_36637758的博客 1006

openEuler系统安装git详细操作步骤

本文详细介绍了如何在openEuler系统安装git工具

redrose2100的博客 4701

【git】简易git操作步骤

git基础教程

baidu_20313315的博客 279

git,切换以前的版本,增加代码,然后合并的操作步骤

远野贵树 1587

git和gitlab mac操作步骤

git和gitlab mac操作步骤

tendernessxy的博客 682

git工作操作步骤

上班开始,打开电脑,git pull:拉取git上最新的代码: 编辑代码,准备提交时,git stash:将自己编辑的代码暂存起来,防止git pull时与库中的代码起冲突,否则自己的代码就白敲了; 然后,git pull:拉取一下代码,与库中代码,做到同步,有冲突则解决冲突,如果省了这一步,别人有提交的代码,没有更新,自己提交就会报错,再走这一步,就会把别人的代码拉取出来,然后一起提交,...

雾里看花叹朦胧 225

git操作步骤及常用命令

Git操作步骤: 1.安装Git 2.创建目录 3.git init(初始化自己的本地仓库) 5.修改配置文件 git config --global http.sslVerify false 6.git remote add origin http://gitlab.uxsino.com/boc_jl/MonitorServer.git(关联本地和远程仓库) 7.git pull origin master (获取主线版本) 8. git checkout -b mybranch(创建自己的分支) 9.

lyn1772671980的博客 456

一、openEuler 安装git 详细操作步骤

linux openEuler 安装git 详细操作步骤

weixin_42868605的博客 603

git 操作步骤

下载项目1、先进到要下载的目录    git  bash here2、下载项目  git  clone url( 项目的路径 url )更新文件   git pullgit提交文件提交文件时有自动生成项目文件,提交时忽略他,打开 .gitignore文件,里面添加上就可以,如:要忽略 .project文件,就直接把这个名字粘贴进去就可以,然后 就可以直接提交了1、先更新 git pull2、看哪些...

weixin_41883384的博客 3184
上一篇: 读书笔记--腾讯音乐:全民K歌推荐系统架构及粗排设计
下一篇: curl 命令用法
MusicDancing
博客等级 码龄7年 2684粉丝 314原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值