Migrating an existing repo from on-premises to cloud
Santosh Sharma Poudel
0:00 / 0:00
Migrating an existing repo from on-premises to cloud
17 просмотров · 7 дн. назад
Santosh Sharma Poudel
4 подписчика
17 просмотров · 7 дн. назад
Dell@DESKTOP-ARPL9BO MINGW64 ~/gitlabproject (dummy)
$ cat ~/.ssh/id_ed25519.pub
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILH8LkYEUbgB69fE99DDgQYqeRxpeucCsS4zYEaE8aXp Dell@DESKTOP-ARPL9BO
Note: We will get mail state that "Hi Santosh Sharma Poudel!
A new public key was added to your account:
title: ssh_key
If this key was added in error, you can remove it under SSH keys"
Dell@DESKTOP-ARPL9BO MINGW64 ~/gitlabproject (dummy)
$ ssh -T git@gitlab.com
Welcome to GitLab, @poudelsantoshsharma!
Dell@DESKTOP-ARPL9BO MINGW64 ~/gitlabproject (dummy)
$ ssh -Tv git@gitlab.com
debug1: Connection established.
debug1: Local version string SSH-2.0-OpenSSH_10.5
Welcome to GitLab, @poudelsantoshsharma!
Dell@DESKTOP-ARPL9BO MINGW64 ~/gitlabproject (dummy)
$ git remote show
origin
Dell@DESKTOP-ARPL9BO MINGW64 ~/gitlabproject (dummy)
$ git remote show origin
remote origin
Fetch URL: git@gitlab.reposerver.com:centos/gitlabproject.git
Push URL: git@gitlab.reposerver.com:centos/gitlabproject.git
HEAD branch: main
Remote branches:
dummy tracked
main tracked
Local branches configured for 'git pull':
dummy merges with remote dummy
main merges with remote main
Local refs configured for 'git push':
dummy pushes to dummy (up to date)
main pushes to main (up to date)
Dell@DESKTOP-ARPL9BO MINGW64 ~/gitlabproject (dummy)
$ git remote add cloud git@gitlab.com:poudelsantoshsharma/gitlabp
roject.git
Dell@DESKTOP-ARPL9BO MINGW64 ~/gitlabproject (dummy)
$ git remote show
cloud
origin
Dell@DESKTOP-ARPL9BO MINGW64 ~/gitlabproject (dummy)
$ git branch
0r
dummy
main
Dell@DESKTOP-ARPL9BO MINGW64 ~/gitlabproject (dummy)
$ git push cloud dummy
To gitlab.com:poudelsantoshsharma/gitlabproject.git
[new branch] dummy - dummy
Dell@DESKTOP-ARPL9BO MINGW64 ~/gitlabproject (dummy)
$ git status
On branch dummy
Your branch is up to date with 'origin/dummy'.
Changes not staged for commit:
modified: index.php
Dell@DESKTOP-ARPL9BO MINGW64 ~/gitlabproject (dummy)
$ git add index.php
Dell@DESKTOP-ARPL9BO MINGW64 ~/gitlabproject (dummy)
$ git commit -m "migration to remote"
[dummy a6694aa] migration to remote
1 file changed, 1 insertion(+)
Dell@DESKTOP-ARPL9BO MINGW64 ~/gitlabproject (dummy)
$ git status
On branch dummy
Your branch is ahead of 'origin/dummy' by 1 commit.
(use "git push" to publish your local commits)
nothing to commit, working tree clean
Dell@DESKTOP-ARPL9BO MINGW64 ~/gitlabproject (dummy)
$ git push cloud head
To gitlab.com:poudelsantoshsharma/gitlabproject.git
a96bc1a..a6694aa head - dummy
Dell@DESKTOP-ARPL9BO MINGW64 ~/gitlabproject (dummy)
$ git branch dummy2
Dell@DESKTOP-ARPL9BO MINGW64 ~/gitlabproject (dummy)
$ git branch
0r
dummy
dummy2
main
Dell@DESKTOP-ARPL9BO MINGW64 ~/gitlabproject (dummy)
$ git switch dummy2
Switched to branch 'dummy2'
Dell@DESKTOP-ARPL9BO MINGW64 ~/gitlabproject (dummy2)
$ git push cloud dummy2
To gitlab.com:poudelsantoshsharma/gitlabproject.git
[new branch] dummy2 - dummy2
Dell@DESKTOP-ARPL9BO MINGW64 ~/gitlabproject (dummy2)
$ ls
folder/ index.html storage/ testgit.html
gitlabproject/ index.php test1.html
Dell@DESKTOP-ARPL9BO MINGW64 ~/gitlabproject (dummy2)
$ git branch -M dummy4
Dell@DESKTOP-ARPL9BO MINGW64 ~/gitlabproject (dummy4)
$ git branch
0r
dummy
dummy4
main
Dell@DESKTOP-ARPL9BO MINGW64 ~/gitlabproject (dummy4)
$ git push cloud dummy4
To gitlab.com:poudelsantoshsharma/gitlabproject.git
[new branch] dummy4 - dummy4
Dell@DESKTOP-ARPL9BO MINGW64 ~/gitlabproject (dummy4)
$ git branch -M dummy
Dell@DESKTOP-ARPL9BO MINGW64 ~/gitlabproject (dummy)
$ git branch -m dummy dummy5
Dell@DESKTOP-ARPL9BO MINGW64 ~/gitlabproject (dummy5)
$ git branch
0r
dummy5
main
Dell@DESKTOP-ARPL9BO MINGW64 ~/gitlabproject (dummy5)
$ git push cloud dummy5
To gitlab.com:poudelsantoshsharma/gitlabproject.git
[new branch] dummy5 - dummy5
Dell@DESKTOP-ARPL9BO MINGW64 ~/gitlabproject (dummy5)
$ git switch -c dummy6
Switched to a new branch 'dummy6'
Dell@DESKTOP-ARPL9BO MINGW64 ~/gitlabproject (dummy6)
$ git checkout dummy2
branch 'dummy2' set up to track 'cloud/dummy2'.
Switched to a new branch 'dummy2'
Dell@DESKTOP-ARPL9BO MINGW64 ~/gitlabproject (dummy2)
$ git push cloud dummy2
Everything up-to-date
Dell@DESKTOP-ARPL9BO MINGW64 ~/gitlabproject (dummy2)
$ git push cloud dummy6
remote:
To gitlab.com:poudelsantoshsharma/gitlabproject.git
[new branch] dummy6 - dummy6
Remove Remote Repository on GitLab
• Remove Remote Repository on GitLab