DEV Community

Ajay Raja
Ajay Raja

Posted on

Java_D4&&How to push the code in GIT using Linux Mint....

First_Program

Today in class I learnt to push the file in git and did some basic programs in java in operators topic.

Git using Terminal

I will Take some basic coding example to show how to push
Step 1:

---In this image i already created one project in git with my name.If you are doing by seeing this kindly create new project.

Step 2:
Create one folder in your Desktop or wherever but need to give correct path in terminal to push your code.
I created in Desktop and I choosed one folder and created one file
name .java


In this i created one folder in my Desktop named java and in that i named JavaBeginers and created one .java file named sample.java.

Step 3:


In this I writtened one code with use of some Arithmetic operators
i opened that file and typed the code and save the file.

Step 4:
Go to the folder which you have created the file and right click and you will see some option from that click open Terminal


This is the terminal which i got

step 5:
Firstly you need to clone the project from git to terminal using the code


Using the second one code for that
1.git clone ("that 2nd link")
2.git add "your file name with .java"
3.git commit -m"my second program is" in quotes use whatever you want
4.git push...it will ask username and password give that
5.finally you will get like this


6.Refresh your gitlab account


you got the file like sample.java.....like this you need to push for pull search the command and do......

Top comments (1)

Collapse
 
manikandan_a8f99e0153ef77 profile image
MANIKANDAN

Super 🤟