Git commands

Git commands

1 . Know remote repository name

git config --get remote.origin.url

2 . Remote Branch current 

 git branch 

3 . Remote branch all 
 git branch --all

4 . Git initialization  

 git init (you need to do it first to run any git command)

5 . Add all code or changes

git add --all

6 . Git commit 

 git commit -m "commit name"

7 . Git remote repository add 

  git remote add origin "url"

8. Git push 

 git push origin master (master is branch name)

9 . Switch branch 

 git checkout branchname

10 . Create new branch 

 git checkout -b "branchname"

Leave a Reply

Your email address will not be published. Required fields are marked *