Created
March 7, 2016 23:52
-
-
Save vallard/e52438240c20c24997c7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# create a git repo | |
``` | |
git init mygit | |
cd mygit | |
echo "this is foo" > foo.txt | |
git status | |
git add . | |
git status | |
git commit -am "added foo" | |
echo "this is a change in foo" > foo.txt | |
git commit -am "updated foo" | |
git log | |
echo "added bar" > bar.txt | |
git log | |
git checkout asdfasdf foo.txt | |
# now foo.txt is back | |
# commit changes | |
# create project in github | |
# now add project | |
git remote add origin https://github.com/vallard/choochoo.git | |
git push -u origin master | |
### Branch | |
git branch | |
git branch twig | |
git checkout twig | |
echo "blah blah" > blah.txt | |
git add blah.txt | |
git commit -m "added blah" | |
ls | |
git checkout master | |
# now merge | |
git merge twig | |
# git rid of twig branch | |
git branch -d twig | |
git pull | |
``` | |
# Git someone else's code | |
``` | |
git clone https://github.com/<your username>/CiscoCloudDayLab1.git | |
git log --graph --decorate --abbrev-commit --all --pretty=oneline | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment