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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

git: how do u move files to different directories?

A

git mv fileName /new/folder/name

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

git: How to create an empty git repository?

A

git init

a directory by name .git will be created in present directory.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

git: How to list all branches?

A

git branch

How well did you know this?
1
Not at all
2
3
4
5
Perfectly