*INSTALLATION *
step 1:Register -> sign in ->sign up in GITLAB
step 2: Install VisualStudio
step 3:
In Command Prompt
Copy - ctrl + shift + C
Paste - ctrl + shift + V
Command Prompt
1. check the Git Version
git --version
2. Install Git by command
sudo apt install git
password: Welcome@123
y / n
y
3. Updating latest Version
sudo apt update
4. Updating System
sudo apt upgrade
step 4:
In GITLAB
Group -> New group -> Create Group -> Group Name -> Visibility level -> Public -> Who will be using this group? Just me -> Create Group
step 5: Click Project -> Create Blank Project -> give project name -> Change Visibility Level -> Create Project
GIT CLONE
Step 1: In GITLAB
Select Group -> Project -> Click that particular Project -> Code -> Clone with HTTPS -> Copy URL
Step 2: Select Location in Computer Folder
File Manager -> Documents -> right click -> create New Folder -> Select that particular folder ,right click -> Open In Terminal
step 3:
In Command Prompt:
git clone (Paste the copied URL)
Working Directory to Remote Repository
step 1: select the particular folder location in computer
open in terminal(creating txt file in computer folder)
git status
touch file1.txt
git status
step 2: change untracked file into tracked file(working file to staging area)
open in terminal
git add file1.txt
git status
If you want to untracked the file
git restore --staged file1.txt
git status
Add all files
git add .
git status
step 3: change staging area files to local repository
git commit -m "learn git"
git config --global user.name"priya K"
git config --global user.email priya.k.2021.ad@ritchennai.edu.in
git config --list
step 4: local repository file to remote repository
git status
git log (see commit message)
git push
username:
password:
check the file in remote repository
Edit the file in Remote Repository (write in gitlab file) and working directory
step 1: Edit the file in Remote Repository
gitlab-> project ->click file1.txt file(empty file) -> edit -> open in web IDE(type a mesage in txt file) -> save the file as ctrl + s
-> branch symbol in left corner(click that symbol)->give commit message -> commit to main -> continue
step 2:Edit the file in working directory
select the folder in computer location
give right click -> open in terminal
open in terminal
git status(nothing to commit)
git pull
open the file in working directory
delete the file
in computer folder -> select the file and delete it.
open in terminal
git clear
git status
git add file1.txt
git status
git clear
git commit -m "deleted"
git push
username
password
deleted that file in gitlab
create a file in computer folder
touch file2.txt(create a file in computer folder)
git status
git add .
git commit -m "second"
git push
username:
password:
rename a file
in computer folder -> right click -> rename ->git status
git add file1.txt
git commit -m"one file"
git push
username:
password:
git add .
git commit -m"second file"
git push
username :
password :
deleted file2.txt
git log
q(to come out)
git log --oneline
git diff
select the folder in computer location -> open with notepad ->type a message and save it (ctrl + S)
in terminal
git diff
git status(nothing to commit)
git branch
**create a branch**
syntax : git branch branch_name
git branch test
git branch
ls(list of file)(linux command)
go from one branch to another branch
syntax: git checkout branchname
git checkout test(switched to test)
git branch
ls
Rename the branch name
syntax : git branch -m oldname newname
git branch -m test testing
git branch
delete the branch
syntax: git branch --delete branchname
git branch --delete testing
git branch
git checkout main
git branch
git branch --delete test
git branch
deleted branch test
git conflict
after pushing the file
in gitlab -> edit -> open in webid -> type a message and save it(ctrl + s) -> branch symbol at left corner -> commit to main
refresh the file in gitlab
type another message in webid
click that file in computer location and right click and open in terminal
git status(modified)
git pull
username:
password:
(overwritten error)
git stash
git pull
username:
password:
open in both open in webid and gitlab
take back from stash
git stash pop
change the message in webid and save it(ctrl + s)
open in terminal
git status(modified)
git add .
git commit -m"learn commit"
git push
username:
password:
conform by opening in gitlab
git merge
git branch
git branch develop(create a branch)
git branch
git checkout develop(move to develop branch)
git branch
type a message in webid and save it
open in terminal
git status(modified)
git add file1
git status
git commit -m"commited from dev branch"
git checkout main
git status
git branch
reflect the changes from develop branch to main branch
open in terminal
git merge develop
git push
username:
password:
open that file in gitlab main branch
Top comments (0)