forked from adibnoh/notes
-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 changed file
with
47 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,47 @@ | ||
## Initialize git | ||
|
||
`git init` | ||
|
||
## You can clone git or add repo url | ||
|
||
`git clone <repo_url>` | ||
|
||
or | ||
|
||
`git remote add origin <repo_url>` | ||
|
||
## Fetching Remote | ||
|
||
`git fetch origin` | ||
|
||
## See if there are any incoming changes | ||
|
||
`git log HEAD..origin/master --oneline` | ||
|
||
If any commits are listed in the output above, then you have incoming changes -- you need to merge. If no commits are listed by git log then there is nothing to merge. | ||
|
||
Note that this will work even if you are on a feature branch -- that does not have a tracking remote, since it explicitly refers to origin/master instead of implicitly using the upstream branch remembered by Git. | ||
|
||
## Git pull aborted with error filename too long | ||
|
||
`git config core.longpaths true` | ||
|
||
## Git merge from another branch to master | ||
|
||
`git checkout master` | ||
|
||
`git pull origin master` | ||
|
||
`git merge test` | ||
|
||
`git push origin master` | ||
|
||
## Git remove gitignore cache | ||
|
||
`git rm --cached . -r` | ||
|
||
`git add .` | ||
|
||
`git commit -m 'remove cache gitignore'` | ||
|
||
`git push origin <remote_branch>` |