-
Notifications
You must be signed in to change notification settings - Fork 0
Git
git remote add upstream git@theRemoteForkedGitRepo.git
git fetch upstream
git merge upstream/master master
git remote add origin http://giturl.of.youself
git remote show origin
git remote set-url origin http://newgiturl.of.youself
git checkout -b abranch origin/abranch
git branch -u origin/abranch
git push origin :your_branch_name
git push origin --delete d_new_front_partner
git update-index --assume-unchanged filename
git pull origin yqwu
git push origin yqwu
git checkout abranch
git checkout abranch
git merge master
git show
git show commit_id
git show --pretty="format:" --name-only commit_id
git log
git log --pretty=oneline (oneline,short,full,fuller)
git log —-stat
git log --pretty=format:"%h - %an, %ar : %s”
git log --pretty=format:"%h %s" -—graph
git diff master dev filename # compare the filename in master and dev branch, master as source, filename in dev is the new one
git checkout master -- filepath
If you ever want to ignore a file from git, but don't want to add it to the .gitignore file, you can do it on your local copy by adding it to the file ".git/info/exclude"
Setup an alias to do so, just add this to your .gitconfig file under the [alias] section
[alias]
exclude = !sh -c 'echo "$1" >> .git/info/exclude' -
Then you can execute:
git exclude SOME_FILE