https://gun.io/blog/how-to-github-fork-branch-and-pull-request/
About: Git branching allows user to experiment with different version of a project by checking out separate branches to work on.
$ git branch
-- show which branche that you are on [list of all branches].
$ git branch <new_branch>
-- create a new branch called new_branch.
-- delete a branch by using 'branch -d <name>'
$ git checkout branch_name
-- switch to a branch.
$ git add <filename>
-- adds this file to the staging area.
-- after any changes, need to stage the file again.
$ git commit -m "Commit message"
-- creates the actual commit.
$ git log
-- show a list of all the commits.
$ git merge <branch_name>
git config --global user.name "YOUR NAME" git config --global user.email "YOUR EMAIL ADDR"
touch README.md git init git add README.md git commit -m "first commit" git remote add origin https://github.com/rabbitear/javascript-class.git git push -u origin master
To get the new branch galaga-config to push, I had to do a couple of extra things. Here's the jist of it.
First I forgot the git config --global user.name "name"
and the git config --global user.email [email protected]
, so it asked me to git commit --amend --reset-author
. Then I ran these other two commands to put in the new branch:
git config --local push.default matching git push --set-upstream origin galaga-config
To be continued.
This is a WARNING, if you git checkout to a new_brnach, then change the files around, they change back to the master branch, and do not merge back that file is gone.. Until you switch back to the new_branch.
[SOLVED]
git checkout galaga-config
cp ~/.vimrc ~/vimwiki/vimrc-galaga
git checkout master
git merge galaga-config
git status
git verify-pack -v .git/objects/pack/*.idx | sort -k 3 -n | tail -5
git rev-list --objects --all | grep <revision_id>
git filter-branch --index-filter 'git rm --cached --ignore-unmatch <filename>'
rm -rf .git/refs/original/
vim .git/packed-refs
git reflog expire --all --expire-unreachable=0
git repack -A -d
git prune
I made the push.default set to current: