git Flashcards
1
Q
How to download a single file from github.com?
A
Locate file in browser
- click on raw button
- copy the raw URL from browser
curl -o local_file_name raw_url
2
Q
git: how do u move files to different directories?
A
git mv fileName /new/folder/name
3
Q
git: How to create a new branch, which is a copy of existing branch?
A
git branch new_branch_name
git checkout new_branch_name
4
Q
git: How to create an empty git repository?
A
git init
a directory by name .git will be created in present directory.
5
Q
git: How to list all branches?
A
git branch