Git Cheat Sheet Create From existing repo From existing data cd /projects/myproject git init git add. Git clone /existing/repo /new/repo git clone git://host.org. Python Crash Course on GitHub; Cheat Sheets. Cheat sheets can be really helpful when you’re trying a set of exercises related to a specific topic, or working on a project. Because you can only fit so much information on a single sheet of paper, most cheat sheets are a simple listing of syntax rules. This set of cheat sheets aims to remind you.
Cheat sheets are sets of concise graphical and textual explanations, inspired by infographics, data comics, and cheat sheets in other domains. Cheat sheets aim to support learning, teaching, and the regular use of both common and novel visualization techniques in a variety of contexts. To design cheat sheets for visualization techniques, we describe six components of a cheat sheet: anatomy, build-up, visual patterns, pitfalls, false-friends, variations. We present examples for several visualization techniques, created through an iterative design process which involved data science and visualization teachers, visual designers and students. In a qualitative and iterative user study, we gather subjective feedback from participants, show readability and usefulness of our cheat sheets, and iterated on their design. We bring this together as a design methodology, with a comprehensive design framework to easily create cheat sheets for additional visualizations.
Anatomy
Anatomy explains the visual elements of a visualization technique, their composition, their specific terminology, and how they relate to the data. The visual components of a visualization can include individual visual marks as well as groups of marks, axes, locations in a visualization etc.
Construction
A Construction explains the conceptual idea behind a visualization design and how a visualization is encoding data. We chose that term to highlight the step-wise explanation used to understand a visual mapping, i.e. the transformation from data to visualization. The goal of the construction, on the other side, are twofold: (a) to provide a procedural explanation of a visualization design, (b) to deliver a blue-print for how to explain the visualization to a larger audience.
Visual Patterns
Visual patternssheet provide a catalogue of meaningful patterns visible in a visualization. Patterns are key in correctly interpreting visualizations and makingdiscoveries. A visual pattern can be any sort of configuration inthe visualization with a specific meaning.
Pitfalls
Pitfalls show possible misinterpretations of a visualization. While there is a long list of technique independent pitfalls.
Well-known Relative
The “well-known relative” relates an unknown visualization to a more familiar one used to visualize the same data.
False Friends
False-friendslists visualization techniques that are visually similar but functionally different. For example, boxplots share visualsimilarities with candlestick charts and error bars in bar chars; parallel coordinates can look similar to line charts, time curvescan look similar to connected scatter plots.
This is just stuff that I have put down that I find I use a lot of the time for my own reference.
Latest changes from repo to your machine
Add tracking information to your work
Assuming that you are working on the master branch then
You can set it to whatever branch you want to track changes for
This will mean you can just do git pull
and the latest changes will be pulled to your origin
What branch?
$ git branch
shows what branch you're on
$ git branch -r
shows remote branches
$ git branch -a
shows all branches
Create a PR [Pull Request]
Fork other users repo in GitHub, then clone to your machine.
Add the remote repo
Create your branch
Check it out
If adding a folder use.
Make your commit and push to your new branch.
Manage the rest of the PR via GitHub
Check remotes
Sync a remote fork on your machine
First configure the local to point to the remote upstream
You then use git merge
to update any branch on the upstream repository:
Sync a remote fork on Github
- Open your fork on GitHub.
- Click on Pull Requests.
- Click on New Pull Request. By default, GitHub will compare the original with your fork, and there shouldn’t be anything to compare if you didn’t make any changes.
- Click on Try
switching the base
. Now GitHub will compare your fork with the original, and you should see all the latest changes. - Click on Click to create a pull request for this comparison and assign a predictable name to your pull request (e.g., Update from original).
- Click on Send pull request.
- Scroll down and click Merge pull request and finally Confirm merge. If your fork didn’t have any changes, you will be able to merge it automatically.
2fa
Using two factor authentication? Then use the following so you're not adding in your auth token each time you want to push
your code.
Change origin
url
If you want to change the origin url you can use the set-url
command
Via terminal navigate to your code folder.
Add your files.
Adding a folder use the following syntax or it'll get added as a BLOB.
Commit to local repo.
To add your files to the remote repo, first add your remote repo
Delete local branch
Merge two repos
If you want to merge project-a into project-b:
Stop tracking a file
If you have .env
files that are tracked by Git and want to ignore them so your API keys don't get added to GitHub use:
Start tracking a previously un-tracked file
Cloning a repo from someone else's GitHub and pushing it to a repo on my GitHub
So you make a clone, make some changes then realise that you need to add it to your GitHub account before making a pull
You just need to set the origin
to yours then add the upstream
as the original origin
make sense?
So change origin
to yours:
Then add upsrtream
as theirs:
Now it should look something like this:
Clone a repo and give it a different name
Using Husky?
If you are pushing right after a commit, you can use $ git push --no-verify
to avoid running all the tests again.
If you make a trivial change and want to commit $ git commit -m 'some detailed message' --no-verify
will skip your precommit
and prepush
scripts.
How to read last commit comment?
$ git show
is the fastest to type, but shows you the diff as well.
$ git log -1
is fast and simple.
$ git log -1 --pretty=%B
if you need just the commit message and nothing else.
Remove commit from pull request
Read this for more detail on how to revert.
This was the simplest approach I found:
Best website program for mac. Rather than use the last part I unstaged the changes in VSCode which I think did the same thing.
Show .gitconfig
details
Github Cheat Sheet Git
If you want to rename a branch while pointed to any branch, do:
Git Cheat Sheet
If you want to rename the current branch, you can do:
Windows Network Commands Cheat Sheet
A way to remember this, is -m
is for 'move' (or mv
), which is how you rename files.