-
Notifications
You must be signed in to change notification settings - Fork 3
Intro to Git #23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Intro to Git #23
Changes from 2 commits
f0d8cc1
2361003
862770a
af2b7c8
8970358
8973271
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
--- | ||
title: Introduction to Git | ||
category: git | ||
--- | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In general this should not be a list of commands but more an article |
||
### Creating a New Repository | ||
1. Create or navigate to the directory you want under version control | ||
2. Run ```git init``` to start tracking changes | ||
|
||
### Checking out a Remote Repository | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Explain what a remote is |
||
1. Navigate to the location you want to clone the repo into | ||
2. Run ```git clone [username@host:repo]``` to clone the repo | ||
3. Run ```cd [repo]``` to access the repo | ||
|
||
### Adding and Committing Files | ||
1. Make any changes to ```[filename]``` | ||
2. Run ```git add [filename]``` to add the changes to the index | ||
3. Alternatively, run ```git add *``` to add all changed files to the index | ||
4. To commit these changes to the head, run ```git commit -m '[message]'``` | ||
|
||
### Push Commits to Remote Repository | ||
1. To send the changes from the head, run ```git push origin [branch name]``` | ||
2. If you did not clone an existing remote repo and want to push to one, add it by running ```git remote add origin [server]``` | ||
|
||
### Branching | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Explain branching and why you should do it |
||
1. Create a new branch for features or bug fixes by running ```git checkout -b [branch name]``` | ||
2. Switch branches by running ```git checkout [branch name]``` | ||
3. Delete branch by running ```git checkout -d [branch name]``` | ||
4. Make a branch available to others on a remote server by running ```git push origin [branch name]``` | ||
|
||
### Update and Merge | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Explain merging as a concept and merge conflicts as well |
||
1. Update your local repo by running ```git pull``` | ||
2. Merge another branch into your current branch by running ```git merge [branch name]``` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Explain stashing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make an introduction to Git as a version control system, what a version control system is, how git is different.