checkout Command | Git

Introduction The git checkout command switches between branches or restores working tree files. This command operates upon three distinct entities: files, commits, and branches.   Checking out branch Use git checkout command to navigate between the branches created by git branch. Checking out a branch updates the files in the [...]

By |2019-11-16T14:25:29+05:30November 16th, 2019|Categories: Version Control|Tags: |

How to Add Files to Gitignore ?

Introduction To ignore a class of files that you don’t want Git to automatically add or even show you as being untracked, create a named .gitignore and  add entries of those files as shown in following example. $ cat .gitignore *.[oa] *~ First line show the content of file. Second [...]

By |2021-04-03T21:13:53+05:30November 12th, 2019|Categories: Version Control|Tags: |

status Command | Git

Git status command is used to know the status of the working tree. It shows the state of your working directory and helps you see all the files which are untracked by Git, staged or unstaged. In other words, Git will show you any difference in the current tree and [...]

By |2019-11-11T17:25:25+05:30November 11th, 2019|Categories: Version Control|Tags: |

add Command | Git

The add command marks changes to be included in the next commit. It adds changes to "Staging Area", the contents of which can then be wrapped up in a new revision with the git commit command. However, git add doesn't really affect the repository in any significant way—changes are not actually recorded [...]

By |2019-11-11T22:16:41+05:30November 11th, 2019|Categories: Version Control|Tags: |

Perforce command line

Perforce configuration details like current user, current workspace and other details p4 info Current working workspace and logged in user p4 set P4CLIENT Change the workspace // Change the workspace to 'client1' p4 set P4CLIENT=client1 Login to P4 on terminal p4 login Get latest revision of the files p4 sync [...]

By |2019-09-02T21:17:41+05:30September 2nd, 2019|Categories: Version Control|

Resolving files in Perforce

Resolve option in Perforce: Accept Source: Replaces the copy of the file in your workspace with the version that is in the depot, discarding your changes. Accept Target: Accepts the file that is in your workspace, overwriting the version that is in the depot when you submit the file. Accept [...]

By |2017-03-13T19:50:00+05:30March 13th, 2017|Categories: Version Control|

File revision states | Git

Git has three main states that files can reside in i.e. Committed Modified Staged Committed means that the data is safely stored in your local database. Modified means that you have changed the file but have not committed it to your database yet. Staged means that you have marked a [...]

By |2019-11-11T16:30:39+05:30February 3rd, 2017|Categories: Version Control|Tags: |

Undo all uncommitted changes in Git

Unstage all files you might have staged with git add: git reset Revert all local uncommitted changes (should be executed in repository root): git checkout . Revert all uncommitted changes git reset --hard HEAD Remove all local un tracked files, so only git tracked files remain git clean -fdx Undo [...]

By |2017-03-07T12:49:05+05:30January 31st, 2017|Categories: Version Control|Tags: |

Sync local repo with remote one in Git

Local code repository can be synchronized with remote by following different ways :- git fetch --prune -p, --prune After fetching, remove any remote-tracking branches which no longer exist on the remote. git fetch origin git reset --hard origin/master git clean -f -d This makes your local repository exactly like your [...]

By |2017-01-31T14:17:55+05:30January 31st, 2017|Categories: Version Control|Tags: |

Views in Perforce

There are three types of views: client views, branch views, and label views. Client views map files in the depot to files in the client workspace Branch views map files in the depot to other parts of the depot Label views associate groups of files in the depot with a [...]

By |2017-01-19T20:05:34+05:30January 19th, 2017|Categories: Version Control|
Go to Top