Skip to content

Commit

Permalink
create README_tr.md file and changes made to the README.md file
Browse files Browse the repository at this point in the history
  • Loading branch information
hediyeorhan committed Jan 19, 2024
1 parent 08fbb49 commit 474fa37
Show file tree
Hide file tree
Showing 2 changed files with 309 additions and 22 deletions.
44 changes: 22 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Email and username configuration must be done before starting to operate in git

```ini
git config --global user.name "hediyeorhan"
git config --global user.email hediyeorhan2015@gmail.com # Please add your username and e-mail address here.
git config --global user.email hediyeorhan2015@gmail.com # please add your username and e-mail address here.
```

First, we create a git folder in the project we will work on in our local directory with the command given below.
Expand All @@ -19,7 +19,7 @@ First, we create a git folder in the project we will work on in our local direct
Then, if we want to add files to the project, we can add files with the touch command.

```ini
touch add_file
touch add_file # create file
mkdir folder # create folder
```

Expand Down Expand Up @@ -54,7 +54,7 @@ If we want to get the files back after adding them with git add command:
In Git, the ***status*** command is used to check if there is a change in the project that has not been committed.

```ini
git status # Shows current git status. It shows if the current directory is linked to any git.
git status # shows current git status. It shows if the current directory is linked to any git.
```

The log command is used to see by whom and when commit messages were made.
Expand All @@ -75,7 +75,7 @@ Hash code: Each commit has its own number.
A .gitignore file should be created to hide the files in our local directory that we do not want to upload to github. Then we write the files we want to hide into .gitignore.

```ini
touch .gitignore # You can find .gitignore templates on Google according to the technology you use.
touch .gitignore # you can find .gitignore templates on Google according to the technology you use.
```

If the files we added to our .gitignore file are not hidden and are being uploaded to github, we can use :
Expand All @@ -95,23 +95,23 @@ Create new branch:
git branch new_branch_name
```

Branch switching:
Branch switching :

```ini
git switch branch_name
```

Merge two branches
Merge two branches :

```ini
git switch branch1 # We went into branch1 and merged it with branch2.
git switch branch1 # we went into branch1 and merged it with branch2.
git merge branch2
```

List current branches

```ini
git branch # It indicates which branch we are in with '*'.
git branch # it indicates which branch we are in with '*'.
```

Files / folders created in each branch belong to that branch. If not merge, they cannot be accessed by other branches.
Expand All @@ -135,25 +135,25 @@ Git can store changes that are not added and committed on itself with ***stash**
Git stores it inside itself and we can retrieve it whenever we want.

```ini
git stash # Hiding the file that was not committed.
git stash # hiding the file that was not committed.
```

To get the information stored in git stash back into files in our project :

```ini
git stash pop # It brings it back and deletes it from the list.
git stash pop # it brings it back and deletes it from the list.
```

When different changes are made in a row, all stashes are listed and kept in ids.

```ini
git stash list # It shows what we keep up to date.
git stash list # it shows what we keep up to date.
```

If we want to add stashes one by one :

```ini
git stash apply stash_id # It does not delete it from the list.
git stash apply stash_id # it does not delete it from the list.
```

Clear all stash :
Expand All @@ -167,7 +167,7 @@ Clear all stash :
To return to an old commit :

```ini
git log # From here, the hash code of the desired commit can be obtained.
git log # from here, the hash code of the desired commit can be obtained.
git checkout commit_hash_code
```

Expand Down Expand Up @@ -195,17 +195,17 @@ Changes made to the project by commits deleted with the ***hard*** parameter can
The ***revert*** command is used to keep commits in the commit history and only delete changes from the project. It undoes the actions and creates a new commit. It does not delete commits in the ***git log*** history.

```ini
git revert commit_hash_code # The project gets this commit back.
git revert commit_hash_code # the project gets this commit back.
```

To see changes/differences between two commits or in a project, use :

```ini
git diff HEAD # What shows differently according to the last commit.
git diff HEAD # what shows differently according to the last commit.

git diff commit1_hash_code commit2_hash_code # It shows the difference between two commits.
git diff commit1_hash_code commit2_hash_code # it shows the difference between two commits.

git diff commit1_hash_code : commit2_hash_code # It can also be used this way.
git diff commit1_hash_code : commit2_hash_code # it can also be used this way.
```

To see the difference between the two branches :
Expand All @@ -220,7 +220,7 @@ To clear the logs and rewrite the date and get rid of merge commits in between :

```ini
git switch branch1_name
git rebase branch2_name # First the commits in branch2 are sorted, then the commits in branch1 are sorted.
git rebase branch2_name # first the commits in branch2 are sorted, then the commits in branch1 are sorted.
```

<h3> Uploading the project to github </h3>
Expand All @@ -229,13 +229,13 @@ To upload our local project to Github, a github repo must first be created. Afte
The remote command should be used to remotely connect to the repository we created.

```ini
git remote add origin github_repo_url.git # The term "origin" represents the repo url for easier use in later commands.
git remote add origin github_repo_url.git # the term "origin" represents the repo url for easier use in later commands.
```

After the remote connection is established, the ***push*** command is used to upload our local files to github.

```ini
git push -u origin main # If your branch name is different, it can be changed. For example: master, feat ..
git push -u origin main # if your branch name is different, it can be changed. For example: master, feat ..
```

Here, when the ***push*** command is executed, you are asked to log in to your github account from the terminal screen or browser.
Expand All @@ -256,7 +256,7 @@ Branches on Github are considered remote branches. To list these branches, you c
To pull the final version of the project from github to local :

```ini
git fetch # Can be used when merge is not desired.
git fetch # can be used when merge is not desired.
```

To navigate between remote branches, use :
Expand All @@ -280,7 +280,7 @@ To merge the current version of the project that we have localized from Github :
To pull a repo that belongs to someone else and make changes to it, we need to ***fork*** that repo on Github so that it is listed among our own repos. Then we should clone it to our local repository by getting the url address among our own repos.

```ini
git clone repo_url.git # Move repo to local
git clone repo_url.git # move repo to local.
```

***This way we can push and pull this repo.***
Loading

0 comments on commit 474fa37

Please sign in to comment.