git remote show origin
Monday, March 28, 2011
GIT: Remote branches
Show remote branches:
Wednesday, March 16, 2011
GIT: Pushing a new repository to a git server the first time
Scenario:
You created some local repository and worked on that for a while. Now you want to have it on a server so that others can collaborate.
We want to keep the full history so we want to push the current repository to the server. In order to do this at least for the master branch you have to edit the config file at:
It probably looks like the following:
The easiest way to get everything right is to check out the empty repository from the server via
Finally you see that you have to add something like:
To the existing config.
Now issue a git push origin master and the master will be pushed.
If you know whether that works with branches as well or how to get that working, please drop me a comment!?
There are other ways to just give the repository as a argument at the
You created some local repository and worked on that for a while. Now you want to have it on a server so that others can collaborate.
We want to keep the full history so we want to push the current repository to the server. In order to do this at least for the master branch you have to edit the config file at:
/.git/config
It probably looks like the following:
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
The easiest way to get everything right is to check out the empty repository from the server via
git clone
and diff the two config files.Finally you see that you have to add something like:
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = user@yourgitserver.com:MyNewProject
[branch "master"]
remote = origin
merge = refs/heads/master
To the existing config.
Now issue a git push origin master and the master will be pushed.
If you know whether that works with branches as well or how to get that working, please drop me a comment!?
There are other ways to just give the repository as a argument at the
git push
command but I like to keep my old directories.
Wednesday, January 26, 2011
GIT: Merging changes of a branch back to master
You branched out for development and now it is time to get the improvements back to the master branch.
This is achieve by
To be sure to not mess up anything, I prefer to clone my repository first and do the merge there.
So best is if you commit all changes in master and dev branch. Do a couple of pushs and pulls so everything is in sync and then clone your repository to a new location.
You can directly clone the branch you want to merge then proceed to 2. otherwise do a
You have to resolve any conflicts in any files by removing the spiky brackets in the file and of course take a close look what caused the conflict and fix it.
Then add the file via
Do this for every file.
This is achieve by
git merge
while on the master branch.To be sure to not mess up anything, I prefer to clone my repository first and do the merge there.
So best is if you commit all changes in master and dev branch. Do a couple of pushs and pulls so everything is in sync and then clone your repository to a new location.
You can directly clone the branch you want to merge then proceed to 2. otherwise do a
git checkout branchname
git checkout master
git merge branchname
You have to resolve any conflicts in any files by removing the spiky brackets in the file and of course take a close look what caused the conflict and fix it.
Then add the file via
git add
and commit it via git commit
.Do this for every file.
Thursday, January 20, 2011
CVS: Get new directories of the server
If you want to update your CVS working copy to get new directories from the server, a simple
Try
cvs up
does not get these directories.Try
cvs up -d
Saturday, January 15, 2011
Friday, January 14, 2011
GIT: Creating a local Repository
Till now all my posts concerned repositories already created. But how to create your own git rep in the first place?
Simply execute:
and the new-rep-dir is a git repository
Hint by TZ:
Simply execute:
mkdir new-rep-dir
cd new-rep-dir
git init-db
and the new-rep-dir is a git repository
Hint by TZ:
git init
is the alias for git init-db
Thursday, December 23, 2010
GIT: Working on Branches: Sharing files and commits
Motivation:
You have several development branches but basically use the same files to test or benchmark all versions. Then there is no sense in developing different code in all these branches for the same purpose.
You can easily merge single files from one branch to the other by cherry-pick.
Example:
1. First commit a file and only the file you want to share, nothing else:
2. Save the
3. Go to the other branch folder or checkout the other branch in the same folder, as you like.
4. git cherry-pick
You should now have the same file in the other branch as well.
Thanks to Markus for pointing me towards this.
You have several development branches but basically use the same files to test or benchmark all versions. Then there is no sense in developing different code in all these branches for the same purpose.
You can easily merge single files from one branch to the other by cherry-pick.
Example:
1. First commit a file and only the file you want to share, nothing else:
git commit bench.sh -m"Newest fancy script which does all tests for all versions"
2. Save the
key somewhere.3. Go to the other branch folder or checkout the other branch in the same folder, as you like.
4. git cherry-pick
123784hash
You should now have the same file in the other branch as well.
Thanks to Markus for pointing me towards this.
Wednesday, December 22, 2010
GIT: Tagging
Tags are nothing else then names for certain revision.
So called annotated tags store the status of the project at a specific point in time for future use.
Create a tag:
Push tag to repository:
So called annotated tags store the status of the project at a specific point in time for future use.
Create a tag:
git tag -a v1.0 -m"Your comment for version 1.0"
Push tag to repository:
git push --tags
Contact Information
Johannes Habich M. Sc.
* E-Mail: Johannes("at")Habich.info
* Homepage: http://www.johannes-habich.de
Official RRZE contact site
Personal Homepage and private Contact
* E-Mail: Johannes("at")Habich.info
* Homepage: http://www.johannes-habich.de
Official RRZE contact site
Personal Homepage and private Contact
Monday, December 20, 2010
Windows7 / Vista / Server2008 unidentified network
Although a network consisting of a switch and 2 computers would be considered as very private, Win7(aso.) will consider it as unidentifiable and will not allow you to set the network to private.
Here's a howto on solving this issue:
1. Start –> run –> MMC –> press enter
2. In MMC console , from menu file select Add/Remove Snap-in
3. Select Group Policy Object editor –> Press Add –> select Local computer –> press OK –>press OK
4. Open Computer configration –>Windows Settings –>Security Settings –>select Network list manager policies
on the right Side you will see options:
double click –>Unidentified networks
5. Then you can select the option to consider the Unidentified networks as private and if user can change the
location
Source
Here's a howto on solving this issue:
1. Start –> run –> MMC –> press enter
2. In MMC console , from menu file select Add/Remove Snap-in
3. Select Group Policy Object editor –> Press Add –> select Local computer –> press OK –>press OK
4. Open Computer configration –>Windows Settings –>Security Settings –>select Network list manager policies
on the right Side you will see options:
double click –>Unidentified networks
5. Then you can select the option to consider the Unidentified networks as private and if user can change the
location
Source
Subscribe to:
Posts (Atom)