2017年1月11日 星期三

Contribute steps to Github


[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)
4. git checkout dev-v2 (branch name)
5. git pull upstream dev-v2 (branch name)
6. git push origin dev-v2 (branch name)


[Contribute to GitHub]

Steps:
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.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.




[After deleting remote branch & would like to sync the status]

https://git-scm.com/docs/git-fetch

git fetch --all --prune


--all


Fetch all remotes.
--prune



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


[Github README.md]


https://read01.com/J848LL.html

沒有留言:

張貼留言