Skip to content

Instantly share code, notes, and snippets.

@dmgl
Last active May 18, 2020 21:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dmgl/645caeb1aa6557eef5dd835a0f643f2b to your computer and use it in GitHub Desktop.
Save dmgl/645caeb1aa6557eef5dd835a0f643f2b to your computer and use it in GitHub Desktop.
Instructions for making git repo
# Create a bare repository on the server side.
cd ~/Projects; sudo -u pi mkdir -m 770 project.git
cd project.git; sudo -u pi git --bare init --shared=group
# From client side the developer’s project must be pushed into the new bare server repository:
# First, create a new local git repository and add all files within this folder.
cd dir_with_files; git init; git add .; git commit -m "creation repo"
git remote add origin ssh://pi@address:port/home/pi/Projects/project.git
# Check origin
git remote show origin
# If mistakes in url
git remote set-url origin ssh://user@address:port/path/project.git
# If need to remove remote
git remote remove <name>
# Then push
git push origin master
# Or push all branches
git push --all origin
@dmgl
Copy link
Author

dmgl commented Nov 7, 2019

Note

git branch -r | grep -v HEAD | awk -F'/' '{print $2 " " $1"/"$2}' | xargs -L 1 git branch -f --track
git fetch --all
git pull --all

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment