Git - What Is Origin in Git Push Origin Main

What is origin in git push origin main? The origin is a convention. It’s an alias, short for what we see from the output of git remote -v. You can name it whatever you want. You can think of it as where this code is “originated” from. git remote -v # output origin git@github.com:derrykid/workongit.git (fetch) origin git@github.com:derrykid/workongit.git (push) Set the remote URL as origin and upstream Whenever we pull the code from remote repository, it flows downstream....

November 12, 2022 · 1 min · Derry

Git - How to Switch From Password Prompt to Ssh

GitHub has terminated the login from password in command line. You can switch to SSH. This tutorial will guide you how to do it. Git switch from password to SSH What I do is switch remote URLs from HTTPS to SSH. By doing this, the password prompt is no longer there and I can push directly. Usually we use git clone https://github.com/USERNAME/repo.git to get the clone the remote repo to local machine....

November 12, 2022 · 1 min · Derry

Git Cheatsheet

I learn git from this interactive tutorial. I take note along the way while I was doing it. Learn git visual Commit to repo We was on C1 commit git commit Branch new branch git branch <name> change branch git checkout <name> create a new branch and check it out It can be shorthand: git checkout -b <name> merge Now we are working on main branch We are going to merge the branch bugFix into main...

June 27, 2022 · 5 min · Derry