0% found this document useful (0 votes)
74 views

Today's Task (Git Using Linux Terminal)

Uploaded by

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

Today's Task (Git Using Linux Terminal)

Uploaded by

hamidsaif214
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Git Commands using Linux Terminal (Token Access)

root@DESKTOP-5UVU8GQ:/# git --version


git version 2.34.1
root@DESKTOP-5UVU8GQ:/# apt update
Hit:1 http://archive.ubuntu.com/ubuntu jammy InRelease
Get:2 http://security.ubuntu.com/ubuntu jammy-security InRelease [129 kB]
Get:3 http://archive.ubuntu.com/ubuntu jammy-updates InRelease [128 kB]
Hit:4 http://archive.ubuntu.com/ubuntu jammy-backports InRelease
Fetched 257 kB in 3s (89.9 kB/s)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
55 packages can be upgraded. Run 'apt list --upgradable' to see them.
root@DESKTOP-5UVU8GQ:/# git --version
git version 2.34.1
root@DESKTOP-5UVU8GQ:/# git --version
git version 2.34.1 (After making repo from web interface)
root@DESKTOP-5UVU8GQ:/# git clone https://github.com/mjawadkashif/linuxrepo.git
Cloning into 'linuxrepo'...
remote: Enumerating objects: 3, done.
remote: Counting objects: 100% (3/3), done.
remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
Receiving objects: 100% (3/3), done.
root@DESKTOP-5UVU8GQ:/# ls
bin boot dev etc home init lib lib32 lib64 libx32 linuxrepo lost+found media mnt opt proc root
run sbin snap srv sys tmp usr var
root@DESKTOP-5UVU8GQ:/# cd linuxrepo
root@DESKTOP-5UVU8GQ:/linuxrepo# ls
README.md
root@DESKTOP-5UVU8GQ:/linuxrepo# git status
On branch main
Your branch is up to date with 'origin/main'.
nothing to commit, working tree clean
root@DESKTOP-5UVU8GQ:/linuxrepo# ls
README.md
root@DESKTOP-5UVU8GQ:/linuxrepo# gedit parc
Command 'gedit' not found, but can be installed with:
snap install gedit # version 46.1, or
apt install gedit # version 41.0-3
See 'snap info gedit' for additional versions.
root@DESKTOP-5UVU8GQ:/linuxrepo# apt install gedit (I update “gedit” as it was not available in my
terminal, however students can perform it with the help of nano filename)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
root@DESKTOP-5UVU8GQ:/linuxrepo# gedit parc (This is to create new file and edit it we can edit it
with nano filename)
** (gedit:213395): WARNING **: 15:29:46.218: Set document metadata failed: Setting attribute
metadata::gedit-spell-language not supported
Git Commands using Linux Terminal (Token Access)

** (gedit:213395): WARNING **: 15:29:46.219: Set document metadata failed: Setting attribute
metadata::gedit-encoding not supported
** (gedit:213395): WARNING **: 15:30:07.776: Set document metadata failed: Setting attribute
metadata::gedit-position not supported
root@DESKTOP-5UVU8GQ:/linuxrepo# git status
On branch main
Your branch is up to date with 'origin/main'.
Untracked files:
(use "git add <file>..." to include in what will be committed)
parc

nothing added to commit but untracked files present (use "git add" to track)
root@DESKTOP-5UVU8GQ:/linuxrepo# git add parc
root@DESKTOP-5UVU8GQ:/linuxrepo# git commit -m "create a new file parc"
[main 6efdaf0] create a new file parc
Committer: root <root@DESKTOP-5UVU8GQ>
Your name and email address were configured automatically based
on your username and hostname. Please check that they are accurate.
You can suppress this message by setting them explicitly. Run the
following command and follow the instructions in your editor to edit
your configuration file:
git config --global --edit
After doing this, you may fix the identity used for this commit with:
git commit --amend --reset-author
1 file changed, 1 insertion(+)
create mode 100644 parc
root@DESKTOP-5UVU8GQ:/linuxrepo# git status
On branch main
Your branch is ahead of 'origin/main' by 1 commit.
(use "git push" to publish your local commits)
nothing to commit, working tree clean
root@DESKTOP-5UVU8GQ:/linuxrepo# git push origin main (It will not work like that we have to gen token)
Username for 'https://github.com': mjawadkashif
Password for 'https://[email protected]':
root@DESKTOP-5UVU8GQ:/linuxrepo# git push
https://[email protected]/mjawadkashif/linuxrepo.git
Enumerating objects: 4, done.
Counting objects: 100% (4/4), done.
Delta compression using up to 4 threads
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 312 bytes | 62.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
To https://github.com/mjawadkashif/linuxrepo.git
da17609..6efdaf0 main -> main
root@DESKTOP-5UVU8GQ:/linuxrepo# nano parc
root@DESKTOP-5UVU8GQ:/linuxrepo# git status
root@DESKTOP-5UVU8GQ:/linuxrepo# git commit -m "new line parc"
Git Commands using Linux Terminal (Token Access)

[main 6c3beaa] new line parc


2 files changed, 2 insertions(+)
create mode 160000 linuxrepo
root@DESKTOP-5UVU8GQ:/linuxrepo# git status
On branch main
Your branch is ahead of 'origin/main' by 2 commits.
(use "git push" to publish your local commits)
nothing to commit, working tree clean
First create Token from “Github interface” Go to “Settings” -> “Developer Settings” -> “Personal Access
Token” -> “Tokens (Classic)” -> “Generate New Token (Classic)” -> “Set name, date and copy token”.
root@DESKTOP-5UVU8GQ:/linuxrepo# git push
https://[email protected]/mjawadkashif/linuxrepo.git
Enumerating objects: 5, done.
Counting objects: 100% (5/5), done.
Delta compression using up to 4 threads
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 364 bytes | 121.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
To https://github.com/mjawadkashif/linuxrepo.git
6efdaf0..6c3beaa main -> main
root@DESKTOP-5UVU8GQ:/linuxrepo#

You might also like