Github and Git
Github and Git
INTRODUCTION
Git shows what changes were made, when and by whom to a project
INSTALLATION
We will start this module by downloading Git Bash, from the official website
https://git-scm.com/ and follow along for installation.
Launch the Git Bash setup. The very first page contains the important info
regarding the licenses and term & conditions. After reading it click on the
next button.
The next page consists of the components that needs to be installed.
Please confirm that the check box regarding Additional icons has been
marked for it to create a Desktop shortcut.
The next page contain the info about the Default editor (eg. VS Code,
Sublime Text, Vim etc.)that we want to set for Git and in which you are
comfortable.
INSTALLATION
The next page consist of the info about adjusting the name of the initial
branch in new repository. Let it to be the default option i.e “let git decide”. Click
on next.
After that it contains the info about the adjustment of Path environment.Keep
this to be the recommended option(i.e Git from the command line and also
from 3rd-party software). Click on next.
In the next page choose the Use the OpenSSL Library option(default option)
and click on next.
In the next page choose the option (Checkout Windows-style, commit Unix-
style line endings) and click on next.
Again click on next after checking Use MinTTY option. For all further pages stick
with the default options, hence click on next till you reach Installation option.
Get it installed and click on Finish.
INSTALLATION ON
macOS
Go to Git official site and head over to downloads section for macOS
Either use the homebrew method or the package installer →
1)HomeBrew method -
1)Go to homebrew official site and copy the bash command and
paste it in your terminal and enter to install brew for mac
2) Now run the command ‘brew install git’ to install git for your mac
Now , you’re all set to push/pull, commit,fork etc with the terminal on mac
BASIC BASH COMMANDS
cd : Allows you to traverse to other directories.
You can use “cd . .” to go to parent directory.
The > operator overwrites any existing contents of the file, while
the >> operator appends to the file.
BASIC BASH COMMANDS
INITIALIZING GIT REPO
Type: “git add .” (For adding all the files which you
changed)
COMMITING THE CHANGES
WHAT IS A REPOSITORY?
a. Open a repository.
b. Click on Fork button.
c. Click on Create Fork.
d. Open the forked repo, click on Code and copy the url.
e. Open git bash and type: git clone <your-remote-git-repo-
url>
f. Type: cd <filename>
g. Type: git remote add upstream <your-remote-git-repo-
url>
CREATING A PULL REQUEST
To create a pull request: