[How to clone a specific Git branch? ]:
git clone -b <branch> <remote_repo>
[recursively delete directory]:
rmdir c:\test /s /q
[To rollback to a specific commit]:
git reset --hard commit_sha
[Undo current modification]
git checkout -- .Use "git checkout -- ..." to discard changes in working directory
[Update your fork]
Steps:
1. git clone your fork.
2. git remote -v
should be like:
E:\source code\EXO_fork_John\ExoPlayer>git remote -v
origin https://github.com/WeiChungChang/ExoPlayer.git (fetch)
origin https://github.com/WeiChungChang/ExoPlayer.git (push)
3. git remote add upstream https://github.com/google/ExoPlayer.git
should be like:
E:\source code\EXO_fork_John\ExoPlayer>git remote -v
origin https://github.com/WeiChungChang/ExoPlayer.git (fetch)
origin https://github.com/WeiChungChang/ExoPlayer.git (push)
upstream https://github.com/google/ExoPlayer.git (fetch)
upstream https://github.com/google/ExoPlayer.git (push)
should be like:
E:\source code\EXO_fork_John\ExoPlayer>git remote -v
origin https://github.com/WeiChungChang/ExoPlayer.git (fetch)
origin https://github.com/WeiChungChang/ExoPlayer.git (push)
upstream https://github.com/google/ExoPlayer.git (fetch)
upstream https://github.com/google/ExoPlayer.git (push)
4. git checkout dev-v2 (branch name)
5. git pull upstream dev-v2 (branch name)
6. git push origin dev-v2 (branch name)
5. git pull upstream dev-v2 (branch name)
6. git push origin dev-v2 (branch name)
[Contribute to GitHub]
ref: https://git-scm.com/book/zh-tw/v2/GitHub-%E5%8F%83%E8%88%87%E4%B8%80%E5%80%8B%E5%B0%88%E6%A1%88
Steps:
1. git checkout -b "新名稱"
2. git commit -a -m 'message'
3. git push origin (branch name)
http://stackoverflow.com/questions/9790448/how-to-update-a-pull-request
Monkey (猴子)
https://backlogtool.com/git-guide/tw/stepup/stepup2_4.html
org/documentation/contribute/ index.html#how-to-submit- patches
create a commit and attach a 'git format-patch' style patch like so
git add files/to/commit
git commit
<enter commit message>
git format-patch -1
Add --help or the search the git documentation for specifics on what these functions do.
git fetch --all --prune
--all
--prune
https://read01.com/J848LL.html
1. git checkout -b "新名稱"
2. git commit -a -m 'message'
3. git push origin (branch name)
update a pull request
http://stackoverflow.com/questions/9790448/how-to-update-a-pull-request
Monkey (猴子)
https://backlogtool.com/git-guide/tw/stepup/stepup2_4.html
[Contribute to Gstreamer]
https://gstreamer.freedesktop.create a commit and attach a 'git format-patch' style patch like so
git add files/to/commit
git commit
<enter commit message>
git format-patch -1
Add --help or the search the git documentation for specifics on what these functions do.
[After deleting remote branch & would like to sync the status]
https://git-scm.com/docs/git-fetchgit fetch --all --prune
--all
Fetch all remotes.
Before fetching, remove any remote-tracking references that no longer exist on the remote. Tags are not subject to pruning if they are fetched only because of the default tag auto-following or due to a --tags option. However, if tags are fetched due to an explicit refspec (either on the command line or in the remote configuration, for example if the remote was cloned with the --mirror option), then they are also subject to pruning.
[Develop with Git to develop new feature locally]
1. git commit -a -m 'three seconds is better'
2. git reset --hard ID
沒有留言:
張貼留言