DEV Community

Sugumar R
Sugumar R

Posted on

1

Day 3: How to push code GitLab?

step 1:

Open your Terminal Type the comand.

Commands:-

1.Check Git version version git --version
2.install Git in your local repo-> sudo apt install git

Image description

1.Go to GitLab and log in.
2.click New Project -> create Blanck Project.
3.Enter a Project Name(Example: BankAccount).
4.click "Create Project".

[GitLab New Project]

Image description

Image description

step 2:

connect the Git to GitLab.
1.click the code.
2.copy to HTTPS OR SSH url.

Image description

use clone
3.terminal open.
4.clone git (past the origin url).

Image description

setep 4:

1.go to document page.
2.right click open terminal okay.
3.command -> git status.

Image description

.git file
1.git to gitlab connect poin.

Image description

OPen your terminal
1.Type git status.
2.commit your changes with a message git commit -m"The bank account sccessfully!".
3.create a new files->touch AccountUser,touch AccountMobile,touch AccountDetails,touch AccountLoan.
4.Track all changes using Git:
git add .
$ This command adds all new, odified, and deleted files to the staging area.
5.Unstage a file if added by mistake:
git restore --staged accountLoan.
$ This removes the file from saging but does not delete it.
6.view unstaged files git status.
7.Confirm and commit your final changes with a message.
git commit -m"Added financhial details files for baking module"
On branch main

Image description

push the Remote Repository
1.Push your changes to the remote repository:

git push or **git push origin main.

$ This uploads your committed changes from your local repository t the remote repository GitLab.
$ origin" refers to the remote repository.
$ main is the branch name.

Image description

step 5:

Refer the GitLab page

After pushing the repository, you can check the GitLab page to verify that your changes are successfully uploaded.




Image description

AWS Q Developer image

Your AI Code Assistant

Automate your code reviews. Catch bugs before your coworkers. Fix security issues in your code. Built to handle large projects, Amazon Q Developer works alongside you from idea to production code.

Get started free in your IDE

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Engage with a wealth of insights in this thoughtful article, valued within the supportive DEV Community. Coders of every background are welcome to join in and add to our collective wisdom.

A sincere "thank you" often brightens someone’s day. Share your gratitude in the comments below!

On DEV, the act of sharing knowledge eases our journey and fortifies our community ties. Found value in this? A quick thank you to the author can make a significant impact.

Okay