0% found this document useful (0 votes)
4 views3 pages

Git Commands for Repository Management

The document outlines a series of Git commands executed in a terminal, including initializing repositories, adding remote origins, cloning branches, and managing commits. It details attempts to clone a specific branch and the subsequent addition of remote repositories. The commands illustrate interactions with GitLab repositories and the status of branches during the process.

Uploaded by

vivek kumar
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views3 pages

Git Commands for Repository Management

The document outlines a series of Git commands executed in a terminal, including initializing repositories, adding remote origins, cloning branches, and managing commits. It details attempts to clone a specific branch and the subsequent addition of remote repositories. The commands illustrate interactions with GitLab repositories and the status of branches during the process.

Uploaded by

vivek kumar
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

Hp@DESKTOP-4C0HEVK MINGW64 /d/GITLAB FOLDER

$ git init
Initialized empty Git repository in D:/GITLAB FOLDER/.git/

Hp@DESKTOP-4C0HEVK MINGW64 /d/GITLAB FOLDER (master)


$ git remote add origin [Link]

Hp@DESKTOP-4C0HEVK MINGW64 /d/GITLAB FOLDER (master)


$ git pull origin master
remote: Enumerating objects: 74, done.
remote: Total 74 (delta 0), reused 0 (delta 0), pack-reused 74
Unpacking objects: 100% (74/74), 18.45 KiB | 6.00 KiB/s, done.
From [Link]
* branch master -> FETCH_HEAD
* [new branch] master -> origin/master

git clone -b <<branch name>> <<remote url>>


git fetch <<remote name>>
git checkout <<branch name>>

-----------------------------------------------------------------------------------
----------
Hp@DESKTOP-4C0HEVK MINGW64 /d/vivekgorai
$ git clone -b STB-V1 [Link]
Cloning into 'integration'...
fatal: Remote branch STB-V1 not found in upstream origin

Hp@DESKTOP-4C0HEVK MINGW64 /d/vivekgorai


$ git clone -b STB-V1 [Link]
Cloning into 'integration-1'...
remote: Enumerating objects: 45, done.
remote: Counting objects: 100% (45/45), done.
remote: Compressing objects: 100% (26/26), done.
remote: Total 45 (delta 4), reused 45 (delta 4), pack-reused 0
Receiving objects: 100% (45/45), 8.23 KiB | 138.00 KiB/s, done.
Resolving deltas: 100% (4/4), done.

Hp@DESKTOP-4C0HEVK MINGW64 /d/vivekgorai


$ cd integration1
bash: cd: integration1: No such file or directory

Hp@DESKTOP-4C0HEVK MINGW64 /d/vivekgorai


$ cd integration-1

Hp@DESKTOP-4C0HEVK MINGW64 /d/vivekgorai/integration-1 (STB-V1)


$ git remote add parent [Link]

Hp@DESKTOP-4C0HEVK MINGW64 /d/vivekbhosdi/integration-1 (STB-V1)


$ git remote -v
origin [Link] (fetch)
origin [Link] (push)
parent [Link] (fetch)
parent [Link] (push)
Hp@DESKTOP-4C0HEVK MINGW64 /d/vivekgorai/integration-1 (STB-V1)
$ git remote add integration-1 [Link]

Hp@DESKTOP-4C0HEVK MINGW64 /d/vivekggorai/integration-1 (STB-V1)


$ git commit -m "updated"
On branch STB-V1
Your branch is up to date with 'origin/STB-V1'.

Changes not staged for commit:


(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: src/main/java/com/jsp/facebook/entity/[Link]

Untracked files:
(use "git add <file>..." to include in what will be committed)
src/main/java/com/jsp/facebook/entity/[Link]

no changes added to commit (use "git add" and/or "git commit -a")

Hp@DESKTOP-4C0HEVK MINGW64 /d/vivekgorai/integration-1 (STB-V1)


$ git pull parent STB-V1
From [Link]
* branch STB-V1 -> FETCH_HEAD
* [new branch] STB-V1 -> parent/STB-V1
Already up to date.

Hp@DESKTOP-4C0HEVK MINGW64 /d/vivekgorai/integration-1 (STB-V1)


$ cd integration-1
bash: cd: integration-1: No such file or directory

Hp@DESKTOP-4C0HEVK MINGW64 /d/vivekgorai/integration-1 (STB-V1)


$ git push parent STB-V1
Everything up-to-date

-----------------------------------------------------------------------------------
--------------------------------------------

Hp@DESKTOP-4C0HEVK MINGW64 /d/management


$ git init
Initialized empty Git repository in D:/management/.git/

Hp@DESKTOP-4C0HEVK MINGW64 /d/management (master)


$ git remote add origin [Link]

Hp@DESKTOP-4C0HEVK MINGW64 /d/management (master)


$ git config --global [Link] "vivek52331@[Link]"

Hp@DESKTOP-4C0HEVK MINGW64 /d/management (master)


$ git status
On branch master

No commits yet

nothing to commit (create/copy files and use "git add" to track)

Hp@DESKTOP-4C0HEVK MINGW64 /d/management (master)


$ git remote -v
origin [Link] (fetch)
origin [Link] (push)
Hp@DESKTOP-4C0HEVK MINGW64 /d/management (master)
$ git clone -b master [Link]
Cloning into 'integration'...
remote: Enumerating objects: 54, done.
remote: Counting objects: 100% (54/54), done.
remote: Compressing objects: 100% (36/36), done.
remote: Total 54 (delta 5), reused 12 (delta 2), pack-reused 0
Receiving objects: 100% (54/54), 66.61 KiB | 5.55 MiB/s, done.
Resolving deltas: 100% (5/5), done.

Hp@DESKTOP-4C0HEVK MINGW64 /d/management (master)


$ git pull origin master
remote: Enumerating objects: 40, done.
remote: Counting objects: 100% (40/40), done.
remote: Compressing objects: 100% (29/29), done.
remote: Total 40 (delta 3), reused 2 (delta 0), pack-reused 0
Unpacking objects: 100% (40/40), 63.00 KiB | 43.00 KiB/s, done.
From [Link]
* branch master -> FETCH_HEAD
* [new branch] master -> origin/master

You might also like