[ubuntu-za] trying to create a working git repository in my Ubuntu Linux
Bruce Pieterse
dev at otq.za.net
Thu Apr 3 16:42:58 UTC 2014
On 03/04/2014 17:19, nico.michael at arduino.org.za wrote:
> Hi there
>
> I have used the following steps to create a repository
> add a dummy text file so i can send it to my Git server
>
> cd /home/nico/git
> mkdir MY_JAVA_PROJECT
> cd MY_JAVA_PROJECT/
> git init
> touch deleteme.txt
> git add .
> Got error added this to fix it :
> git config --global user.name "nickm"
> git config --global user.email "nico.michael at arduino.org.za"
>
> git commit -m "initial commit"
>
>
> local/path/to/local/project> git checkout mybranch
> got Error : error: pathspec 'mybranch' did not match any file(s) known
> to git.
>
> Please advise
>
> regards
> Nico
>
Hi Nico,
git checkout mybranch checks out a local branch if it exists. In this
case mybranch doesn't.
If you need to push to a server you need to add a remote:
git remote add origin <gituser>@<gitserver>:<path/to/repo> i.e.
git at git.myserver.co.za:project.git
Once that is done you can then push your untracked branch, master as
this is where all commits go if it is a new repository, to the server with:
git push origin -u master
This is optional and is default for user.name you should actually set it
like:
git config --global user.name "Nico Michael"
So when you do git log it will come up with
commit 4a02eca82dfbfb2008ea59c128bd6cb66555aa88
Author: Nice Michael <nico.michael at arduino.org.za>
Date: Thu Apr 3 18:30:16 2014 +0200
Summary of changes
* Change 1
* Change 2
Resolves issue #12345
--
All the best,
Bruce
FSF Member 10674 / The FSF is a charity with a worldwide mission to advance software freedom / Join the Free Software Foundation: http://www.fsf.org/register_form?referrer=10674
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-za/attachments/20140403/bc769955/attachment.html>
More information about the ubuntu-za
mailing list