Git关联本地项目到git上

IDEA本地项目关联远程Git远程仓库 下面介绍几种方法:一、代码 clone 到本地这种方法是直接 clone 代码,这样不需要在手动关联仓库。1、本地创建空白文件夹2、右键 Git Bash Here 打开控制台3、直接 clone 远程仓库的代码git clone 远程地址(、http)然后正常的代码提交就可以了。二、命令行关联1、远程是空白仓库没有任何文件的时候2、远程仓库有文件。 阅读详情

目录

 

在码云或者git上创建本地仓库

复制git或者码云上的地址

在本地项目文件夹下打开git bash  

项目集成功

另一种方式关联项目


在码云或者git上创建本地仓库

填写相关信息即可创建。

复制git或者码云上的地址

在本地项目文件夹下打开git bash  

在窗口中执行:      

git init 初始化

git remote add origin https://gitee.com/CoderJu/Java8.git(刚刚复制的地址)

git push -u origin master

可能会出现以下错误:

1. 出现错误

error:src refspec master does not match any

执行以下代码解决错误:      

touch README  

git add README  

git commit –m ’first commit’  

git push origin master 

 再执行:

git remote add origin https://gitee.com/CoderJu/Java8.git(刚刚复制的地址)

git push -u origin master

 2. 这时候有可能会出现以下错误   

  fatal: remote origin already exists.

执行一下语句解决错误:

 git remote rm origin

 3. 也有可能出现以下错误                     

$ git push origin master

To https://gitee.com/CoderJu/Java8.git

! [rejected]        master -> master (fetch first)

error: failed to push some refs to 'https://gitee.com/CoderJu/Java8.git'

hint: Updates were rejected because the remote contains work that you do

hint: not have locally. This is usually caused by another repository pushing

hint: to the same ref. You may want to first integrate the remote changes

hint: (e.g., 'git pull ...') before pushing again.

hint: See the 'Note about fast-forwards' in 'git push --help' for details.

   执行以下语句 进行代码合并

 git pull --rebase origin master 

 4.  错误

error: Could not remove config section 'remote.origin'

 需要修改gitconfig文件的内容 找到github的安装路径,我是C:\Users\Administrator\AppData\Local\GitHub\PortableGit_0f65d050d0c352找到一个名为gitconfig的文件,打开它把

               里面的[remote "origin"]那一行删掉重启gitshell  执行上述操作。

项目集成功

 

另一种方式关联项目

 

        在github或者码云上创建仓库后 复制仓库地址 比如 https://github.com/lujianing/demo.git在intellij中 VCS——Checkout from Version Contrl——Git中 粘贴仓库url地址会从github仓库中拷贝一份项目 然后就可以在本地直接进行git操作并且可以push到github仓库中 (会提示你输入github的仓库和密码)

IDEA使用技巧--将本地项目和git远程项目关联 之前开发没有从头儿搭建过新项目,都是从IDEA配置下项目的git地址,pull代码之后进行开发,提交。这次需要将本地新建的项目push到在git上同样是新建的空项目上去(git上的项目只有工程名和readme文件),两者之前并没有关联,发现如果按照之前的模式处理,会有问题。 比如:先拉取(pull) git上的项目,然后再在此基础上添加新的子模块,会导致子模块无法关联到父模块上,也就是无法引用父p... 阅读详情

相关推荐

使用 Python 获取网络数据

本文介绍了 Python 获取网络数据、使用 requests 库、编写爬虫代码以及使用 IP 代理的方法。Python 的 requests 库非常方便,可以帮助我们快速访问网络资源。编写爬虫程序需要掌握正则表达式、HTTP 协议等知识,同时需要注意爬取速度和频率,以避免对被爬取网站造成负担。最后,使用 IP 代理可以帮助我们隐匿身份,保护我们的网络安全。

互联说 2695

本地项目与Git项目关联

将本地已有的项目与远程的项目指定分支做关联,并实现push

H_Dsheng的博客 8936

Verilog基础知识11(异步FIFO为什么使用格雷码(gray-code) )

需求说明:Verilog设计 内容       :第一部分 异步FIFO为什么使用格雷码                   第二部分 格雷码在异步FIFO中的使用 来自       :时间的诗 第一部分 异步FIFO为什么使用格雷码 原文:http://www.cnblogs.com/kxk_kxk/p/3931591.html 异步FIFO通

时间的诗 8888

【精】将本地项目关联到git上面

1.github上面创建新项目 2.初始化项目 首先加入git提交忽略的文件.gitignore文件 .idea 忽略以.idea文件 logs/ 忽略logs文件夹 *.iml 忽略以iml结尾的文件 target/ 忽略target文件夹 右击VueBack文件夹根目录,点击“Git Bash Here”,打开git命令行。 3. 将文件夹加入git管理 git init ...

