Code Fellows courses Notes
This project is maintained by QamarAlkhatib
A GUI (GUI) and a command line interface (CLI) are two ways of interacting between a user and an electronic device. A GUI is a graphical representation in which users interact with software or devices via clickable icons. A CLI console is a text-based rendering where users type commands into a terminal to operate or navigate a software or device A graphical user interface uses graphics to enable users to communicate with an operating system or application. It provides windows, menus, buttons, scrollbars, icons, wizards and other mouse icons for users to interact with the program.
Git is a version control system for managing changes to your source code and GitHub is a cloud hosting platform for managing Git repository changes. Git is a distributed version control system (VCS) that allows developers to manage and, if needed, branch out and merge changes, giving developers full control over the local code base. Git allows you to store code as a distributed, open-source version control system (VCS), track revision history, merge changes and access previous versions of code as needed.
So to get start with git we have to download it and it can installed in three ways:
as a package
via another installer
by downloading it and compile the source code
Note:
To see how to download it on your machine
The Graphical User Interface (GUI) tools in Git are built-in. Users can, however, utilize third-party solutions designed for specific systems.
If you don’t specify a default text editor, Git will use the system’s default text editor, which is most likely Vim. Type the following into your Terminal or Command Line to set up an alternative text editor, such as Emacs:
$ git config --global core.editor emacs
To check settings, use this command
$ git config --list command.
There are three ways to view the documentation for further information on a certain command:
git help command
git command --help
man git-command
Using the Terminal or Command Line, follow these steps to import an existing project or directory into Git:
1. Switch to the target project’s directory
cd test (cd = change directory)
2. Use the git init command
git inti
3. To begin monitoring these repository files, type the following as an initial commit:
git add *.c
git add LICENSE
git commit -m “any message here”
You can also use the clone command with a repository’s URL to make a copy of an existing Git repository from a specific server:
git clone https://github.com/test
You’ve duplicated all versions of all files in a project by cloning the file. This command creates a directory named “test” that has an initialized.git directory that contains copies of all versions of all files for the given project. A copy of the most recent version of the project is also checked out — or retrieved for editing — using the command.
Use the following command format to clone a repository into a directory with a different name:
git clone https://github.com/test mydirectory
There are three parts to the local Git repository:
1. Working Directory: The actual files reside here.
2. Index: The area used for staging
3. Head: Points to the most recent commit
A tracked or untracked state exists for all files in a checked out (or working) copy of a project file.
1. After you edit a file, Git flags it as modified because of changes made after the previous commit.
2. You stage the modified file.
3.Then, you commit staged changes.
Use the git status command to see what’s up with your files:
git status
git add filename
git add
git status
After staging one or more files, submit the changes and include the following information in the commit message:
git commit -m “made change x,y,z”
by this command:
git commit -a
You’d next submit the modifications to a remote repository. In the next part, we’ll go through remote repositories in further detail. For now, let’s take a look at how to push updates to remotes in general.
Example
git push origin master
Git stash is a fantastic alternative when you’re not ready to commit changes but don’t want to lose them either. This command conceals and temporarily eliminates modifications, leaving you with a clean working directory. Simply use the git stash apply command to retrieve the concealed changes when you’re ready to resume working on them.
You must interact with remote repositories, which are versions of a project that are stored online or on a network, in order to collaborate on Git projects. You can work with numerous repositories and have read/write or read-only access to them. Remote repositories may be used to push and get data from by teams.
As previously stated, Git will automatically assign the name “origin” to the server from which you cloned and the name “master” to your local branch for cloned repositories.