Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
taruncse committed Jan 27, 2018
1 parent e6800f8 commit 8408112
Showing 1 changed file with 20 additions and 18 deletions.
38 changes: 20 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,36 +11,36 @@ git remote add origin https://github.com/taruncse/GitExperiment.git
git push -u origin master
```

2. push an existing repository from the command line
* 2. push an existing repository from the command line

```
git remote add origin https://github.com/taruncse/GitExperiment.git
git push -u origin master
```
3. Incase of Android studio command line if you writ only ```git commit``` and you want to exit from editor, then you have to follow the following steps,
* 3. Incase of Android studio command line if you writ only ```git commit``` and you want to exit from editor, then you have to follow the following steps,

press "esc"(switch edit from insert mode) then ":" (Command mode) then "q" (quit command) then enter (as it is a VIM Editor)

4. Create the branch on your local machine and switch in this branch :
* 4. Create the branch on your local machine and switch in this branch :

```git checkout -b [name_of_your_new_branch]```

5. only create a branch
* 5. only create a branch
```git branch branch_name```

6. Switch to a branch
* 6. Switch to a branch
```git checkout branch_name```
7. You can see all branches created by using
* 7. You can see all branches created by using
```git branch```
8. Update your branch when the original branch from official repository has been updated :
* 8. Update your branch when the original branch from official repository has been updated :
```git fetch [name_of_your_remote]```

9. To remove a file from git stage (if only a file then remove -r)
* 9. To remove a file from git stage (if only a file then remove -r)
```git rm -r --cached <NAME_OF_THE_DIRECTORY>```
10. Change your remote's URL ```git remote set-url origin your_remote_url```
11. Verify that the remote URL has changed. ```git remote -v```
12. If you just inited it, you can just delete .git. ```rm -rf .git```
13. Add git tag on your last commit ```git tag -a GIVE_A_VERSION GIT_COMMIT_ID -m "Message here" ```
* 10. Change your remote's URL ```git remote set-url origin your_remote_url```
* 11. Verify that the remote URL has changed. ```git remote -v```
* 12. If you just inited it, you can just delete .git. ```rm -rf .git```
* 13. Add git tag on your last commit ```git tag -a GIVE_A_VERSION GIT_COMMIT_ID -m "Message here" ```

Push a tag ```git push --tags origin master```

Expand All @@ -49,21 +49,23 @@ press "esc"(switch edit from insert mode) then ":" (Command mode) then "q" (quit
Delete tag from local ```git tag -d TAG_VERSION/ID```

Delete tag from remote ```git push --delete origin tagName```
14. To unstage the file which is added by git add command
* 14. To unstage the file which is added by git add command

```git reset <filePath>``` (For a specific file)

```git reset``` (For all file)

15. Checkout and create a branch from a existing tag:
* 15. Checkout and create a branch from a existing tag:

```git checkout tags/<tag_name> -b <branch_name> ```

16. Show all tags
* 16. Show all tags
```git tag```
Show all remote tags
```git ls-remote --tags origin```
17. Create tag
* 17. Create tag
```git tag -a Tag_Name -m "Message"```
19. Push all tags
```git push --tags```
* 19. Push all tags
```git push --tags```
* 20. Remove git ignore cache.
```git rm -r --cached ```

0 comments on commit 8408112

Please sign in to comment.