- Sumith1896
- martiansideofthemoon
Git is a distributed revision control software. Git was initially designed and developed by Linus Torvalds for Linux
Having infinite version of the same file.
#CS101_nostalgia
...the purpose Git was designed to serve. When you have a Microsoft Word file, you either overwrite every saved file with a new save, or you save multiple versions. With Git, you don’t have to. It keeps “snapshots” of every point in time in the project’s history, so you can never lose or overwrite it.
In case things go wrong, revert back to the most recent working version
1. Installation
$ sudo apt-get install git
2. Personalization
$ git config --global user.name "Lorem Ipsum"
$ git config --global user.email loremipsum@foo.com
3. Initialization of a project
$ git init
Repository: A directory or storage space where your projects can live. Sometimes GitHub users shorten this to “repo.” It can be local to a folder on your computer, or it can be a storage space on GitHub or another online host. You can keep code files, text files, image files, you name it, inside a repository.
Commit: This is the command that gives Git its power. When you commit, you are taking a “snapshot” of your repository at that point in time, giving you a checkpoint to which you can re-evaluate or restore your project to any previous state.
git init: Initializes a new Git repository. Until you run this command inside a repository or directory, it’s just a regular folder. Only after you input this does it accept further Git commands.
git config: Short for “configure,” this is most useful when you’re setting up Git for the first time.
git help: Forgot a command? Type this into the command line to bring up the 21 most common git commands. You can also be more specific and type “git help init” or another term to figure out how to use and configure a specific git command.
git status: Check the status of your repository. See which files are inside it, which changes still need to be committed, and which branch of the repository you’re currently working on.
git add: This does not add new files to your repository. Instead, it brings new files to Git’s attention. After you add files, they’re included in Git’s “snapshots” of the repository.
git commit: Git’s most important command. After you make any sort of change, you input this in order to take a “snapshot” of the repository. Usually it goes git commit -a -m “Message here.” The -m indicates that the following section of the command should be read as a message.
git diff: See the changes you have made.
git mv, git rm
git log: Used to get a list of all commits done in this version of the repository.
git reset: Every commit is referred to by a unique commit ID. At any point of time, we may revert all our progress to a given commit using git reset --hard <commit_id>. The latest commit is called HEAD, and all changes after the latest commit will be deleted using git reset --hard HEAD.
git grep <some_regex>: Helps search the entire project for lines of text / code matching the regex provided.
git stash: helps store un-committed work temporarily which may be recovered using git stash pop.
.gitignore: Git never reads changes in these files and ensures they aren't pushed to any remote. Makes use of wildcards
An excellent list of commands (multilingual :P ) is complied here https://github.com/arslanbilal/git-cheat-sheet
Features specific to GitHub
GitHub is a web-based Git repository hosting service, which offers source code management functionality of Git as well as adding its own features. Unlike Git, which is strictly a command-line tool, GitHub provides a web-based graphical interface. It also provides access control and several collaboration features such as wikis, task management, and bug tracking and feature requests for every project.
1. Create an account in GitHub.
2. Create a repository. Preferrably, uncheck "Initialize with a README.md"
3. Browse around! There are a lot of interesting things happening on Github all the time!
Official GitHub hello-world tutorial here
Fork - Own a copy of else's project.
Pull request - Send in your contribution for review.
Other features - follow, star, watch, etc.
So we need to specify this Github project URL to our local folder. This is done via "remotes". Remotes are like public / private copies of the project, not on our machine.
git remote add <remote_name> <remote_url>
origin is the most common name, and the default remote of cloned repositories.
See all your remotes by using git remote -v
Push the commits by using git push <remote_name> <branch_name>, which translates to git push origin master in our case. (Branches explained later).
Branch: How do multiple people work on a project at the same time without Git getting them confused? Usually, they “branch off” of the main project with their own versions full of changes they themselves have made. After they’re done, it’s time to “merge” that branch back with the “master,” the main directory of the project. master is the default branch name.
You can make a new branch using git checkout -b <branch_name>.
You may use git checkout <branch> to switch to that branch.
git branch: Get a list of all your branches along with your active branch. git branch -D <branch_name> to force delete a branch.
git merge: Once we committed all work in <branch_name> we can head back to master and merge in our changes using git merge <branch_name>
The first step involved in adding the person involved to the repository on Github. This gives him access to make changes in the repository.
We wish we could all work together :(
Well you definitely can! Here is where the magic of "merging" comes into play! As long as you work on different files, or edit the different parts of the same file, git will bring it all together during the pull operation!
(Merging here works similar to the merging of branches)
So here comes the tricky part, when two people decide to edit the same part of the same file at the same time.
There might arise the need to resolve conflicts manually.
Fix conflicts and run a git commit -a to end the merge.
"People who say alcohol is addictive, probably haven't tried their hands at FOSS." - Ranveer
Catch us at
Ta-da you are an open-source contributor
A symbolic computational library
What?
Mathematical library that handles symbols than numbers. So you can do things like
integrate(sin(x) + cos(x)**2, x)
and things much more complicated
A simple pythonic open source library alternative for Wolfram
import sympy
And as simple as
Example: Laplace Transforms
>>> from sympy.integrals import laplace_transform
>>> from sympy.abc import t, s, a
>>> laplace_transform(t**a, t, s)
(s**(-a)*gamma(a + 1)/s, 0, -re(a) < 1)
Core capabilities|Polynomials |Calculus
Solving equations |Combinatorics |Discrete math
Matrices |Geometric Algebra| Geometry |Plotting |Physics
Statistics| Cryptography| Parsing |Printing