On this page... (hide)
- usage notes
- Sync a fork with the master repo/update to master
- using github
- Git Hub
- My notes on using Git (which need to be cleaned up)
- Link Dump
- See Also
- Add Comment
Git is not better than Subversion. But is also not worse. It’s different.
The key difference is that it is decentralized. Imagine you are a developer on the road, you develop on your laptop and you want to have source control so that you can go back 3 hours.
With Subversion, you have a Problem: The SVN Repository may be in a location you can’t reach (in your company, and you don’t have internet at the moment), you cannot commit. If you want to make a copy of your code, you have to literally copy/paste it.
With Git, you do not have this problem. Your local copy is a repository, and you can commit to it and get all benefits of source control. When you regain connectivity to the main repository, you can commit against it.
Github vs Bitbucket (infoworld)
I’ve used Tortise Git (see below) in the past, but found that I do everything on the commandline, and ignore the whole Tortoise GUI portion.
mysysgit has been deprecated in favor of git
You can do
git add --patch filename.x (or -p for short), and git will begin breaking down your file in what it thinks are sensible “hunks” (portions of the file). You will then be prompted with this question:
Stage this hunk [y,n,q,a,d,/,j,J,g,s,e,?]?
If you just want to start a new project without the angular-seed commit history then you can do:
git clone --depth=1 https://github.com/angular/angular-seed.git <your-project-name>
depth=1 tells git to only pull down one commit worth of historical data.
git reset HEAD <file> (source)
You can use
git reset without any file name to undo all due changes.
- list all local and remote branches
git branch -a
- list only remote branches
git branch -r
git remote and
git ls-remote to list more info.
See list remote branches and probably git docs.
This came from http://gitready.com/ which hasn’t been updated since 2011; but Git really hasn’t changed all that much, anyway.
This cannot be done on github, must be done on command-line.
This is a concise summary of commands -- more explanation and verification at source:
git fetch upstream
git checkout master
git merge upstream/master
Now, push changes to the repo.
I’m trying to use more Powershell... so, bit by bit.... plus, even though I’m in powershell, all of my GnuWin32 tools still work (AFAIK).
I’ve been using “Git for Windows” (
git version 1.8.0.mysysgit.0) at the same time that I have git for cygwin.
Since I’ve always been using the “Git Bash Here” command to launch the shell, it’s been a long time since I realized I had Cygwin git installed.
mysysgit wasn’t on the PATH, so
ungit cried foul, declaring that first, it needed git >= 1.8.0 and cygwin git is only 1.7.x.
So, I uninstalled cygwin git (and apparently updated everything else in Cygwin. yay. :::sigh:::).
Then ungit sez it can’t find git at all (really “unable to run
So then I added it to the path.
At the end.
And it seems to work.
Can consume a serious amount of CPU that sets off the fan on my laptop.
Yesterday I had to reboot to get it to slow down.
Also: by default,
ungit wants to go to your “home” directory.
On Windows7, that was
Charmingly, something about Windows7 wouldn’t get a response from that directory in any reasonable time period.
Once I reset it to something else (
d:\temp) I got the “no repos here” page.
Apparently, I need to set the username in my
prose.io is a content editor for GitHub designed for managing websites. And it works pretty smoothly.
HN: Introducing prose.io (2012)
This worked for me. Although getting Tortoise git going with BitBucket was still a hassle.
(UPDATE a couple of months later: really, what was the problem? I don’t recall.)
I used the command-line for a while. (UPDATE a couple of months later: aaaaaand, what’s so bad about that?)
mysysgit is installed at
d:\dev\git and it is
Honestly, I’m using the command-line almost exclusively as of 2013.05.29.
tgitcache cpu usage
TGitCache.exe can consume a significant chunk of CPU power for way too long.
The below solution seems to work, although it is less than perfect:
TortoiseGit→setting → Icon Overlays choose “Shell” or “None” to disable
- It will loss some icon overlays features, but it should be quick.
api info (json) - similar to https://api.github.com/repos/dariusk/NaNoGenMo-2015/issues
NaNoGenMo bot parses issues to get info: https://github.com/hugovk/nanogenmobot/ (python)
Set up git - including notes on authentication.
I’m using ... some install of git, not cygwin nor Gnu core tools.
And I have a pass-phrase that I fat-finger 3/4 of the time
git config --global github.user username git config --global github.token blah git config -l
I forked a fork, since my contribs were based on changes not yet present in the head project.
My first pull-request worked properly to the head.
My second pull-request ended up being on the fork.
No idea what I did differently.
I tried some command-line options, but they got me nowhere.
HOWEVER, the below steps seem to have worked:
- go to Master project
- Pull Requests
- New Pull Request
- Compare across forks
- Select head fork repository: will be comparing base:master to head:master
- switch the base (not really available on the above page)
- Edit >> change head fork compare: <branch>
- View Pull Request
- create the repo in github (don’t add the readme.md file)
- navigate to repo
git push --mirror https://github.com/<username>/<repo>.git
- bob’s yer uncle
Oh, aaaand, I may have edited
url = https://github.com/MichaelPaulukonis/webtext.git
I mean, I did. Don’t know if that helped nor hurt.
Based on http://www.harecoded.com/upload-an-existing-git-repository-to-remote-github-bitbucket-beanstalk-1314699 and https://coderwall.com/p/ufxjgg
See Emacs.OrgMode#markdown for Emacs integration.
http://lea.verou.me/2011/10/easily-keep-gh-pages-in-sync-with-master/ - NOTE: in-sync means THE SAME
git checkout gh-pages // go to the gh-pages branch
git rebase master // bring gh-pages up to date with master
git push origin gh-pages // commit the changes
git checkout master // return to the master branch
Your project will be shortly live @
Hey! What if your
gh-pages branch is different from master... that is NOT IN SYNC.
Wait... why would that even be?
Well, let’s say that master relies upon node_modules that are never committed, but your gh-pages branch.... needs to have these node_modules present (since you are, apparently, using them for both node and web.).
rebase-ing, checkout individual files from the
git checkout master file.foo otherfile.foo where we assume the branch is master.
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/MichaelPaulukonis/processing.git
git push -u origin master
Private repos cost money.
See Also: SocialMedia#github !!!
Private repos are free (5 of them?)
Public repos unlimited
I store non-public repos in bitbucket.
have a login -- check passpack if you forget
create a new private repo called michaelpaulukonis.com
- go to directory (I used “open git bash here”)
git add .
- this presumes you want to add everything.
- if you don’t.....
git commit -m "some message"
on bitbucket, I chose “Push up an existing repository”
on the above getting-started link it is labelled differently
cd /path/to/my/repo-- I skipped this step, as I was already in the repo via the git bash
git remote add origin https://MichaelPaulukonis@bitbucket.org/MichaelPaulukonis/michaelpaulukonis.com.git
git push -u origin --all- to push up the repo for the first time
it then prompted me for my password (see passpack)
THAT SHOULD BE IT!!!!
pretty much the same, only I followed git instructions for creating a new repo
It allows you to pre-create a readme.md file, which I did
and so, when I attempted to push... IT FAILED
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'https://github.com/MichaelPaulukonis/pmwiki-bootstrap-skin'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Merge the remote changes (e.g. 'git pull')
hint: before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
so, I had to
* branch HEAD -> FETCH_HEAD
Merge made by the 'recursive' strategy.
README.md | 2 ++
1 file changed, 2 insertions(+)
create mode 100644 README.md
worked like a charm
So sue me. I change my mind. Thank g-d this isn’t like CVS or (ugh) VSS.
The experience wasn’t exactly pleasant as I kept fat-fingering things and couldn’t keep mental track of the original and proposed directory structure in my head, but I got it there.
One more move to go, I think. then we’ll be set.....
Programmers.StackExchange: Are Frequent Complicated Merge Conflicts A Sign of Problems?
No comments yet.