A git local repository can connect to multiple remote repositories
Each remote repository will have a name, by default when we perform clone operation, the name of remote is origin
Clone gets a copy of remote into local repository
in your local repo we will a branch called as main where we can work and in addition to this a branch will be created called as origin/main which represents the remote repo
Condition: When we are sending commits to remote repo. The latest commit id on origin/main and actual remote should be same
PUll = Fetch + Merge
To get remote changes without adding extra commits prefer git pull --rebase
upstream: Default remote repository
GitHub Repo:
SSH Configuration: Settings => Ssh keys => Add a new ssh key
We have understood how to work on multiple remotes
Explain
Git clone vs pull
Git pull vs pull –rebase
Git bare repository
Git mirror
Forking in Github
Activities
Configure your github account to use ssh key of your laptop
Create a local git repo called as notes and push it to github private repo called as notes in your account.
Create a new repository in github called as hello-remote
Explain git pull vs git pull –rebase
push a new branch
Create a linux vm and install git and ensure you have done atleast 10 questions before next session Refer Here