Welcome to FreeSoftwareServers Confluence Wiki



You have a dev server that should push to master:

git checkout devb
git push --set-upstream origin devb
touch devbfile
git add .
git commit -m "init"
git push origin master

git checkout master
git push --set-upstream origin master 
git pull origin devb
ls -la
git add .
git commit -m "init"


git pull
git pull --no-edit origin dev


git commit -a -m "Commit"

Mirror to new Repo:

git push --mirror ssh://...

List Branches:

git branch -a -vv

Create New Branch:

git checkout -b newbranchname

Checkout Existing Branch:

git checkout branchname

Push to Branch:

git push origin newbranchname
git push origin head:master
git push -f origin head:master

Set upstream:

git push --set-upstream origin newbranchname

Overwrite Local w/ Remote Branch:

git reset --hard origin/master
git reset --hard 0d1d7fc32
git pull

Rename Branch:

git branch -m <newname>

git push -u origin
git push origin HEAD
git push origin --delete master

Delete Remote Branch:

git  branch -d origin <branchname>
Delete a branch with git branch -d <branch> . The -d option will delete the branch only if it has already been pushed and merged with the remote branch. 
git  branch -D origin <branchname>
Use -D instead if you want to force the branch to be deleted, even if it hasn't been pushed or merged yet.


Ref Issues

git remote prune origin
  • No labels