Giter Site home page Giter Site logo

git-help's Introduction

Git Help

Make new branch

git checkout -b my-new-branch

Clone Repo

git clone ssh://<repo_url>

Fix filename too long error

You'll probably have to run your shell as an administrator if in Windows

git config --system core.longpaths true

Pushing to online repo

git checkout master
git pull
git checkout <your branch>
# just to make sure everything is committed
git commit -am "<commit message>"
# rebase to combine possible changes from others to master
git rebase master
git push origin <your branch>

After that, if you want to push to the remote master, do this (only after completing the previous step!):

git checkout master
git merge devBranchName
git push

Delete remote branch

git push origin --delete branch_name

Merge branchB into branchA

git checkout branchA
git merge branchB

branchB can now be safely removed.

git branch -d <branch path>

Rename Branch

Current Branch:

git branch -m newName

Other Branch:

git branch -m oldName newName

Create SubBranch

git branch subBranchName parentBranchName

List Branches

# local branches
git branch
# remote branches
git branch -r

See log of remote branch

git log origin/master

Undo Commits, Reapply Later

# go back a commit
git reset --soft HEAD^
git stash save "name to be saved in stash"
# repeat as needed

# do whatever you need to do here

# reapply commits
git stash pop
git commit -am "title of commit to be reapplied"
# repeat as needed

Remove all Uncommitted Changes

While in the master repository root:

git checkout -- ./

See List of Tracked Files

git ls-tree --full-tree -r --name-only HEAD

Tag a commit

git tag -a <tag/version> -m "your message"

To list tags, use:

git tag

Create a remote origin

git remote add origin URL
git remote -v # verify

# first push
git push -u origin master

git-help's People

Contributors

electrovir avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.