Git Notes There are many was to do any of the followoing. This is just one way. General git knowledge is widely available. If you’ve never used it, read an overview!
Proxy Setup for LSI IT won’t allow, at least generally, access to remote git repositories. The following works at present. Environment export export export export export export
proxy="http://135.156.228.210:9400" http_proxy=$proxy https_proxy=$proxy ftp_proxy=$proxy no_proxy=lsi.com GIT_PROXY_COMMAND=/home/jjacques/scripts/git_proxy_command.sh
git_proxy_command.sh may take some explaination. It is a wrapper for the “connect” command (/workspace/sw/jjacques/apps/src/connect). Make a copy of the source, and build connect. I may change things at any time, and without notice. .ssh/config Host github.com ProxyCommand corkscrew 135.156.228.210 9400 %h %p
Create a Repository For U-Boot, use git://git.denx.de/u-boot.git For Linux, use git://git.kernel.org/pub/scm/linux/kernel/git/stable/linuxstable.git or one of the Yocto repos, git://git.yoctoproject.org/linux-yocto-3.8 for example. In that clone, do the following. $ $ $ $ $ $
git git git git git git
remote rm origin remote add origin
config master.remote origin config master.merge refs/heads/master push origin master push --tags origin master 1
Switch origin to https $ git config remote.origin.url
Add the original repo as upstream $ git remote add upstream
To get the latest changes from upstream $ git fetch upstream $ git merge upstream/master
Clone a Repository $ git clone [email protected]:lsigithub/lsi_axxia_linux.git
Get a Remote Branch and Turn on Tracking $ git checkout --track -b origin/
Switch to an Existing Branch $ git checkout
List Local Branches $ git branch
List all Branches $ git branch -a
Create a Patch $ git format-patch master --stdout > OR $ git diff master >../ 2
Create a Remote Branch $ $ $ $
git git git git
checkout branch push origin branch --set-upstream origin/
Checking in Changes $ git add $ git commit
Update a Remote Branch $ git push
Reverting All Uncommited Changes $ git reset --hard $ git clean -fdx
Deleting a branch $ git branch -d $ git push origin :
Renaming a Branch $ git branch -m old-branch-name new-branch-name $ git push origin :old-branch-name $ git push -u origin new-branch-name
Tagging $ git tag -a -m
Delete a Tag (Local and Remote) $ git tag -d $ git push origin :refs/tags/ 3
Merging commits $ git rebase -i HEAD~N (where N is the number of commits to merge) $ git commit --amend (to change the final comments) $ git rebase --continue (to finish)
Push to public. . . $ git checkout master $ git push public $ git push public --tags
Merging Safely $ git branch $ git merge If the merge went well, $ git branch -d If not, $ git reset --hard
Document Version $Revision: 1.1 $ $Date: 2014/03/18 17:01:03 $
4