Вы находитесь на странице: 1из 2

apt-get update

apt-get install git-core -y


git --version
mkdir /repos
cd /repos
### To get the code , in svn it was checkout command
git clone https://github.com/push05/Asia.git

cd /repos/Asia
vi README.md
This is a Demo Repo Created by Sathya Tech
Hyderabad

git status

git add README.md


git commit -m "metadata"
git push origin master
username push05/ad@
cd .git
git config --global user.name push05
git config --global user.email pushbhai5@gmail.com
cat .gitconfig

vi Demo.java

class Demo
{
p.s.v.main (....)
{
System ...()
}
}

:wq!

git add demo.java (added to stage area)


git commit -m "new file" (added to Local repo)
git push origin master (added to the remote repo)
username : push05/S

#### My requirement is not to ask the password so will be using ssh keys

cd ~/.ssh
ssh-keygen
enter
enter
ls --> id_rsa and id_rsa.pub
copy the public key and go to the webrowser settings --> Deploykey

git remote set-url origin git@gibhub.com:push05/Asia.git

vi sample.c

void main()

{
printf (
}
:wq!

git add sample.c


git commit -m "c-file"
git push origin master
y

Вам также может понравиться