| by Scott Kilroy

Intro to Git

If you’re new to Git checkout https://www.linuxtechi.com/learn-git-command-examples-linux-part-1/ it’s a good starting point.

Share Button
Read More
| by Scott Kilroy

Misc git tips

Want to see if your branch is on the remote server? Want to see what branches are? Run git branch -av Not seeing your branch on the remote server, run git push origin BRANCH_NAME Added a file to .gitignore but you already checked it in? Run git rm –cached FILENAME Changing your origin server? Run git remote remove origin

Share Button
Read More
| by Scott Kilroy

When you totally screw up in git

When you totally screw up and want to do a git pull to replace all your files do this git reset –hard HEAD git pull

Share Button
Read More
| by Scott Kilroy

Working with a remote git repo

Create a directory (in this example we’ll use gitdir) cd into gitdir run git init this will create a empty git repo now run git remote add origin PATH_TO_REMOTE_GIT_SERVER ie git remote add origin file:///srv/git git clone ssh://user@server/project.git

Share Button
Read More
| by Scott Kilroy

Getting started with git

A good how to can be found at http://www.linuxjournal.com/content/git-revision-control-perfected?page=0,0

Share Button
Read More
| by Scott Kilroy

Configuring git

git config –global user.name “USER_NAME” git config –global user.email “USER_EMAIL” and if you work with Windows files git config –global core.autocrlf false

Share Button
Read More
| by Scott Kilroy

Git – A better way to manage git with multi-users

Create a directory to store all your repos.  I like putting them in /var/git-repos cd into /var/git-repos (or whatever you called it) mkdir PROJECT_NAME.git cd PROJECT_NAME.git git init –bare Then Each user works locally (could be on their own system or could be in a personal directory on the same server). Run the following: mkdir PROJECT_NAME cd PROJECT_NAME git init if working on the same server you could use git remote add origin /var/git-repos/PROJECT_NAME.git if working remotely you could use […]

Share Button
Read More
| by Scott Kilroy

Git – problems with first push

No refs in common and none specified; doing nothing. Perhaps you should specify a branch such as ‘master’. fatal: The remote end hung up unexpectedly Just run git push origin master Or if you get error: src refspec master does not match any. just do git commit -m “initial commit” git push origin master

Share Button
Read More
  • 1
  • 2