kaylinkhanal / git-training

1 stars 0 forks source link

git commands #1

Open kaylinkhanal opened 1 year ago

kaylinkhanal commented 1 year ago

Cloning a fresh repo

  1. Git clone ……………linktoyourrepo…………

How to create a branch, add changes and push

  1. Create a branch =>git checkout -b staging
  2. Make changes to your code
  3. Adding code change => git add .
  4. Adding commit messages => git commit -m "poping an array"
  5. Push to remote => git push -u origin staging
kaylinkhanal commented 1 year ago

Adding your existing code to new git repo

git init git remote add .........

How to create a branch, add changes and push

Create a branch =>git checkout -b staging Make changes to your code Adding code change => git add . Adding commit messages => git commit -m "poping an array" Push to remote => git push -u origin staging

YamrajShrestha commented 1 year ago

cd .. (cd space dot dot enter) command will set you one step back