how to setup git in your local machine
how to setup git in your local machine
----------------------------------------------
after installation of git software
we must configure the developer information with git
my developer name: "kasim"
my developer email:"kasim@gmail.com"
step1:create server
step2:login server as ec2-user
step3:switch to root user
sudo -i
step4:Install git software
yum install git -y
step5:create user (developer purpose)& password
useradd kk
passwd kk
123
123
step6:provide an access to the user
edit sshd_config file------> nano /etc/ssh/sshd_config
do some modifications
save modifications
start the service----------> service sshd restart
step7:configure user details
git config --global user.name "kasim"
git config --global user.email "kasim@gmail.com"
step8:check the user configuration details
git config --list
step9:create a folder
mkdir ridesapp
cd ridesapp
step10:intialize the git
git init
step11:open file and write code
nano login.java -->login.java is my file name
press enter button
enter java code
step12:add this code into staging area
git add login.java
step13:commit this code
git commit -m "1st commit"
commit the code ---->version ID / Commit ID(40 length)
---->your will be storing into git repository (local repo)
step14:check all the commits in your local repository
git log
displays all the commits in your local repository
step15:display a particular commit
git show <7 chars of commit ID>
now you push the code into GitHub repo (remote repo)
before push the code into GitHub
you must establish the connection between Git repo and GitHub repo
after that you can push the code and pull the code and clone the code
GIT COMMANDS ---->git commands always start with git
----------------------------------------------
after installation of git software
we must configure the developer information with git
my developer name: "kasim"
my developer email:"kasim@gmail.com"
step1:create server
step2:login server as ec2-user
step3:switch to root user
sudo -i
step4:Install git software
yum install git -y
step5:create user (developer purpose)& password
useradd kk
passwd kk
123
123
step6:provide an access to the user
edit sshd_config file------> nano /etc/ssh/sshd_config
do some modifications
save modifications
start the service----------> service sshd restart
step7:configure user details
git config --global user.name "kasim"
git config --global user.email "kasim@gmail.com"
step8:check the user configuration details
git config --list
step9:create a folder
mkdir ridesapp
cd ridesapp
step10:intialize the git
git init
step11:open file and write code
nano login.java -->login.java is my file name
press enter button
enter java code
step12:add this code into staging area
git add login.java
step13:commit this code
git commit -m "1st commit"
commit the code ---->version ID / Commit ID(40 length)
---->your will be storing into git repository (local repo)
step14:check all the commits in your local repository
git log
displays all the commits in your local repository
step15:display a particular commit
git show <7 chars of commit ID>
now you push the code into GitHub repo (remote repo)
before push the code into GitHub
you must establish the connection between Git repo and GitHub repo
after that you can push the code and pull the code and clone the code
GIT COMMANDS ---->git commands always start with git
Comments
Post a Comment