-
Notifications
You must be signed in to change notification settings - Fork 276
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
81 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
## Homework Assignment 1: Initializing a Local Repository | ||
```shell | ||
mkdir project | ||
cd project | ||
git init | ||
git config --global init.defaultBranch master | ||
echo "Homework Assignment 1: Initializing a Local Repository">>README.md | ||
git add README.md | ||
git commit -m "Create README" | ||
``` | ||
|
||
## Homework Assignment 2: Basic Version Control | ||
```shell | ||
git checkout -b feature-branch | ||
echo "Working with git locally">>README.md | ||
git commit -a -m "Update README" | ||
git checkout master | ||
git merge feature-branch | ||
``` | ||
## Homework Assignment 3: Exploring Git History | ||
```shell | ||
git log | ||
git log --pretty=format:"%H | %ar | %s" | ||
git log --graph --pretty=oneline | ||
git log -p #show difference | ||
git log --stat | ||
git show ac35568980c7bf7334095a258f3bd54acbafe626 | ||
git show ac35568 | ||
``` | ||
## Homework Assignment 4: Creating and Applying Tags | ||
```shell | ||
git tag -a v1.0 ac35568980c7bf7334095a258f3bd54acbafe626 -m "Tag v1.0" | ||
git tag #check that tag was created | ||
echo "Working on tags">>README.md | ||
git commit -a -m "Add current work to README" | ||
git tag v2.0 | ||
git tag #check that tag was created | ||
git show v1.0 | ||
git show v2.0 | ||
git for-each-ref refs/tags #show what tags are annotated and lightweight | ||
``` | ||
## Homework Assignment 5: Undoing Changes | ||
```shell | ||
git checkout -b bug-fix | ||
echo "Undoing Changes">>README.md | ||
git commit -a -m "Change README" | ||
date >> README.md | ||
git commit -a -m "Add date to README" | ||
git reset --soft HEAD~1 | ||
git status | ||
git commit -m "Add date to README one more time" | ||
git reset --mixed HEAD~1 | ||
git status | ||
git commit -a -m "Add date to README. Last try" | ||
git reset --hard HEAD~1 | ||
git status | ||
|
||
``` | ||
## Homework Assignment 6: Stashing Changes | ||
```shell | ||
git checkout master | ||
git checkout -b experimental-feature | ||
hostname >> README.md | ||
git stash | ||
git stash list | ||
git checkout bug-fix | ||
git stash apply | ||
nano README.md #resolving conflicts | ||
git add . | ||
git commit -m "Add hostname to README" | ||
git status | ||
``` | ||
## Homework Assignment 7: Git Aliases and Configuration | ||
```shell | ||
git config --global user.email "buyalskaya.yv@gmail.com" | ||
git config --global user.name "Buyalskaya Yuliya" | ||
git config --global alias.cm "commit -a -m" #create alias cm | ||
git config --list | ||
``` |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Project description | ||
[Homework 02. GIT. Local](../Yuliya_Buyalskaya/02.Git.Local/02.GIT.Local.md) |