Skip to main content

Git commands

git init - initialize git in your local machine

git status - show the status of the branch

git add [name_of_the-file] - adding specific files to be committed

git add. - adding all files in the folder to be committed

git checkout -b [branch-name] - create a new branch

git commit -m 'comment' - commit and leave a comment

git push origin [branch_name] - push changes to the specified branch

git pull origin [branch_name] - pull everything from the specified branch

git remote add origin [url_of_the_branch] - adding an existing repository that was created on GitHub

git remote -v     - lists git remotes at the current directory 

git clone [url] - fetching code from GitHub to your local machine

git log - history

Connect Repo

$ git remote add origin [remote rpo URL]
#Sets the new remote
$ git remote -v 
#verifies the new remote URL

git push -u origin main

Workflow in Github

Fork the project to your own GitHub
Clone the url of the project to your own machine
Do your changes
Push the content to GitHub
Then do the pull request for the permission to add your changes to original repo
Add description for your changes.

Join the discussion 2 Comments

Subscribe For More Updates

 

Join our mailing list to receive the latest news and updates from our team.

You have Successfully Subscribed!