Skip to content

Commit

Permalink
first commit from vs code
Browse files Browse the repository at this point in the history
  • Loading branch information
adibnoh committed Jan 26, 2018
1 parent 8368ead commit 04647ba
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions Git/cheat_sheet.md
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>`

0 comments on commit 04647ba

Please sign in to comment.