[Tutor] Questions (and initial responses) on using version control: Why cannot I push my single (master) branch to origin without an error occurring?

Albert-Jan Roskam fomcl at yahoo.com
Fri May 1 14:52:26 CEST 2015


----------------------------
On Fri, May 1, 2015 6:21 AM CEST Alex Kleider wrote:

>On 2015-04-30 20:39, boB Stepp wrote:
>> I created my remote repository on, say my C-drive, with "git init". I
>> then copied and pasted a file to that location and put it under
>> version control with "git add filename.py". Next I went to my E-drive,
>> which is where I intend to be my working directories. After setting up
>> a similar directory structure (/Projects/), I typed "git clone
>> C:/Projects/project_name" and the desired result appeared on E:
>> E:/Projects/project_name/filename.py. All seemed well with the world!
>> 
>> Now I made some edits to filename.py in my working directory,
>> added/committed and then attempted to push to the remote repository
>> and got this:
>
>I would suggest the following work flow to set up two parallel repositories:
>
>cd <first repo directory>
>git init
><do what ever>
>git add <files on which you did what ever>
>git commit
>
>cd <directory where you want the same repository>
>git clone <first repo directory>
># the above command brings in a copy of all that was committed in the first repo.
>
>Once this is done, I believe your subsequent commits can be pushed without the errors.

I recently did this by creating an alias:
git config alias.pushall '!git push origin devel && git push github devel

So you can use 'git pushall'. The other method mentioned on SO did not work for me.

Source: http://stackoverflow.com/questions/14290113/git-pushing-code-to-two-remotes


More information about the Tutor mailing list