欧美一级特黄大片做受成人-亚洲成人一区二区电影-激情熟女一区二区三区-日韩专区欧美专区国产专区

詳解git倉庫遷移的兩種解決方案

Git倉庫遷移而不丟失log的方法

專注于為中小企業(yè)提供網(wǎng)站制作、成都網(wǎng)站建設服務,電腦端+手機端+微信端的三站合一,更高效的管理,為中小企業(yè)榮縣免費做網(wǎng)站提供優(yōu)質(zhì)的服務。我們立足成都,凝聚了一批互聯(lián)網(wǎng)行業(yè)人才,有力地推動了超過千家企業(yè)的穩(wěn)健成長,幫助中小企業(yè)通過網(wǎng)站建設實現(xiàn)規(guī)模擴充和轉(zhuǎn)變。

要求能保留原先的commit記錄,應該如何遷移呢?

同時,本地已經(jīng)clone了原倉庫,要配置成新的倉庫地址,該如何修改呢?

注意:如果使用了代碼審核工具Gerrit,那么在進行操作之前需要將Gerrit關掉,等成功恢復后再將Gerrit開戶即可

1、使用git push --mirror

先了解一些git的基本參數(shù)介紹

git clone --bare

GIT-CLONE(1)      Git Manual      GIT-CLONE(1)

NAME
  git-clone - Clone a repository into a new directory

SYNOPSIS
  git clone [--template=<template_directory>]
     [-l] [-s] [--no-hardlinks] [-q] [-n] [--bare] [--mirror]
     [-o <name>] [-b <name>] [-u <upload-pack>] [--reference <repository>]
     [--depth <depth>] [--recursive] [--] <repository> [<directory>]
  --bare
   Make a bare GIT repository. That is, instead of creating <directory> and placing the administrative files
   in <directory>/.git, make the <directory> itself the $GIT_DIR. This obviously implies the -n because there
   is nowhere to check out the working tree. Also the branch heads at the remote are copied directly to
   corresponding local branch heads, without mapping them to refs/remotes/origin/. When this option is used,
   neither remote-tracking branches nor the related configuration variables are created.

git push --mirror
--mirror
   Instead of naming each ref to push, specifies that all refs under refs/ (which includes but is not limited
   to refs/heads/, refs/remotes/, and refs/tags/) be mirrored to the remote repository. Newly created local
   refs will be pushed to the remote end, locally updated refs will be force updated on the remote end, and
   deleted refs will be removed from the remote end. This is the default if the configuration option
   remote.<remote>.mirror is set.

1、建立新倉庫

1). 從原地址克隆一份裸版本庫,比如原本托管于 GitHub,或者是本地的私有倉庫

git clone --bare git://192.168.10.XX/git_repo/project_name.git

2). 然后到新的 Git 服務器上創(chuàng)建一個新項目,比如 GitCafe,亦或是本地的私有倉庫,如192.168.20.XX

su - git
cd /path/to/path/
mkdir new_project_name.git
git init --bare new_project_name.git

3). 以鏡像推送的方式上傳代碼到 GitCafe 服務器上。

請確保已經(jīng)添加了公鑰到新的機器上

cd project_name.git
git push --mirror git@192.168.20.XX/path/to/path/new_project_name.git

4). 刪除本地代碼

cd ..
rm -rf project_name.git

5). 到新服務器上找到 Clone 地址,直接Clone到本地就可以了。

git clone git@192.168.20.XX/path/to/path/new_project_name.git

這種方式可以保留原版本庫中的所有內(nèi)容。

2、切換remote_url

先查看remote的名字

git branch -r

假設你的remote是origin,用git remote set_url 更換地址

git remote set-url origin remote_git_address

remote_git_address更換成你的新的倉庫地址。

第二種切換remote_url的方法更直接,直接更改.git/conf配置文件里的ip地址就行。

以上就是本文的全部內(nèi)容,希望對大家的學習有所幫助,也希望大家多多支持創(chuàng)新互聯(lián)。

當前題目:詳解git倉庫遷移的兩種解決方案
文章分享:http://www.aaarwkj.com/article42/godeec.html

成都網(wǎng)站建設公司_創(chuàng)新互聯(lián),為您提供搜索引擎優(yōu)化、品牌網(wǎng)站建設響應式網(wǎng)站、品牌網(wǎng)站設計、用戶體驗動態(tài)網(wǎng)站

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

成都定制網(wǎng)站建設
丰满人妻侵犯中文字幕| 亚洲天堂av在线播放| 风韵丰满熟妇老熟女啪啪| 久久女婷五月综合色啪色老板| 久久久偷拍美女撒尿尿| 免费午夜福利一区二区| 精品久久久久久久久极品| 久久成人影院免费观看| 日本欧美自拍偷拍高清| 亚洲青青草原自拍偷拍| 亚洲国内一区二区三区| 五月婷婷六月丁香俺来也| 久久国产精品人妻av| 国产成人一区二区二区三区| 精品福利视频一区二区| 日韩视频 一区 二区| 亚洲毛片高清一区二区三区| 三级视频一区二区三区| 久久尤物av天堂日日综合| 日韩国产一区二区在线观看| 欧美黄片不用下载在线观看| 日韩av一区二区三区在线| 无遮挡国产精品一级二级三级视频| 热九九这里只有热九九| 中文字幕国产精品专区| 亚洲黄色大片在线免费观看| 日本免费熟女一区二区| 日本熟妇中文字幕系列| 老湿机午夜十分钟视频| 日韩中文字幕在线二区| 中文字幕av在线日韩| 亚洲国产精品激情在线| 萌白的所有视频在线观看| 日韩一区二区三区91| 国内精品一区二区欧美| 一本色道久久88综合日韩 | 日本高清免费黄色录像| 午夜欧美激情在线视频| 国产精品久久一区二区三区蜜桃 | 日韩av在线国产观看| 久久亚洲一本综合久久|