Git
Remote Repo
- Connections and credentials:
- https: use username/password or username/token as credentials
- ssh: we use ssh keys generated on a system imported to remote repository
- Import ssh into remote repositories
- Github: Navigate to settings

- Gitlab
- BitBucket
- Azure DevOps Source Repos
- Github: Navigate to settings
Clone vs Adding Remote
- Clone is done when the remote is already available and in your system you donot have local repo. This creates a remote with name origin and upstream for default branch
git clone <remote-url>
- We will be using remote add when we first create a local repo then remote repo or when moving the code from one repo to another
git remote add <name> <url>
Conditions
- When sending changes to the remote repository the HEAD of the remote (origin/
) should exactly be same commit as present in the actual remote
PULL, PULL –rebase
- documentation from attlasian
- pull = fetch + merge
-
pull –rebase => fetch + rebase
- push
- fetch
Different types of clones
- clone (Full clone): for working
- working tree
- local repo
- bare clone: for hosting purposing
- local repo
- mirror clone: for backup purposes + mirroring
- local repo + all references
Sending changes from local to remote (Enterprise)
- Direct push
- Feature branches:
- Every change will lead to a branch
- feature branches
- defect branches
- Every change will lead to a branch
- pull request (feature branches)
PULL REQUESTS WITHIN ORGANIZATION
- This is used within enterprise
PULL REQUESTS OPEN SOURCE (Other organizations)
- This is majorly used for opensource contributions
- We will create a fork of the repository (copying the repo into your account)
-
create a feature branch and create a pull request
- from feature branch of forked repo
- to main branch of actual repo

- Exercise: Create a Pull request to this repo