【冯立雄】的博客 1192

Wan 3.0提示词实战:从抄作业到改作业的完整技巧

AI视频生成中,提示词是决定成片质量的核心。视频模型依赖于文字约束来定义运动轨迹、镜头语言与物理合理性,提示词工程因此成为连接创意与技术的关键。本文从提示词的结构、资源获取、优化方法入手,结合Wan 3.0的模型特点,梳理了从官方模板到社区案例的实战路径,并强调运动一致性、风格词堆砌等常见问题。通过分解主体、动作、镜头等维度,帮助创作者快速找到适配的提示词,提升视频生成的稳定性与惊喜感。

weixin_29483277的博客 350

保姆级教程:在RK3568开发板上手把手配置RMII百兆以太网DTS节点

本文提供了一份详细的RK3568开发板RMII百兆以太网DTS节点配置教程,涵盖基础概念解析、关键参数设置、实际操作步骤及常见问题排查。通过手把手指导,帮助开发者快速完成RK3568开发板的以太网配置,特别适合嵌入式系统开发者参考。

weixin_33686714的博客 137

本地项目关联远程 git 仓库

用了几年 git 来管理代码,除了常用的提交代码的一些指令,其他的每次用到都需要查一次资料,这样很麻烦。最近有一个新项目需要关联远程仓库,我自己也整理了一下。 安装 Git:官网 下面介绍几种方法: 一、代码 clone 到本地 这种方法是直接 clone 代码,这样不需要在手动关联仓库。 1、本地创建空白文件夹 2、右键 Git Bash Here 打开控制台 3、直接 clone 远程仓库的代码 git clone 远程地址(ssh、http) 1 然后正常的代码提交就可以了。 二、...

Purpletaro的专栏 8983

Lakes.AERMOD.View.v8.9.0 1CD大气扩散模型软件包

Lakes.AERMOD.View.v8.9.0 1CD大气扩散模型软件包 Lakes Environmental ARTM View v1.4.2 1CD放射物扩散模拟模型 Aermod View是一套完整的、功能强大的大气扩散模型软件包,并将美国EPA指定的大气扩散模型(如下)完美的集成成为一个综合的操作平 台: - AERMOD 电话TEL:18980583122  客服 QQ:11

yyii0000的博客 4001

新建本地vue项目后,怎样跟git库关联起来

本地新建vue项目 1、在目标文件夹下打开cmd 2、在已经安装node的基础下,执行命令npm install -g @vue/cli 3、执行vue create project-name,这里"project-name"指项目名称 在gitee库里新建仓库 1、新建仓库后,得到https地址 2、用idea打开新建的本地项目后,如下进行 此时,本地项目和git库就关联起来了,就可以进行更新和提交了 ......

qq_36877078的博客 1663

openclaw通俗入门系列9——流式传输 + 分块

流式传输 = 不等写完就开始发。分块流式传输是把长回复切成几条消息发(所有渠道),草稿流式传输是像打字一样实时显示(仅 Telegram)。可以配置块大小、发送时机、合并规则、类人延迟。

m0_60605453的博客 506

Open3D 点云变换【2025最新版】

点云平移、旋转、缩放、欧式变换的python代码实现。博客长期更新,本文最近更新时间为:2025年1月16日。

点云侠的博客 37万+

本地项目连接gitee仓库

的缩写,它会强制推送本地的master分支到远程仓库,即使有冲突或远程仓库有更改。那个master是分支的意思,刚创建的仓库的分支默认的是master,所以推送至master分支。来获取远程仓库的最新更改,然后尝试将这些更改合并到当前分支。将这些更改推送到远程仓库,以便与团队成员共享或备份你的工作。记住,推送前最好先确保本地和远程仓库是同步的,以免出现冲突。是一个方便的命令,可以快速将远程更改同步到本地工作区。当你在本地完成了一些更改并提交到本地仓库后,你可以使用。是注释,也就是对提交了什么文件进行说明。

dsbss的博客 1451

深度学习工具包 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将本地项目关联远程仓库

将本地项目关联到远程仓库是 Git 常见的操作之一,特别是在开始一个新项目或将现有的本地项目推送到远程服务器上时。

sinat_41883985的博客 1667

SIMATIC S7-1200, S7-1500 PID 控制[手册]

SIMATIC S7-1200, S7-1500 PID 控制[手册]

数学建模模型总结

这是本人在两年内准备参加数学建模竞赛搜集到的模型资料,已经经过了本人的筛选和整理,希望能够对准备参加数学建模竞赛的学弟学妹们提供一些帮助!

