This is a example for git usage with GitHub, you need learn how to use, and build your own branch with your git learning notes from this master. And if there are something new about git and GitHub, you SHARE IT
by commit and push your branch
Recommend to Use Atom eiditor , it has a good git&github plugin and well supoort markdown and program languages
Before do this you need generate you 'ssh key' and add to your github account
After set the SSH Key, You can clone this repository
git clone [email protected]:HITSZ-LeggedRobotics/git_learning.git
For something about markdown writing
If you have some notes SHARE IT!
cd path to you git repository
git init
if you want to connect to a repository on github
git remote add origin git@github.com:your_repositry.git
origin
is the default name of your remote connection
git add <filename> or *(all file in the derictory)
this is add new file or add file which you have changed the content
and the change didn't apply/commit
git commit
||git commit - m “your description about the commit”
git push -u origin master
add -u
for the fisrt push
- Add a branch
git checkout -u <branch name>
-Switch to a branchgit checkout <branch name>
YOU should push the correspond branch name to github so that you can push to the right branch - Fetch
fetch remote repository
git fetch origin
- Merge
merge to current repository
git merge origin/<branch name>
- Pull
Fetch and merge
git pull origin <branch name>:<branch name>
TODO(Shunyao)