Remote Repositories Flashcards
What is a connection string in git in regards to remote repositories?
A connection string is a URL that we can use to let Git know where the remote repository is located.
Commonly used platforms for maintaining remote repositeries?
Gitlab
BitBucket
Github
How to add your remote repository to your local repository?
Using the “git remote add origin https://xxxx.com”, origin is like a name for the remote repo
command to list all your remote repositories
git remote -v
You can have more than one remote repo
command to push a branch to remote repository
git push origin master
origin - is the pointer to the url of your remote repository
master - is the name of the branch you want to push to remote repo
Command to clone a repository
git clone [ssh link]
What is a pull request or PR?
It is when say you have pushed your changes to a branch called sarah, and the master branch is one commit behind Sarah, then you can open a pull request or PR, to merge the changes into the master branch
How to update your local master branch with the changes that have been pushed to the remote master branch?
git fetch origin master –> First we fetch all the changes from our remote repo
git merge origin/master – > Now we merge the origin master branch into the local master branch
Command to view all the branches both remote and local?
git branch -a