【git】 本地项目关联到远程项目

过程比较简单,但是无比理解【工作空间】【本地仓库】【远程仓库】几个概念。 工作空间 可以理解为我们编写代码、经常会修改到的文件或文件夹,一般就是我们肉眼可见的项目。 本地仓库 当我们初始化(git init)之后,会在当前目录下生成一个与项目并列的.git文件夹,当我们对项目作出更改之后使用git commit命令,一般是将修改提交到本地仓库,也就是该文件夹下面的文件会对应修改,请注意,此...

浮生九记 3248

Statistics and Machine Learning Toolbox

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

【关联git本地仓库,上传项目到github】

Git 是一个免费的开源分布式版本控制系统,你可以使用它来跟踪文件中的更改。GitHub是一个基于git的代码托管平台,在github上可以建立仓库用于存放项目。

zzzyyy8的博客 1947

将本地项目与远程 Git 仓库关联的完整步骤

本文详细介绍了如何将本地项目与远程Git仓库关联的操作步骤。整个流程清晰明了,适合Git初学者快速上手本地与远程仓库的关联操作。

x15514104477的博客 4808

本地项目关联到远程git仓库

原文地址:https://blog.youkuaiyun.com/vi_error/article/details/80608793# 本地项目关联到远程git仓库 场景是这样的:在gitee-code上新建一个项目,gitee会帮你把项目初始化,初始化之后会根据你的选择生成默认的说明文件和gitignore文件。这个时候你就可以复制一下这个项目的地址,准备和本地的项目关联到一起了。 将这个场景扩大化,...

yang1780409810的博客 788

Git---本地项目关联远程项目, 并推送到远程新分支

1. git 本地项目关联远程项目, 并推送到远程新分支(推送时在远程新建立一个分支) 1.1 在git bash 中或其他命令行中进入本地项目文件夹 1.2 创建本地仓库 git init . 注意后面的 . 意思是当前目录,不能省略 1.3 把本地项目提交到本地仓库: #先把当前路径下的所有文件添加到缓存 git add . #提交缓存中的修改到本地仓库 git commit -m "提交信息日志记录什么写这里" 1.4 本地关联远程仓库 git remote add origin {

知北行的博客 4764

git本地项目关联云端仓库及git常用指令

git remote add origin git@XXX.com:xxx/XXX.git:将本地仓库关联到远程仓库。将~/.ssh目录中有一个 id_rsa.pub文件,将其中的信息复制一下,加入到云端ssh密钥中即可。git push -u origin branch_xxx: 将本地的某个分支推送到远程仓库。在本地创建一个文件夹然后输入 git init 把这个文件夹初始化为我们的仓库。xxx:是添加到分支中的备注 或者可以理解为此版本名字。然后我们就可以把自己的项目添加或者创建仓库里面。

这知识都不进脑子啊! 1029

git本地项目关联远程github

git本地项目关联远程github git remote add origin git.git

weixin_44038355的博客 209

如何将已经存在的本地项目源码关联到远程git仓库中

场景:用户想将本地已有的frontend和backend两个项目关联到同一个Git仓库中。这是一个很常见的场景,特别是前后端分离项目中需要统一管理代码的情况。如何将已经存在的本地项目源码关联到远程git仓库中,这是一个非常使用的操作。我们给大家举一个案例进行讲解,大家可以参考学习。思路:在同一个仓库中为每个项目创建独立目录(如。),提交时所有文件共享同一条历史记录。解释:上面命令规则与作用范围。,添加需忽略的文件(如。

自强不息,厚德载物,未来可期 502

本地项目关联到远程git

1、在远程git上新建项目 2、本地项目根目录下进行 git init 3、git commit -m 'frist commit' 4、git remote add origin git@github.com:your name/repository name.git // 将本地仓库和你自己的远程仓库关联起来,origin是仓库的名字 5、git push origin master ...

blueSky的博客 2466

本地项目关联到git

第一步:cd到你的本地项目根目录下,执行git命令 git init 第二步:将项目的所有文件添加到仓库中 git add . 如果想添加某个特定的文件,只需把.换成特定的文件名即可 第三步:将add的文件commit到仓库 git commit -m "注释语句" 第四步:去github上创建自己的Repository,拿到创建的仓库的https地址 第五步:重点来了,将本地的仓库关联到g...

qq_43103581的博客 289
上一篇: JAVA23种设计模式之享元模式(蝇量模式)
下一篇: JAVA23种设计模式之解释器模式
CoderJu
博客等级 码龄11年 11粉丝 82原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值