[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Git push commands
From: |
Reinhold Kainhofer |
Subject: |
Re: Git push commands |
Date: |
Fri, 4 Jul 2008 10:00:58 +0200 |
User-agent: |
KMail/1.9.9 |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Am Freitag, 4. Juli 2008 schrieb Carl D. Sorensen:
> What should I do different to avoid the merge commit every time I push?
I do "git pull" very often, typically before I do a git commit locally. This
way, your changes are then realative to HEAD (=the lateste commit on the
server). If you don't have any local commits on HEAD, you won't get a merge
commit.
Of course, if there are any conflicts, you'll have to resolve them anyway (git
pull would also require this).
Alternatively, you can do
git fetch
instead of "git pull", which will not modify your checkout, but only your
local repository data (so you'll have the latest commits in the .git
directory, but not in the checked out files). Any local commits can then be
moved from the point it was commited (i.e. the version of the files you see)
to the latest commit by
git rebase origin
This simply takes all your local commits and tries to apply it to the current
HEAD.
Again, there might be conflicts, which require manual resolving...
> P.S. Is there a way to make it so I don't have to enter my dsa passphrase
> every time I pull or push?
Yes, an ssh-agent. If you are running any recent Linux distribution, ssh-agent
should be started automatically. On Windows I don't know how to properly set
up an agent.
If an agent is running, simply use ssh-add to add the key to the agent (this
requires the password). It will keep your key in memory and for all ssh
connections will use that key without required the key again.
Cheers,
Reinhold
- --
- ------------------------------------------------------------------
Reinhold Kainhofer, Vienna University of Technology, Austria
email: address@hidden, http://reinhold.kainhofer.com/
* Financial and Actuarial Mathematics, TU Wien, http://www.fam.tuwien.ac.at/
* K Desktop Environment, http://www.kde.org, KOrganizer maintainer
* Chorvereinigung "Jung-Wien", http://www.jung-wien.at/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
iD8DBQFIbdi/TqjEwhXvPN0RAtyyAKDT/xg4ZMyQK+Q7AOSoICNYK+zwGwCg3N5J
aoobhEF2h5jWFKiTyddTbR0=
=f2g7
-----END PGP SIGNATURE-----