Note that there are some explanatory texts on larger screens.

plurals
  1. POgit setup for a single developer?
    text
    copied!<p>I often need to develop stuff on the road, with no internet/network connection. I am only a single developer, so until now I simply had a SVN repository on my machine and did a checkout on my laptop when I went away. Problem: That gives me no Source Control on the road.</p> <p>So I tried out changing to git, which seems to do what I want, but I am not sure I understand properly how it's supposed to be used in my setup.</p> <p>Essentially:</p> <ul> <li>Created a repository on \myserver\share\project using <code>git init</code></li> <li>Cloned that repository to machine 1 using <code>git clone</code></li> <li>Cloned that repository to machine 2 using <code>git clone</code></li> <li>Worked on machine 2, using <code>git commit</code> to commit any changes to my local repository</li> <li>Finally used <code>git push</code> to push all changes back to \myserver\share\prohect</li> <li>Used <code>git pull</code> on machine 1 to get newest changes from \myserver\share\project</li> </ul> <p>That works, but the <code>git push</code> command gives me a warning saying that pushing the checked-out branch is not supported as it may confuse the index. Now, I'm confused, because the message was also written in a serious tone, which means that I should possibly honor it (and indeed, gitk shows that I now have two branches: master and remotes/origin/master), but I do not fully understand the terminology yet.</p> <p>What would be the correct steps in my situation?</p> <ul> <li>I will only ever work on machine 1 OR machine 2, never on both</li> <li>I intend to use branching as a way to have a separate branch for bugfixes/tests (just like in the usual way), but not as a way to have multiple developers</li> <li>I really mainly want to use it as an alternative to rsync my SVN.</li> </ul> <p>Edit: There are two oddities. The first one is if I simply change a file, it says "Changed but not updated". which is weird:</p> <pre><code># On branch master # Changed but not updated: # (use "git add &lt;file&gt;..." to update what will be committed) # (use "git checkout -- &lt;file&gt;..." to discard changes in working directory) # # modified: myproject/Readme.txt # no changes added to commit (use "git add" and/or "git commit -a") </code></pre> <p>The second message is the one that I think is the culprit, the output of git push:</p> <pre><code>warning: You did not specify any refspecs to push, and the current remote warning: has not configured any push refspecs. The default action in this warning: case is to push all matching refspecs, that is, all branches warning: that exist both locally and remotely will be updated. This may warning: not necessarily be what you want to happen. warning: warning: You can specify what action you want to take in this case, and warning: avoid seeing this message again, by configuring 'push.default' to: warning: 'nothing' : Do not push anything warning: 'matching' : Push all matching branches (default) warning: 'tracking' : Push the current branch to whatever it is tracking warning: 'current' : Push the current branch Counting objects: 7, done. Delta compression using up to 4 threads. Compressing objects: 100% (4/4), done. Writing objects: 100% (4/4), 333 bytes, done. Total 4 (delta 3), reused 0 (delta 0) Unpacking objects: 100% (4/4), done. warning: updating the current branch warning: Updating the currently checked out branch may cause confusion, warning: as the index and work tree do not reflect changes that are in HEAD. warning: As a result, you may see the changes you just pushed into it warning: reverted when you run 'git diff' over there, and you may want warning: to run 'git reset --hard' before starting to work to recover. warning: warning: You can set 'receive.denyCurrentBranch' configuration variable to warning: 'refuse' in the remote repository to forbid pushing into its warning: current branch. warning: To allow pushing into the current branch, you can set it to 'ignore'; warning: but this is not recommended unless you arranged to update its work warning: tree to match what you pushed in some other way. warning: warning: To squelch this message, you can set it to 'warn'. warning: warning: Note that the default will change in a future version of git warning: to refuse updating the current branch unless you have the warning: configuration variable set to either 'ignore' or 'warn'. To file:///\\myserver\share\project 129649b..1f4b957 master -&gt; master </code></pre> <p>So it tells me that "pushing into the current branch" is not recommended, but I don't really get what the proper way of doing this is.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload